bugfix:cant correct display latex (#14910)

This commit is contained in:
Likename Haojie
2025-03-07 14:06:14 +08:00
committed by GitHub
parent 53eb56bb1e
commit ff10a4603f

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