mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-17 13:06:21 +00:00
🐛 fix: fix <think> tag crash with special markdown content (#5670)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user