From ff10a4603f4464746395d8b610550a21fec85b4f Mon Sep 17 00:00:00 2001 From: Likename Haojie Date: Fri, 7 Mar 2025 14:06:14 +0800 Subject: [PATCH] bugfix:cant correct display latex (#14910) --- web/app/components/base/markdown.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/app/components/base/markdown.tsx b/web/app/components/base/markdown.tsx index f324b67f1f..90d6225484 100644 --- a/web/app/components/base/markdown.tsx +++ b/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)