github / github/app

Mermaid in markdown breaks editor

Open
#1,260 0 comments 0 reactions 0 assignees View on GitHub
Bugs
Dominant language
No language data
Stars
2.1k
Forks
153
PR merge metrics
No merged PRs in 30d

Description

### Short summary

When there is a longer mermaid entry in a markdown document, the markdown preview does no longer allow editing.

### Affected version or release

_No response_

### Installation context

_No response_

### What happened?

When working with Markdown files that include Mermaid diagrams, the editor switches to the canvas/preview experience. At that point, the file becomes effectively uneditable — the editor blocks and I can no longer make changes.
The preview/canvas view renders, but the editing experience breaks. I have to switch to code mode (or “agent/go-to-code mode”) to regain the ability to edit the file.

### Steps to reproduce

Open a Markdown file
Add or include Mermaid code block (e.g. ```mermaid)
Let the editor render/open the canvas/preview experience
Try to edit the file in the editor

### Expected behavior

I can continue editing the Markdown file normally
Preview/canvas view does not block editing
Switching between edit and preview works seamlessly

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by opening a Markdown file with a longer Mermaid code block, then letting the canvas or preview experience open and attempting to edit. Trace the transition between edit, preview, and code mode; done means Markdown remains editable and switching between views no longer blocks changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.