Skip to content

fix(merman): treat apostrophes in flowchart labels as text - #57060

Merged
vimtor merged 1 commit into
devfrom
merman-apostrophe
Oct 19, 2026
Merged

vimtor merged 1 commit into
devfrom
merman-apostrophe

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

A flowchart label with an apostrophe, like CS[Console's own schema copy] -. validates .-> CFG, made the whole diagram fail with "Unsupported syntax".

The flowchart statement scanners counted ' as a string delimiter. An apostrophe inside an unquoted label opened a string that never closed, so the edge operator after it was masked and never found. Mermaid flowchart strings use double quotes only, so the scanners (splitNodeGroup, maskNodeLabelOperators, hasInternalStatementSeparator) now track only ".

Bracketed labels still mask operators, ; and & as before. Single-quoted labels are still unwrapped by stripMermaidQuotes.

Tests: bun test in packages/merman (506 pass, layout audit 0 violations) and bun run typecheck. The new test fails on dev without the parser change.

Requested by: @vimtor (victor via Slack)

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. On the base branch, flowchart statements with an apostrophe in an unquoted node label or edge label (e.g. CS[Console's own schema copy] -. validates .-> CFG, A -- it's ok --> B) fail with "Unsupported syntax". With this change they parse correctly. Apostrophes in double-quoted labels and |...| edge labels behave the same as before, and single-quoted labels are still unwrapped. bun test (506 pass) and bun run typecheck pass in packages/merman.

Public API: unchanged (internal parser only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant