Skip to content

Commit

Permalink
🐛 fix: fix <think> tag crash with special markdown content (lobehub…
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Feb 2, 2025
1 parent 8268a0c commit b719522
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ export const createRemarkCustomTagPlugin = (tag: string) => () => {

// 转换为 Markdown 字符串
const content = contentNodes
.map((n: any) => toMarkdown(n))
.map((n: any) => {
// fix https://github.com/lobehub/lobe-chat/issues/5668
if (n.type === 'paragraph') {
return n.children.map((child: any) => child.value).join('');
}

return toMarkdown(n);
})
.join('\n\n')
.trim();

Expand Down

0 comments on commit b719522

Please sign in to comment.