Supported syntax & limits
A custom parser, supporting a subset of Mermaid flowchart and state diagram syntax. No Mermaid library is used.
flowchart LR or graph TB; directions LR, RL, TB, TD, BT. Nodes:
a[Label], a("Label"), a(("Circle")), a[("Database")], a{Decision}, or bare IDs. Edges:
a --> b, a <--> b, a -->|label| b, a -- "label" --> b, a --- b,
a -. select .-> b, a -.->|label| b, a -.- b; chains are accepted.
Separate
statements with newlines or semicolons. IDs use letters, numbers, underscores or hyphens.
%% comments and a leading YAML header with maxEdges / maxTextSize are
accepted. Other header entries are ignored. Labels are plain text; quoted labels can contain punctuation. Node
and edge labels support <br/>, </br> and \n line breaks, and
entities such as < or #lt;.
Quoted edge labels are supported. Group nodes with subgraph ID["Label"] and
end; nested groups are accepted. Subgraph direction statements are accepted;
the current layout uses the root flowchart direction for all groups.
Groups use consecutive rows or columns with up to four nodes per band.
Define colors with classDef name fill:#fff3cd,stroke:#ad7b00,color:#302400;
and apply them with class a,b name;. These three properties accept hex or named colors.
Other styling directives are unsupported and report errors.
Basic stateDiagram-v2 diagrams support state "Label" as ID,
ID: Label, a --> b: Transition label, and [*] start/end markers.
Use one state statement per line. Transition labels may contain semicolons and numeric Mermaid entities such as
#58; for a colon. The default direction is TB; direction LR (or RL, TB, TD, BT) is accepted.
Composite states, notes, state styling, and other diagram types are unsupported and report errors.
Defaults: 20,000 edges, 1,000,000 source characters. Layout uses layers, including cycle grouping. Connections use right-angle turns and route around blocks. Inputs merge on the leading side of each block; outputs share a separate line on the trailing side, including feedback connections. Dense graphs may have overlapping edges; rendering time depends on graph size and your device. Text stays in your browser. Nothing is sent or stored automatically.