diff --git a/web/app/components/base/markdown/markdown-utils.ts b/web/app/components/base/markdown/markdown-utils.ts index ff7dd5db01..d77b2ddccf 100644 --- a/web/app/components/base/markdown/markdown-utils.ts +++ b/web/app/components/base/markdown/markdown-utils.ts @@ -33,5 +33,6 @@ export const preprocessThinkTag = (content: string) => { return flow([ (str: string) => str.replace(thinkOpenTagRegex, '
\n'), (str: string) => str.replace(thinkCloseTagRegex, '\n[ENDTHINKFLAG]
'), + (str: string) => str.replace(/(<\/details>)(?![^\S\r\n]*[\r\n])(?![^\S\r\n]*$)/g, '$1\n'), ])(content) }