Skip to content

feat: switch the mermaid renderer to AlexanderGrooff/mermaid-ascii - #26

Merged
hidekingerz merged 1 commit into
mainfrom
claude/mermaid-lib-swap
Sep 5, 2026
Merged

feat: switch the mermaid renderer to AlexanderGrooff/mermaid-ascii#26
hidekingerz merged 1 commit into
mainfrom
claude/mermaid-lib-swap

Conversation

@hidekingerz

Copy link
Copy Markdown
Owner

Summary

Replaces the mermaid renderer. pgavlin/mermaid-ascii is an unmaintained fork (issues disabled, last push March) whose flowchart renderer places text byte by byte, so a Japanese node or edge label came out as mojibake and #25 had to fall back to source. AlexanderGrooff/mermaid-ascii is the maintained original (1.5k stars, monthly releases) and measures text by display width; flowcharts with wide characters draw correctly.

Test plan

  • gofmt -l ., go vet ./..., TMPDIR=/tmp go test -race ./... clean
  • New test: a flowchart with Japanese node and edge labels draws, the labels are intact, and every row of the drawing has the same width (wide characters counted as two columns)
  • Existing mermaid tests unchanged and passing: fence replacement, fallback for undrawable and too-wide blocks, exact-width fit through glamour, mermaid = false, logrus silenced
  • tmux: Japanese flowchart with branches and labels, and a subgraph flowchart, drawn correctly in reader mode

🤖 Generated with Claude Code

https://claude.ai/code/session_01KUYF9hXeZFML1s8r3i2RVX

pgavlin/mermaid-ascii is an unmaintained fork whose flowchart renderer
places text byte by byte, so Japanese labels came out as mojibake and
had to fall back to source. AlexanderGrooff/mermaid-ascii is the
maintained original and measures text by display width, so flowcharts
with wide characters draw correctly. Its rendering entry point lived
in the cobra/gin command package; a fork moves it to pkg/render and
pkg/graph (proposed upstream), and go.mod replaces the module with
that fork until the change lands. The binary is 0.7 MB smaller than
before. Class and state diagrams, which the old library drew badly,
now fall back to source; README says so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KUYF9hXeZFML1s8r3i2RVX
@hidekingerz
hidekingerz merged commit c25b7e1 into main Sep 5, 2026
3 checks passed
@hidekingerz
hidekingerz deleted the claude/mermaid-lib-swap branch September 5, 2026 06:27
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.

1 participant