Repository navigation
feat(tui): render full CommonMark in assistant answers - #259
Merged
Merged
Conversation
The hand-rolled renderer only handled fenced code, headings, list bullets, inline bold, and backticks — everything else (tables, links, nested lists, quotes, italics, strikethrough) fell through as literal markup. Replace it with a pulldown-cmark event-stream renderer that maps parsed CommonMark onto ratatui Lines: headings, emphasis, strikethrough, nested ordered/unordered/task lists, block quotes, syntax-highlighted fenced code, wrapped tables, links, images (alt text), footnotes, rules, and raw HTML passthrough. Parsing stays fully in pulldown-cmark; the TUI only reacts to parsed events for styling, so no syntax is hand-sniffed. Unterminated fence behavior is preserved for streaming answers.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
The hand-rolled renderer only handled fenced code, headings, list bullets, inline bold, and backticks — everything else (tables, links, nested lists, quotes, italics, strikethrough) fell through as literal markup. Replace it with a pulldown-cmark event-stream renderer that maps parsed CommonMark onto ratatui Lines: headings, emphasis, strikethrough, nested ordered/unordered/task lists, block quotes, syntax-highlighted fenced code, wrapped tables, links, images (alt text), footnotes, rules, and raw HTML passthrough. Parsing stays fully in pulldown-cmark; the TUI only reacts to parsed events for styling, so no syntax is hand-sniffed. Unterminated fence behavior is preserved for streaming answers.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
The hand-rolled renderer only handled fenced code, headings, list bullets, inline bold, and backticks — everything else (tables, links, nested lists, quotes, italics, strikethrough) fell through as literal markup. Replace it with a pulldown-cmark event-stream renderer that maps parsed CommonMark onto ratatui Lines: headings, emphasis, strikethrough, nested ordered/unordered/task lists, block quotes, syntax-highlighted fenced code, wrapped tables, links, images (alt text), footnotes, rules, and raw HTML passthrough. Parsing stays fully in pulldown-cmark; the TUI only reacts to parsed events for styling, so no syntax is hand-sniffed. Unterminated fence behavior is preserved for streaming answers.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
The hand-rolled renderer only handled fenced code, headings, list bullets, inline bold, and backticks — everything else (tables, links, nested lists, quotes, italics, strikethrough) fell through as literal markup. Replace it with a pulldown-cmark event-stream renderer that maps parsed CommonMark onto ratatui Lines: headings, emphasis, strikethrough, nested ordered/unordered/task lists, block quotes, syntax-highlighted fenced code, wrapped tables, links, images (alt text), footnotes, rules, and raw HTML passthrough. Parsing stays fully in pulldown-cmark; the TUI only reacts to parsed events for styling, so no syntax is hand-sniffed. Unterminated fence behavior is preserved for streaming answers.
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.
What
The old hand-rolled renderer handled only fenced code, headings, list bullets, inline
**bold**, and backticks. Everything else — tables, links, nested lists, block quotes, italics, strikethrough, task lists, rules — fell through as literal markup in the conversation panel.Fix
Replace it with a
pulldown-cmarkevent-stream renderer incrates/forge-tui/src/markdown.rsthat maps parsed CommonMark onto ratatuiLines:┼separators)Parsing is 100% pulldown-cmark; the TUI only reacts to parsed events for styling — no manual tag/string sniffing (the old
strip_prefix("# ")/find("**")code is deleted).Unterminated-fence behavior for streaming answers is preserved (partial blocks still render, no synthetic closing fence).
Validation
cargo fmt --all -- --checkcleancargo clippy --workspace --all-targets --locked -- -D warningscleancargo test --workspace --all-targets --locked: forge-tui 743 passed; only known failures are the 3 pre-existing environmentalforge-configpermissions tests (read the developer's real user-levelpermissions.toml, unrelated to this change)