Sfoglia il codice sorgente

bugfix:cant correct display latex (#14910)

tags/1.0.1
Likename Haojie 8 mesi fa
parent
commit
ff10a4603f
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.tsx

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

@@ -68,6 +68,7 @@ const preprocessLaTeX = (content: string) => {

return flow([
(str: string) => str.replace(/\\\[(.*?)\\\]/g, (_, equation) => `$$${equation}$$`),
(str: string) => str.replace(/\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`),
(str: string) => str.replace(/\\\((.*?)\\\)/g, (_, equation) => `$$${equation}$$`),
(str: string) => str.replace(/(^|[^\\])\$(.+?)\$/g, (_, prefix, equation) => `${prefix}$${equation}$`),
])(content)

Loading…
Annulla
Salva