瀏覽代碼

bugfix:cant correct display latex (#14910)

tags/1.0.1
Likename Haojie 7 月之前
父節點
當前提交
ff10a4603f
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 1 行新增0 行删除
  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)

Loading…
取消
儲存