Quellcode durchsuchen

bugfix:cant correct display latex (#14910)

Likename Haojie vor 1 Monat
Ursprung
Commit
ff10a4603f
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      web/app/components/base/markdown.tsx

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

@@ -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)