Repository navigation
Description
Follow-up batch from the four-slice mermaid project (PRs #4, #17, #26, #31) — the whole-branch reviews' deferred items plus a doc-parity gap analysis against https://mermaid.ai/open-source/syntax/flowchart.html, confirmed by executing every doc example through our renderer (crates/mermaid/examples/doc_gallery.rs, committed on main).
Fix first — silent divergences ✅ DONE in #44
Circle/cross edge-ends parse as phantom nodes— terminators now bind to the edge (A--oB= circle-ended edge toB, matching mermaid's documented rule).Edges to subgraph ids create phantom nodes— now a loud error naming the subgraph. Actual cluster-boundary edge routing remains deferred (below).
Cheap doc-parity adds ✅ DONE in #44
Subroutine [[…]]; multi-length arrows; invisible ~~~; bidirectional <--> / o--o / x--x; no-space label spellings; YAML front-matter skip (error lines preserved); classDef default auto-apply. Also fixed en route: quote-aware ; statement splitting (the docs' A["This is a #35; test"] example errored mid-quote) and -.-/=== no longer render a phantom arrowhead.
Deferred items (the remaining work; per-slice details in the worktree ledgers)
Flowchart / structural
- Actual edge-to-subgraph routing (edge attaches to the cluster box; today it errors loudly).
- Flowchart-onto-
boxgraphunification — also the natural moment for the two state items below marked (†).
State: (†) ;-in-transition-label truncation; (†) header can't chain same-line statements; notes can target synthetic __start_N ids; composite/node collision guards untested.
Class: same-line class A { } errors; multiplicity labels sit on opposite sides of an edge; 14px multiplicity offset overshoots short segments; classDef default merge semantics — we apply default wholesale to unclassed nodes only, mermaid merges default's properties per-property under explicit classes (cosmetic; flowchart side, filed from the #44 review).
ER: blank-line-in-block permissiveness (confirm intent); doubled validate_id; ragged per-row key column.
Sequence (slice-3 backlog): Note over A,B,C drops the third participant; <br/> in participant displays/edge labels measured multi-line but rendered literal; self-message text reservation 4px tight; props soup lacks actor/cross/async lines.
Lib: DiagramKind::label() has zero callers (public-API removal decision).
Deliberate non-goals (do not "fix")
HTML in labels stays escaped (mermaid renders it; we never will for untrusted docs); markdown strings, FontAwesome, entity-code decoding, @{ shape: … } expanded shapes, icon/image nodes, edge ids/animations, click/linkStyle/style remain out of scope with loud errors.
Parity matrix
Post-#44 (executed 2026-07-11): 54 of 62 doc examples render, 8 error loudly, 0 silent divergences. Full per-example table in crates/mermaid/examples/doc_gallery.rs (cargo run -p ogrenotes-mermaid --example doc_gallery). Every remaining error case is in the non-goals list or the deferred list above.
Activity
jjbaumert commentedon Jul 11, 2026
Polish branch note for the deferred list (from the whole-branch review): our
classDef defaultauto-apply gives explicitly-classed nodes none of default's properties (first-matching-class-wins-wholesale), while real mermaid merges default's properties per-property under the explicit class. Spec-literal and cosmetic-only; defer with the other styling nuances.Also fixed en route (beyond the filed highlights): quote-unaware
;statement splitting truncated quoted labels containing semicolons — the docs' own entity-code exampleA["This is a #35; test"]errored. Found by the committed doc gallery, fixed on the polish branch.jjbaumert commentedon Jul 11, 2026
Reopened: PR #44's title contained "closes #32" which GitHub treated as a closing keyword on merge. #44 completed the fix-first + cheap-adds sections; this issue stays open as the deferred list (see updated body).
Mermaid sequence polish: semicolon silent-misparse fix + doc-parity (…
jjbaumert commentedon Jul 12, 2026
State-polish branch note: the deferred item "state
;-in-transition-label truncation" is FIXED (superseded) — the state parser's;splitting is now label-aware (once a:label starts,;stays in the label to end of line, matching mermaid). Remaining on this item: nothing for state; the boxgraph-unification pairing now only concerns the header same-line-chaining asymmetry.fix(mermaid): one-line class member blocks; multiplicities on one side (
jjbaumert commentedon Sep 30, 2026
A review of the Mermaid support (2026-09-29) found these items from this issue's deferred list are now fixed on main:
Note over A,B,Cnow spans all three participants, with a test.class A { }on one line now parses.__start_Nids.<br/>in sequence participant names is split into lines. Multi-line message labels still sit wrongly; that is tracked in Mermaid sequence: notes, self-messages and frames drawn outside the canvas; multi-line labels cross their arrow #277.Still open from this list:
classDef defaultbeing merged wholesale.New findings from the review are filed separately as #274–#289, which don't duplicate anything here.
Generated by Claude Code
Generated by Claude Code