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
A source whose first line names no diagram termaid draws is no longer drawn as a flowchart. A Mermaid type with no renderer here (sankey-beta, C4Context, radar-beta, zenuml, requirementDiagram) and a mistyped keyword (grpah LR) used to come out as boxes of raw syntax, or as a top-down flowchart; render() now returns an empty string for them, the command line exits 1 and says why (termaid does not draw sankey diagrams., Unknown diagram type 'grpah'. Start the diagram with its type, such as flowchart TD, sequenceDiagram or classDiagram.), and the Claude Code hook shows the Mermaid source. termaid.type_problem(source) returns that message, or None
A flowchart with no graph or flowchart line, whose first line is already an edge (A --> B), keeps that line. It was read as the header and dropped
Changes
Claude Code plugin: the skill's description now tells Claude to write a diagram in a reply as a mermaid block, which the hook draws, instead of drawing boxes by hand
Flowchart and state diagrams: fitting to a width is much faster, and so is routing in general. A 16-node flowchart with five loop-back edges fits to 100 columns in about 0.2 seconds instead of 4, and draws unfitted in 50 ms instead of 315. A spacing or label width whose layout is already too wide is skipped without drawing it, and a path search whose target is walled in stops at once instead of walking the whole grid. The drawings are unchanged. In Claude Code such a diagram was shown as its Mermaid source once the hook's 3 second limit applied
fit_to_width() takes an optional measure= callable that returns a lower bound on a candidate's width without drawing it
Fixes
Flowchart: a dense diagram no longer hangs. When no route was found for an edge, the fallback was a diagonal line that the router never finished walking; six nodes linked to six others (A0 & ... & A5 --> B0 & ... & B5) was enough (#53, thanks @developingchet)
Flowchart: an unmatched * in a Markdown label, as in A["`2*3`"], no longer hangs the parser. The * is kept as text (#53, thanks @developingchet)
Flowchart: a very long link (thousands of - or =) parses in milliseconds instead of taking cubic time (#53, thanks @developingchet)
Packet: a field far from bit 0, such as 3200000: "x", no longer draws hundreds of thousands of empty rows. A field that does not start where the last one ended is dropped with a warning, as Mermaid rejects it (#53, thanks @developingchet)
Flowchart and state diagrams: an edge label is no longer written inside a node's box, over a subgraph's title or through a subgraph's border. A -->|yes| B with A -->|no| B drew yes inside B, and a label next to a subgraph title gave Servicesk. A label with no clean spot now looks a few rows up and down before it crosses an edge line
Flowchart and state diagrams: two edges that come back into the same side of a node no longer cross each other, and the outer one no longer turns with a stray ┤. The edge that comes from farther away takes the outer row
Flowchart and state diagrams: an edge line no longer runs along a subgraph's title row, where it showed through the title's spaces (│ Long─subgraph─title │), or along its bottom border. The line takes the next free row of the same gap
Flowchart and state diagrams: the layout leaves room for three kinds of edge label that had none, so they no longer cut a line or touch a border: a label on an edge that loops back beside another one, a label inside a subgraph only as wide as its nodes, and a label between nodes laid out left to right inside a top-down diagram (a composite state, or a subgraph with direction LR). Such a diagram can come out a few columns wider
Flowchart and state diagrams: a label on a looping-back edge that has no room beside its line is drawn above or below the edge's last run, on blank cells, before it is allowed to cross another line
Claude Code hook: a Mermaid block quoted inside another code block, such as an example in a markdown ```` block, is left as written. A batch with no message id shows its lines instead of dropping them, a malformed event or saved state no longer breaks the following batches, and state files left by interrupted messages are removed after a day (#56, thanks @developingchet)
Sequence: an activation bar starts and ends with its own messages instead of one message late. A long self-message label no longer covers the next lifeline. destroy X ends the lifeline after the message that destroys X, and autonumber 10 5 numbers from 10 in steps of 5 (#57, thanks @developingchet)
State: state "Name" as id { opens a composite state with that title; its states were drawn outside any frame. A :::class suffix on a transition is no longer drawn as part of the label or the state name (#58, thanks @developingchet)
Class and ER: a %% comment line inside a class or entity body is skipped instead of drawn as a member or attribute (#59, thanks @developingchet)
Flowchart and state diagrams: an edge that loops back into a node no longer lands on the row where another edge leaves that node (├◄───┤), which made two edges read as one line. The arriving edge takes the row beside it
Flowchart and state diagrams: right-to-left and bottom-to-top diagrams (graph RL, graph BT, direction RL) no longer mirror their text. Labels came out reversed (dlroW olleH), multi-line labels bottom-up with letters swapped (Vi^id), subgraph titles on the bottom row, slanted shapes leaning the wrong way and four blank rows or columns in front. The layout is mirrored before drawing instead of flipping the finished drawing
Claude Code hook: a diagram that takes more than 3 seconds to draw is shown as its Mermaid source. Before, Claude Code stopped the hook at 10 seconds and the rest of the reply was shown inside an unclosed code block (#54, thanks @developingchet)