diff --git a/src/utils/markdownUtils.ts b/src/utils/markdownUtils.ts index 24149c3..6445a13 100644 --- a/src/utils/markdownUtils.ts +++ b/src/utils/markdownUtils.ts @@ -76,15 +76,15 @@ export function processNestedCodeBlocks(content: string) { } export function transformThinkingTags(content: string) { - if (content.startsWith('`') && content.endsWith('`')) { - return content; - } + if (content.startsWith('`') && content.endsWith('`')) { + return content; + } - return content.replace( - /([\s\S]*?)<\/thinking>/g, - (_match: string, thinkingContent: string) => - `
💭 Thinking\n\n${thinkingContent}\n\n
` - ); + return content.replace( + /([\s\S]*?)<\/think(?:ing)?>/g, + (_match: string, thinkingContent: string) => + `
💭 Thinking\n\n${thinkingContent}\n\n
` + ); } export function parseMarkdownContent(content: string) {