mirror of
https://github.com/langgenius/dify.git
synced 2026-04-17 20:09:34 +08:00
fix Multiple <think>\n Interface rendering exception (#20977)
This commit is contained in:
parent
45c89bd6de
commit
0784c6295d
@ -28,7 +28,7 @@ export const preprocessLaTeX = (content: string) => {
|
||||
}
|
||||
|
||||
export const preprocessThinkTag = (content: string) => {
|
||||
const thinkOpenTagRegex = /<think>\n/g
|
||||
const thinkOpenTagRegex = /(<think>\n)+/g
|
||||
const thinkCloseTagRegex = /\n<\/think>/g
|
||||
return flow([
|
||||
(str: string) => str.replace(thinkOpenTagRegex, '<details data-think=true>\n'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user