From 3c9f12bb949ba26069d14749d3406cddfc361797 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Sun, 11 Jun 2023 18:01:13 +0800 Subject: [PATCH] fix: render --- client/public/docs/versionIntro.md | 12 +++--------- client/src/components/Markdown/MermaidCodeBlock.tsx | 4 +++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/client/public/docs/versionIntro.md b/client/public/docs/versionIntro.md index 65cda0902..b56da18f1 100644 --- a/client/public/docs/versionIntro.md +++ b/client/public/docs/versionIntro.md @@ -1,10 +1,4 @@ -### Fast GPT V3.8.1 +### Fast GPT V3.8.3 -1. 新增 - 自定义历史记录标题。 -2. 新增 - 置顶历史记录。 -3. 新增 - 自动置顶最近聊天的模型。 -4. 优化 - 索引和 QA 队列,支持多节点和并发(目前线上大概 2500 条/分钟) -5. 优化 - 随机任务,不再按线性等待。 -6. 优化 - 内容分段导入和进度查看,不再担心大文件无法导入 -7. 优化 - 导出的 csv 大小。最大支持 100M 导出。 -8. 知识库数量说明,由于线上数据太多,没法创建索引,所以目前如果超过 5w 组数据,大概率会失败。 +1. 新增 - mermaid 导图兼容,可以在应用市场 'mermaid 导图' 进行体验。 +2. 优化 - 部分 UI 和账号页。 diff --git a/client/src/components/Markdown/MermaidCodeBlock.tsx b/client/src/components/Markdown/MermaidCodeBlock.tsx index 3a71b4281..a8917e3eb 100644 --- a/client/src/components/Markdown/MermaidCodeBlock.tsx +++ b/client/src/components/Markdown/MermaidCodeBlock.tsx @@ -27,7 +27,9 @@ const MermaidBlock = ({ code }: { code: string }) => { useEffect(() => { try { - mermaidAPI.render('mermaid-svg', code, (svgCode: string) => { + const formatCode = code.replace(/:/g, ':'); + + mermaidAPI.render(`mermaid-${Date.now()}`, formatCode, (svgCode: string) => { setSvg(svgCode); }); } catch (error) {