fix Multiple <think>\n Interface rendering exception (#20977)

This commit is contained in:
XiaoCC
2025-06-18 11:31:04 +08:00
committed by GitHub
parent 45c89bd6de
commit 0784c6295d

View File

@@ -28,7 +28,7 @@ export const preprocessLaTeX = (content: string) => {
} }
export const preprocessThinkTag = (content: string) => { export const preprocessThinkTag = (content: string) => {
const thinkOpenTagRegex = /<think>\n/g const thinkOpenTagRegex = /(<think>\n)+/g
const thinkCloseTagRegex = /\n<\/think>/g const thinkCloseTagRegex = /\n<\/think>/g
return flow([ return flow([
(str: string) => str.replace(thinkOpenTagRegex, '<details data-think=true>\n'), (str: string) => str.replace(thinkOpenTagRegex, '<details data-think=true>\n'),