mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 03:55:52 +08:00
fix: view workflow log detail page crash (#5474)
This commit is contained in:
parent
5d4d65a85b
commit
e88f5607ac
@ -40,9 +40,12 @@ const getCorrectCapitalizationLanguageName = (language: string) => {
|
||||
return language.charAt(0).toUpperCase() + language.substring(1)
|
||||
}
|
||||
|
||||
const preprocessLaTeX = (content: string) =>
|
||||
content.replace(/\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`)
|
||||
const preprocessLaTeX = (content: string) => {
|
||||
if (typeof content !== 'string')
|
||||
return content
|
||||
return content.replace(/\\\[(.*?)\\\]/gs, (_, equation) => `$$${equation}$$`)
|
||||
.replace(/\\\((.*?)\\\)/gs, (_, equation) => `$${equation}$`)
|
||||
}
|
||||
|
||||
export function PreCode(props: { children: any }) {
|
||||
const ref = useRef<HTMLPreElement>(null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user