mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 02:58:59 +08:00
bugfix:cant correct display latex (#14910)
This commit is contained in:
parent
53eb56bb1e
commit
ff10a4603f
@ -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…
x
Reference in New Issue
Block a user