@gendive/chatllm 0.10.2 → 0.10.3

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.
@@ -2653,6 +2653,7 @@ var CODE_BLOCK_REGEX = /```(\w*)\n?([\s\S]*?)```/g;
2653
2653
  var THINKING_TAG_REGEX = /<thinking>([\s\S]*?)<\/thinking>/gi;
2654
2654
  var THINKING_CODEBLOCK_REGEX = /```thinking\n?([\s\S]*?)```/gi;
2655
2655
  var THINKING_TEXT_REGEX = /^Thinking:\s*\n([\s\S]*?)(?=\n\n|$)/gim;
2656
+ var UNCLOSED_THINKING_TAG_REGEX = /<thinking>(?![\s\S]*?<\/thinking>)[\s\S]*/gi;
2656
2657
  var INLINE_CODE_REGEX = /`([^`]+)`/g;
2657
2658
  var BOLD_REGEX = /\*\*([^*]+)\*\*/g;
2658
2659
  var ITALIC_REGEX = /(?<!\*)\*([^*]+)\*(?!\*)/g;
@@ -3357,6 +3358,7 @@ var MarkdownRenderer = ({
3357
3358
  processedContent = processedContent.replace(THINKING_CODEBLOCK_REGEX, "");
3358
3359
  processedContent = processedContent.replace(THINKING_TEXT_REGEX, "");
3359
3360
  }
3361
+ processedContent = processedContent.replace(UNCLOSED_THINKING_TAG_REGEX, "");
3360
3362
  const codeBlocks = [];
3361
3363
  processedContent = processedContent.replace(CODE_BLOCK_REGEX, (_, lang, code) => {
3362
3364
  codeBlocks.push({ language: lang || "", code });