Skip to content

[Bug]: Markdown view shows Mermaid fence source together with the rendered diagram #28574

Open

Description

@yoyofreeman

Operating system

Linux (Ubuntu, X11)

Orca version

1.4.224

Details

When a Markdown file that contains a ```mermaid fenced block is opened in Orca, the Mermaid source text is displayed together with the rendered diagram — the source appears above the rendered diagram in the same Markdown view.

Expected: only the rendered diagram should be shown (the fenced source hidden), as in a normal Markdown preview.

Actual: both the raw Mermaid source (e.g. lines like NORM --> LEAK, PUB -->|"..."| QAV) and the rendered flowchart are visible at the same time.

Steps to reproduce

  1. Open a .md file that contains exactly one Mermaid fence:

    ```mermaid
    flowchart TD
      A[Start] --> B[End]
    ```
    
  2. View it in Orca's Markdown view.

Notes

  • With a minimal single-fence file the view sometimes renders cleanly (diagram only), but with a larger real-world document the source and the rendered diagram are both shown (source above the diagram). This looks intermittent / dependent on the render path rather than a syntax problem.
  • The same document renders correctly (diagram only) in Chrome with mermaid 11.17.2, so the Markdown/Mermaid content itself is valid — this appears Orca-side.
  • Codebase context (from app.asar): the Markdown view's CommentMarkdown chunk renders a Mermaid fence through BOTH its <pre><code> fallback path and <MermaidBlock>; MermaidBlock additionally supports a pendingContent fallback and the keepMermaidSourceWhilePending context flag. The duplicate display looks related to these two render paths.

Related

Activity

  1. AmethystLiang commented on Oct 14, 2026

    @AmethystLiang
    Contributor

    Thanks for reporting. Looking into it

  2. megamorphg commented on Nov 3, 2026

    @megamorphg

    In mobile MD only shows the Mermaid fence, doesn't even show the diagram.

  3. ottopan commented on Nov 17, 2026

    @ottopan

    Additional report from Windows / Orca 1.4.261:

    In a normal task-board Markdown document, a ```mermaid fenced block is rendered with the raw Mermaid source expanded above the rendered diagram. The source can occupy most of the viewport, so scanning the document requires unnecessary vertical scrolling even when the diagram itself renders correctly.

    Requested behavior: show the rendered Mermaid diagram by default and keep the fenced source in a collapsed disclosure. Users who need to inspect or copy the source should be able to expand it on demand. If source-visible mode is retained, it should be opt-in rather than the default.

    The screenshot supplied with this report shows the issue with a task-board flowchart: the Mermaid source is expanded before the chart, which hurts browsing efficiency.

  4. EdgerHao commented on Nov 19, 2026

    @EdgerHao
    Contributor

    This is the single biggest reason I still open md files in VS Code instead of staying in Orca. For prior art: GitHub replaces the fence with the rendered diagram entirely, and Markdown Preview Enhanced keeps a collapsible copy of the source next to the diagram — either pattern (or a toggle) would solve it. Filed an umbrella request for the reading experience overall: #44539

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions