Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: view workflow log detail page crash (#5474)

Joele88f5607ac18
diff --git a/web/app/components/base/markdown.tsx b/web/app/components/base/markdown.tsx
index 3548232ad3f..fe55f6c8f1f 100644
--- a/web/app/components/base/markdown.tsx
+++ b/web/app/components/base/markdown.tsx
@@ -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)