Markdown often arrives live in chat apps, terminals, and other interfaces. Many UIs keep rewriting a growing rendered document; as output gets longer, that can mean more work and memory. A streaming parser can keep a small input window, emit safe output, and discard old text.
I have found little guidance for live Markdown generators and renderers: which features should they avoid, and which need buffering or lookahead? Would a short guide help?
I have been trying this in mdflow, a Markdown-to-terminal streaming renderer.
github.com
GitHub - cjccjj/mdflow: Unlike mdcat and Glow (Glamour), which buffer the...
Unlike mdcat and Glow (Glamour), which buffer the entire input before rendering, mdflow streams Markdown to the terminal in real time. It is also very fast and lightweight.
Its parser is a streaming rework of MD4C. MD4C is fully CommonMark-compliant; mdflow is tested against it and documents its streaming limits. The terminal presentation is outside CommonMark’s scope; this is only about parsing.
mdflow emits incrementally, usually a line at a time, while buffering at most two input lines. The remaining limits mostly affect static documents, because live streams rarely use these features:
Reference links cannot fully stream because definitions may appear later.
Multi-line Setext headings and tight/loose lists need a little lookahead or a small compromise.
Most other constructs can be processed as input arrives; GFM is mostly covered too.
The memory benefit may be large. In the current 10 MB mixed-Markdown benchmark, mdflow peaks at 2.3 MB, versus 102.3 MB for mdcat and 972.8 MB for glow. The README has the details.
This is not a proposal to change CommonMark. But with a few small changes requiring definitions before references, limiting multi-line Setext headings, and making tight/loose lists locally decidable, Markdown could be fully streamable.
mdflow and this idea are early experiments. I am not a long-time Markdown implementer and would welcome corrections.
Special thanks to @mity for creating MD4C. Its flat-buffer design made this streaming reconstruction practical.
1 post - 1 participant
Read full topic
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Markdown outline in (neo)vim with fzf | 0 | 6.86 | 01-07-2026 |
| 2 | 0 | 9.82 | 28-07-2026 | |
| 3 | All Core Devs - Consensus (ACDC) #183, July 23 2026 | 0 | 15.18 | 13-07-2026 |
| 4 | textproc/mdbook-mermaid - 0.17.1 | 0 | 44.1 | 15-08-2026 |
| 5 | Вайбкодю, потихоньку | 0 | 5 | 02-07-2026 |
| 6 | Daily Hacker News for 2026-07-28 | 0 | 11.42 | 29-07-2026 |
| 7 | ERC-8340: Transaction Metadata Encoding | 0 | 34.21 | 15-07-2026 |
| 8 | [Show] swift-topomap: Silicon-aware TUI and eBPF metrics engine | 0 | 11.87 | 27-07-2026 |
| 9 | Я устал писать одноразовые скрипты для бенчмарков LLM и собрал харнесс, который сам считает Pareto-front | 0 | 7 | 27-06-2026 |