mirror of
https://github.com/langgenius/dify.git
synced 2026-05-01 16:08:04 +08:00
bugfix:cant correct display latex (#14910)
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user