microsoft / microsoft/vscode

Rendered Markdown in Source Control injects diff markup into Mermaid code blocks, causing parse errors

Open
#332,107 0 comments 0 reactions 1 assignee Claimed by @lszomoru View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

* VS Code Version: 1.134.0 (Universal)
* OS Version: macOS Tahoe 26.5.2

Steps to Reproduce:

1. Create a Markdown file containing:

````markdown
# Mermaid diff test

```mermaid
erDiagram
USER ||--o{ TEAM: "have"
USER ||--o{ TEAM_MEMBER : "belongs to"
```
````

2. Commit the file to Git.
3. Delete `USER ||--o{ TEAM_MEMBER : "belongs to"`
4. Open the changed Markdown file from the Source Control view.
5. Switch the diff editor from **Text Diff Editor** to **Markdown Preview**.
6. Mermaid diagram fails to render with a parse error.

```text
Parse error on line 3:
...||--o{ TEAM: "have"

Rendered Markdown diff: Mermaid reports a parse error containing `` markup

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.