Repository navigation
Improve post Markdown and fullscreen Sixel images - #31
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are present, and the change is supported by expanded coverage for Markdown styling, links, wrapping, and responsive table layouts.
No open issues 🎉
What changed in this PR
This PR replaces the previous Glamour-only post rendering path with a custom Markdown pipeline that adds terminal styling, responsive table layouts, and reliable hyperlink handling across wrapped lines.
Changes:
- Added styled rendering for headings, emphasis, strikethrough, block quotes, task lists, inline code, and links.
- Added aligned wide-table rendering and labeled-row layouts for narrow panes with Unicode-aware sizing.
- Preserved styles and validated hyperlinks across independently wrapped and scrolled lines.
- Expanded tests for Markdown styles, tables, wrapping, links, and responsive layouts.
| File | Description |
|---|---|
| internal/ui/web_links.go | Preserves validated hyperlinks and reapplies inline styles independently for each wrapped row. |
| internal/ui/web_links_test.go | Updates hyperlink assertions for styled Markdown output and wrapped-link behavior. |
| internal/ui/ui_test.go | Verifies rendered Markdown markers, visible destinations, and terminal hyperlink output. |
| internal/ui/text.go | Removes the former Glamour-based text renderer and related cache implementation. |
| internal/ui/markdown.go | Implements Markdown parsing, terminal styling, and responsive table layout logic. |
| internal/ui/markdown_test.go | Adds coverage for Markdown styles, wrapping, table alignment and reflow, links, headings, quotes, tasks, and strikethrough. |
Review effort: Lite
Merged
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.
Render post Markdown with terminal styling for bold, italic, strikethrough, and inline code. Headings use bold text and distinct markers by level, block quotes use vertical bars, and task lists use checkbox glyphs. Wrapped lines keep their styling when scrolled independently.
Top-level tables use aligned columns when they fit and switch to labeled rows in narrow panes. Links show their destinations and stay clickable when enabled.
Pressing
xon terminals that use fullscreen Sixel could show a blank pane or an image outside its border. Draw the frame before sending the Sixel raster, then fit and center the raster using the terminal's reported cell size. This applies to Sixel output from both Chafa and ImageMagick.make checkpassed with Go 1.27.4. Regression tests cover Markdown styles and tables, Sixel draw order, and raster placement within the pane. Portrait, landscape, and square fixtures fit the pane with both encoders.