@gendive/chatllm 0.10.2 → 0.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2702,6 +2702,7 @@ var CODE_BLOCK_REGEX = /```(\w*)\n?([\s\S]*?)```/g;
2702
2702
  var THINKING_TAG_REGEX = /<thinking>([\s\S]*?)<\/thinking>/gi;
2703
2703
  var THINKING_CODEBLOCK_REGEX = /```thinking\n?([\s\S]*?)```/gi;
2704
2704
  var THINKING_TEXT_REGEX = /^Thinking:\s*\n([\s\S]*?)(?=\n\n|$)/gim;
2705
+ var UNCLOSED_THINKING_TAG_REGEX = /<thinking>(?![\s\S]*?<\/thinking>)/gi;
2705
2706
  var INLINE_CODE_REGEX = /`([^`]+)`/g;
2706
2707
  var BOLD_REGEX = /\*\*([^*]+)\*\*/g;
2707
2708
  var ITALIC_REGEX = /(?<!\*)\*([^*]+)\*(?!\*)/g;
@@ -3406,6 +3407,7 @@ var MarkdownRenderer = ({
3406
3407
  processedContent = processedContent.replace(THINKING_CODEBLOCK_REGEX, "");
3407
3408
  processedContent = processedContent.replace(THINKING_TEXT_REGEX, "");
3408
3409
  }
3410
+ processedContent = processedContent.replace(UNCLOSED_THINKING_TAG_REGEX, "");
3409
3411
  const codeBlocks = [];
3410
3412
  processedContent = processedContent.replace(CODE_BLOCK_REGEX, (_, lang, code) => {
3411
3413
  codeBlocks.push({ language: lang || "", code });