Sfoglia il codice sorgente

fix: ensure newlines around think tags for proper markdown rendering (#20594)

tags/1.4.2
sayThQ199 5 mesi fa
parent
commit
077d627953
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1
    0
      web/app/components/base/markdown/markdown-utils.ts

+ 1
- 0
web/app/components/base/markdown/markdown-utils.ts Vedi File

@@ -33,5 +33,6 @@ export const preprocessThinkTag = (content: string) => {
return flow([
(str: string) => str.replace(thinkOpenTagRegex, '<details data-think=true>\n'),
(str: string) => str.replace(thinkCloseTagRegex, '\n[ENDTHINKFLAG]</details>'),
(str: string) => str.replace(/(<\/details>)(?![^\S\r\n]*[\r\n])(?![^\S\r\n]*$)/g, '$1\n'),
])(content)
}

Loading…
Annulla
Salva