Skip to content

feat(renderer): render mermaid diagrams and box callouts/code blocks#49

Merged
harehare merged 3 commits into
mainfrom
feat/rich-markdown-rendering
Jun 20, 2026
Merged

feat(renderer): render mermaid diagrams and box callouts/code blocks#49
harehare merged 3 commits into
mainfrom
feat/rich-markdown-rendering

Conversation

@harehare

Copy link
Copy Markdown
Owner

No description provided.

harehare added 3 commits June 20, 2026 20:50
Fix unwired lang-clojure/lang-toml feature flags and add YAML, Ruby,
PHP, Lua, Kotlin, Scala, Make, SQL, and Dockerfile support. Several
tree-sitter grammar crates were swapped for actively-maintained forks
(tree-sitter-toml-ng, tree-sitter-sequel, tree-sitter-containerfile,
tree-sitter-kotlin-ng) since the originals pin an incompatible
tree-sitter version. Kotlin's highlight query is vendored locally
since tree-sitter-kotlin-ng doesn't publish one.
- Add a best-effort ASCII-art renderer for simple mermaid graph/flowchart
  blocks (nodes, shapes, labeled edges), with a safe layered layout that
  never stalls on cycles and falls back to a plain code block for
  unsupported diagram types.
- Render GitHub-style callouts and fenced code blocks as closed,
  word-wrapped boxes instead of open dashes/backticks.
- Replace the circled-digit heading markers (①②③) with a repeated
  ▶ marker, since circled digits render illegibly small in many
  monospace fonts.
- Fix width/alignment bugs across headings, tables, and callouts: box
  and padding math used raw char counts, which undercounts emoji
  (💡❗🔥) and CJK text and gets thrown off by embedded OSC 8 hyperlink
  escapes. Introduce a visible_width() helper (backed by unicode-width)
  used everywhere boxes are drawn.
- Fix the CLI's -H/--header-highlight flag, which had inverted
  semantics versus its own help text and the library default, so
  full-width header highlighting was silently off unless passed.
Document the expanded language list and mermaid rendering, and
refresh the demo content/gif to showcase boxed callouts, a
syntax-highlighted code block, and a mermaid flowchart.
@harehare harehare merged commit 3adaf11 into main Jun 20, 2026
1 check 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.

1 participant