-
Notifications
You must be signed in to change notification settings - Fork 83
Mermaid diagram fails to render with node labels starting with / #304
Copy link
Copy link
Open
Description
🐛 Bug: Mermaid diagram fails to render with node labels starting with /
Description
When generating Mermaid diagrams, labels starting with / cause a rendering failure.
Example error:
Lexical error on line 2. Unrecognized text.
... A[/archie command] --> B[Fetch issue
-----------------------^
Reproduction
graph LR
A[/archie command] --> B[Fetch issue or PR details]
B --> C[Extract relationships and concepts]
C --> D[Select diagram types]
D --> E[Generate 1-3 Mermaid diagrams]
E --> F[Validate syntax]
F --> G[Post comment with diagrams]
Expected behavior
Diagram should render correctly.
Actual behavior
Mermaid fails to parse the diagram due to invalid syntax.
Root cause
Mermaid does not support unescaped special characters (e.g. /) at the beginning of node labels.
Suggested fix
Wrap labels in quotes to ensure proper parsing:
graph LR
A["/archie command"] --> B["Fetch issue or PR details"]
B --> C["Extract relationships and concepts"]
C --> D["Select diagram types"]
D --> E["Generate 1-3 Mermaid diagrams"]
E --> F["Validate syntax"]
F --> G["Post comment with diagrams"]
Additional context
This issue affects auto-generated diagrams (e.g. via Archie command), where labels may include special characters.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels