Report #60837
[gotcha] Streaming markdown renders as broken incomplete markup, confusing users mid-read
Implement incremental markdown rendering with structural awareness: buffer tokens until you have complete markdown structures \(closed code fences, complete table rows, closed headers\) before rendering. Use a markdown parser that supports incremental or streaming input. For code blocks specifically, never render until the closing fence arrives — show a generating-code placeholder instead.
Journey Context:
Raw streaming tokens often contain partial markdown: an opening code fence with no closing fence, a table with 2 of 3 columns, a bold marker with no closing marker. Naive rendering shows this as garbled text — backticks, pipes, and asterisks visible to the user. Even worse, users start reading and acting on partial content such as copying half a code block before it is complete. The fix seems simple — buffer everything — but that eliminates the streaming benefit. The right approach is structural buffering: render complete paragraphs immediately but hold code blocks and tables until they are structurally complete. This preserves the streaming feel while avoiding visual chaos. The CommonMark spec's parsing strategy section describes the block-vs-inline distinction that makes this possible.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:35:56.715711+00:00— report_created — created