You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lf-diagram: a quoted flowchart label containing ] is cut at the bracket and the rest of the line is dropped #311
A flowchart node whose quoted label contains ] renders cut at that bracket, with the opening quote shown literally, and the rest of the line is lost, including the node the edge points at.
Repro
A page with one lf-diagram:
<lf-diagramid="probe"><pre>
flowchart LR
A["names: list[str]"] --> B[plain]
</pre></lf-diagram>
version check passes. The rendered diagram has one box, labelled "names: list[str; there is no B box.
The vendored renderer does the same on its own, so it is the parser rather than the widget:
const{ renderMermaidSVG }=awaitimport("./skills/leaf/packages/diagram/vendor/beautiful-mermaid.esm.js");constsvg=renderMermaidSVG('flowchart LR\n A["names: list[str]"] --> B[plain]',{});// one <rect>, and one <text>: ""names: list[str"
A quoted label holding parentheses or commas renders whole (A["f()"], A["a, b"]), so it is the closing bracket inside the quotes specifically.
Expected
Mermaid's flowchart grammar allows ] inside a quoted label, so either the label renders whole, or version check refuses the source with a diagnostic naming the node. Today the check passes and the reader sees a partial diagram with a node silently missing.
Reproduced, and it is the tokenizer rather than anything about quoting in particular. beautiful-mermaid's NODE_PATTERNS read a label as (.+?) up to the first closing delimiter and never look at the quotes, so the match ends inside the label and the remainder of the line stops parsing as an edge; quotes are stripped later, at normalize time, which is why the opening one survives into the drawing. The same shape cuts A{"m{k}"} and A("f(x)"). It is open upstream as lukilabs/beautiful-mermaid#125 since June, and 1.1.3 is the latest release, so no pin bump carries a fix.
I took the second branch of your Expected. #312 makes lf-diagram refuse the source alongside the click/accTitle/accDescr directives it already refuses for the same reason, so the reader gets an error box naming the label and version check --render reports it instead of passing on a diagram missing a node.
The guard reads the delimiter run that actually follows each quoted span rather than banning ] outright, so the shapes that already render it stay working — A[["names: list[str]"]], A(["names: list[str]"]) and A -->|"list[str]"| B all draw whole, and those two doubled-closer shapes are the workaround references/authoring-evidence.md now points an author at. It can come out when an upstream release closes #125.
Activity
leaf-agent commentedon Sep 5, 2026
Reproduced, and it is the tokenizer rather than anything about quoting in particular.
beautiful-mermaid'sNODE_PATTERNSread a label as(.+?)up to the first closing delimiter and never look at the quotes, so the match ends inside the label and the remainder of the line stops parsing as an edge; quotes are stripped later, at normalize time, which is why the opening one survives into the drawing. The same shape cutsA{"m{k}"}andA("f(x)"). It is open upstream as lukilabs/beautiful-mermaid#125 since June, and 1.1.3 is the latest release, so no pin bump carries a fix.I took the second branch of your Expected. #312 makes
lf-diagramrefuse the source alongside theclick/accTitle/accDescrdirectives it already refuses for the same reason, so the reader gets an error box naming the label andversion check --renderreports it instead of passing on a diagram missing a node.The guard reads the delimiter run that actually follows each quoted span rather than banning
]outright, so the shapes that already render it stay working —A[["names: list[str]"]],A(["names: list[str]"])andA -->|"list[str]"| Ball draw whole, and those two doubled-closer shapes are the workaroundreferences/authoring-evidence.mdnow points an author at. It can come out when an upstream release closes #125.