瀏覽代碼

chore: support both $$ and $ latex format (#5723)

tags/0.6.12-fix1
Nam Vu 1 年之前
父節點
當前提交
9513155fa4
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. 2
    1
      web/app/components/base/markdown.tsx

+ 2
- 1
web/app/components/base/markdown.tsx 查看文件

@@ -44,7 +44,8 @@ const preprocessLaTeX = (content: string) => {
if (typeof content !== 'string')
return content
return content.replace(/\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`)
.replace(/\\\((.*?)\\\)/gs, (_, equation) => `$${equation}$`)
.replace(/\\\((.*?)\\\)/gs, (_, equation) => `$$${equation}$$`)
.replace(/(^|[^\\])\$(.+?)\$/gs, (_, prefix, equation) => `${prefix}$${equation}$`)
}

export function PreCode(props: { children: any }) {

Loading…
取消
儲存