Skip to content

Rendering seems to break down for more complex Mermaid diagrams #51480

Description

@drefrajo

Reproduction steps

  1. create a somewhat larger mermaid diagram
  2. embed it in a markdown file
  3. preview that markdown file

Current vs. Expected behavior

Current behavior: lines seemingly randomly start and end without correctly displaying connections.

Image

Expected behavior: the rendered preview should correctly reflect the described diagram. (rendering created using https://mermaid.live/edit)

Image

The mermaid diagram in question:

flowchart TD
    A[Stage 1: MVP]
    A1[Async order lifecycle]
    A2[Single collateral]
    A3[Isolated margin]
    A4[Market orders only]
    A5[One team-run executor bot]
    A6[Permissionless executeOrder interface]
    A7[Low leverage + strict OI caps]

    B[Stage 2: Production]
    B1[Multiple independent keepers]
    B2[Broader market set]
    B3[Optional more order types]
    B4[Stronger liquidation ops]
    B5[Formalized governance for listings/rebalances]
    B6[Potential leverage expansion on proven markets]

    A --> B
    A --> A1
    A --> A2
    A --> A3
    A --> A4
    A --> A5
    A --> A6
    A --> A7

    B --> B1
    B --> B2
    B --> B3
    B --> B4
    B --> B5
    B --> B6

    C[What stays unchanged]
    C1[Index computed on-chain from constituent feeds]
    C2[Async request -> execute flow]
    C3[Permissionless executor contract entrypoint]
    C4[Versioned market definitions]

    A --> C
    B --> C
    C --> C1
    C --> C2
    C --> C3
    C --> C4

Note: I've just started experimenting with Mermaid now, so I am by no means an expert. I just thought it might be useful to document this somewhere.

Zed version and system specs

Zed: 0.227.1+stable.199.9f9b707d39d62468d4cdaed2d8eb95a847da4cf9
OS: macOS 26.3
Memory: 16 GiB
Architecture: aarch64

Attach Zed log file

No response

Relevant Zed settings

No response

Relevant Keymap

No response

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

Labels

.contrib/zed team onlyIssue not suitable for contributions/work by the communityarea:preview/mermaidFeedback for Zed's Mermaid diagram supportnever staleto keep the stalebot awayreach:some usersBugs that happen for less than one-third of users, special configurations, rare circumstances, etcseverity:S2Average run-of-the-mill bugs; a feature is broken but only partiallystate:reproducibleVerified steps to reproduce included or someone on the team managed to reproduce

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions