bug: Syntax error / parser crash when a node label contains brackets inside double quotes (e.g., "xx[]yy")
Describe the bug
When rendering a Flowchart using beautiful-mermaid, the parser crashes with a syntax/render error if a node text contains brackets [] even when the entire string is properly wrapped in standard double quotes "".
It seems the lexer/parser inappropriately triggers a node closure rule when encountering the ] character inside the string literal, rather than treating the quoted text as a pure string.
To Reproduce
Try to render the following valid Mermaid syntax in the editor:
graph LR
A["test [] brackets"]
B["xx[]yy"]
A --> BExpected behavior
The diagram should render successfully, displaying two rectangular nodes with the literal texts test [] brackets and xx[]yy.
Actual behavior
The rendering pipeline fails completely / throws a syntax error.
Context
- Library:
beautiful-mermaid(via Agents Craft Editor) - Output type: SVG / Canvas Live View
Additional note
Since htmlLabels is disabled by default in this project (htmlLabels: false), using HTML entities like [ and ] also crashes the parser. This leaves users with absolutely no workaround to display the [] characters inside flowcharts.
Source: lukilabs/beautiful-mermaid