feat(file-preview): render Markdown files in the preview panel instead of plain highlighted text
Author: kouyichiCreated Sep 1, 2026Updated Sep 1, 2026
Problem
The file preview panel currently shows .md files as plain text with syntax highlighting (chroma by default, or bat via code_previewer). Headings, tables, bold/italic, links, blockquotes and task lists are all displayed as raw source markup, which makes READMEs and docs hard to skim in the preview.
Expected behavior
Markdown files should be rendered in the preview panel — styled headings, tables, code blocks, links, etc. — similar to what glow or mdcat produce in the terminal.
Possible approaches (open to maintainers' preference)
- Built-in rendering — render
.mdwith a Go markdown renderer (e.g.goldmark+ a terminal style likeglamour) so it works out of the box with zero dependencies. - External renderer hook — extend the existing
code_previewermechanism with amarkdownoption that pipes the file through a configurable external command (e.g.glow,mdcat), falling back to plain highlighted text when unavailable.
Approach 2 fits the existing config pattern (code_previewer = "" | "bat") and keeps the binary small, but a fallback/graceful degradation would be needed for users without the external tool.
Related
- #294 — Custom file previews (general framework request; this issue is the markdown-specific use case)
- #1193 — bat command flags are not configurable and can clash with user's bat config (relevant if approach 2 is chosen)
Environment
- superfile v1.6.0
- Linux, kitty/wezterm terminals (both support image/rich text protocols if that becomes relevant)
Source: yorukot/superfile