Skip to content

Commit

Permalink
fix: fixed <think> tags support
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Mar 10, 2025
1 parent a68d7b7 commit de6e22a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/utils/markdownUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
/<thinking>([\s\S]*?)<\/thinking>/g,
(_match: string, thinkingContent: string) =>
`<details><summary>💭 Thinking</summary>\n\n${thinkingContent}\n\n</details>`
);
return content.replace(
/<think(?:ing)?>([\s\S]*?)<\/think(?:ing)?>/g,
(_match: string, thinkingContent: string) =>
`<details><summary>💭 Thinking</summary>\n\n${thinkingContent}\n\n</details>`
);
}

export function parseMarkdownContent(content: string) {
Expand Down

0 comments on commit de6e22a

Please sign in to comment.