Skip to content

🐛 fix: add mermaid to code block language list#139

Open
Innei wants to merge 1 commit into
masterfrom
fix/mermaid-codeblock
Open

🐛 fix: add mermaid to code block language list#139
Innei wants to merge 1 commit into
masterfrom
fix/mermaid-codeblock

Conversation

@Innei
Copy link
Copy Markdown
Member

@Innei Innei commented Apr 22, 2026

Summary

  • codemirror-block 插件的 MODES 数组缺少 mermaid 条目
  • 编辑含 mermaid 代码块的消息时,modeMatch('mermaid') 无匹配,返回 'plain'
  • 保存后代码块变为 plaintext,无法渲染 mermaid 图

Fix

MODES 数组中添加 mermaid 条目(.mmd 扩展名,simplemode syntax)

Test plan

  • 编辑含 mermaid 代码块的消息后,语言保持为 mermaid 而非 plain
  • 已排序插入(Mermaid 在 Markdown 与 MATLAB 之间)

Closes lobehub/lobehub#12307

The codemirror-block plugin's MODES array was missing "mermaid", causing
mermaid code blocks to be converted to "plain" when loading a message for
editing. After saving, the block renders as plaintext instead of a diagram.

Closes lobehub/lobehub#12307
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobe-editor Ready Ready Preview, Comment Apr 22, 2026 0:03am

Request Review

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@lobehubbot
Copy link
Copy Markdown
Member

👍 @Innei


Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 22, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@lobehub/editor@139

commit: a66648c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mermaid code blocks become plaintext after editing message, causing rendering failure

2 participants