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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: replace old-style <br> tags to fix Mermaid rendering issues (#13792)
Hao Cheng49d0acd18846
diff --git a/web/app/components/base/mermaid/index.tsx b/web/app/components/base/mermaid/index.tsxindex af5c010ac21..8e8296697e5 100644--- a/web/app/components/base/mermaid/index.tsx+++ b/web/app/components/base/mermaid/index.tsx@@ -3,6 +3,7 @@ import mermaid from 'mermaid'import { usePrevious } from 'ahooks'import { useTranslation } from 'react-i18next'import { ExclamationTriangleIcon } from '@heroicons/react/24/outline'+import { cleanUpSvgCode } from './utils'import LoadingAnim from '@/app/components/base/chat/chat/loading-anim'import cn from '@/utils/classnames'import ImagePreview from '@/app/components/base/image-uploader/image-preview'@@ -44,7 +45,7 @@ const Flowchart = React.forwardRef((props: {try {if (typeof window !== 'undefined' && mermaidAPI) {const svgGraph = await mermaidAPI.render('flowchart', PrimitiveCode)- const base64Svg: any = await svgToBase64(svgGraph.svg)+ const base64Svg: any = await svgToBase64(cleanUpSvgCode(svgGraph.svg))setSvgCode(base64Svg)setIsLoading(false)}diff --git a/web/app/components/base/mermaid/utils.spec.ts b/web/app/components/base/mermaid/utils.spec.tsnew file mode 100644index 00000000000..6ea7f17bfa5--- /dev/null+++ b/web/app/components/base/mermaid/utils.spec.ts@@ -0,0 +1,8 @@+import { cleanUpSvgCode } from './utils'++describe('cleanUpSvgCode', () => {+ it('replaces old-style <br> tags with the new style', () => {+ const result = cleanUpSvgCode('<br>test<br>')+ expect(result).toEqual('<br/>test<br/>')+ })+})diff --git a/web/app/components/base/mermaid/utils.ts b/web/app/components/base/mermaid/utils.tsnew file mode 100644index 00000000000..1f07690cea4--- /dev/null+++ b/web/app/components/base/mermaid/utils.ts@@ -0,0 +1,3 @@+export function cleanUpSvgCode(svgCode: string): string {+ return svgCode.replaceAll('<br>', '<br/>')+}