feat: switch the mermaid renderer to AlexanderGrooff/mermaid-ascii - #26
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the mermaid renderer.
pgavlin/mermaid-asciiis 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-asciiis the maintained original (1.5k stars, monthly releases) and measures text by display width; flowcharts with wide characters draw correctly.cmdpackage next to cobra and the gin web server, which would have added ~10 MB. A fork moves the graph renderer topkg/graphandRenderDiagramtopkg/render, proposed upstream as Move graph rendering and RenderDiagram out of cmd into pkg/graph and pkg/render AlexanderGrooff/mermaid-ascii#94;go.modreplaces the module withhidekingerz/mermaid-ascii@fc194f1until that lands. The binary is 0.7 MB smaller than with the old library.internal/ui/mermaid.gocallsrender.RenderDiagram; the non-ASCII flowchart fallback from fix: show a flowchart with non-ASCII text as source instead of mojibake #25 is removed.B{…}is drawn as a plain box. README (both languages) updated.Test plan
gofmt -l .,go vet ./...,TMPDIR=/tmp go test -race ./...cleanmermaid = false, logrus silenced🤖 Generated with Claude Code
https://claude.ai/code/session_01KUYF9hXeZFML1s8r3i2RVX