Registry Mirror
Skip to content

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Mermaid 12 wraps node labels at 120 px (Mermaid 11 used 200). At Plannotator's 16 px labels, a label of about eight CJK characters broke before its last character, and short Latin labels wrapped early.

This sets flowchart.wrappingWidth and state.wrappingWidth to 140 in MERMAID_CONFIG. Mermaid 11 drew state labels with the flowchart width; Mermaid 12 gives state its own 120, so it gets the same value. The themed config spreads MERMAID_CONFIG, so the themed path and the host fallback both carry it. A test pins 140 in both.

Checked in headless Chromium with the issue's repro: 8 放进文档给你审 is one line at 140 (two lines at 120). Labels of nine or more CJK characters, or about 24 Latin characters, still wrap, as intended.

Fixes #2064.

Mermaid 12 lowered flowchart.wrappingWidth from 200 to 120 and gave state
diagrams their own 120, so labels of about eight CJK characters broke before
their last character. Pin 140 (owner-approved) in MERMAID_CONFIG, which the
themed config spreads, so both initialize paths carry it.
@backnotprop
backnotprop merged commit 59833d6 into main Oct 22, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mermaid flowchart: last CJK character of a longer node label wraps onto a second line

1 participant