Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug] Mermaid提示Syntax error in text #1294

Closed
Kosette opened this issue May 6, 2023 · 5 comments
Closed

[Bug] Mermaid提示Syntax error in text #1294

Kosette opened this issue May 6, 2023 · 5 comments

Comments

@Kosette
Copy link
Contributor

Kosette commented May 6, 2023

Describe the bug
无法正常渲染mermaid。经过确认应该是mermaid本身的一个兼容问题,流程图中不能出现中文标点,会被识别为unrecognized text,无法正常渲染。因而可能需要向上游提交请求。

To Reproduce

graph TD;
  A[开始]-->B(if 吃饭了吗?)
  B-- 是 -->C(好的,继续工作)
  B-- 否 -->D{饿了吗?}
  D-- 是 -->E(那去吃吧)
  D-- 否 -->C(好的,继续工作)
  C-->F[结束]
  E-->F

上述的中文逗号换成英文逗号可以正常渲染,否则会出现错误。

Screenshots
image

@Kosette
Copy link
Contributor Author

Kosette commented May 6, 2023

找到一个相关的 issue:mermaid-js/mermaid#687 ,这么久了估计也没打算修了。chatgpt没办法保证将包含中文标点的语句都用引号包裹起来,因此这个问题估计暂时无法解决。

@Yidadaa
Copy link
Collaborator

Yidadaa commented May 6, 2023

凑合用吧,估计是没处理特殊的 unicode 字符

@Yidadaa Yidadaa closed this as completed May 6, 2023
@Kosette
Copy link
Contributor Author

Kosette commented May 6, 2023

凑合用吧,估计是没处理特殊的 unicode 字符

鉴于这个问题,希望能够在设置中加一个启用 mermaid 的开关。

在渲染失败的情况下除非把源码复制到其它地方,否则无法查看,且影响版面。此外存在问题的会话会有对话历史显示为空白的问题,应该也是该问题引起的 bug。

@Yidadaa
Copy link
Collaborator

Yidadaa commented May 6, 2023

会话空白与这个无关

Yidadaa added a commit that referenced this issue May 8, 2023
feat: #1303 and fix #1294 1307, new modal style
@Yidadaa
Copy link
Collaborator

Yidadaa commented May 8, 2023

v2.3 已经增加 fallback 逻辑,包含不合法字符时自动 fallback 回代码模式。

Endlessworld pushed a commit to Endlessworld/ChatGPT-Next-Web that referenced this issue May 17, 2023
Endlessworld pushed a commit to Endlessworld/ChatGPT-Next-Web that referenced this issue May 17, 2023
jinker pushed a commit to jinker/ChatGPT-Next-Web that referenced this issue Jun 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants