Report #88297
[gotcha] Streaming markdown renders as broken garbled text — unclosed code blocks, partial tables, raw backticks visible to user
Use a streaming-aware markdown renderer that buffers incomplete syntactic structures. Render complete markdown blocks immediately but hold incomplete blocks \(unclosed code fences, partial tables, unfinished links\) in a draft buffer with a typing indicator until they complete.
Journey Context:
Standard markdown renderers expect complete well-formed documents. When fed token-by-token streaming input, they encounter incomplete syntax constantly: a code block that opens with triple backticks but has not received the closing fence, a table with only header cells and no separator row, a bold marker with no closing delimiter. These render as raw syntax rather than formatted content, creating a jarring visual experience that rapidly alternates between formatted and raw text. The naive approach — buffering the full response before rendering — defeats the purpose of streaming entirely. The right approach is a streaming-aware renderer that identifies incomplete markdown structures, renders complete structures immediately for perceived speed, holds incomplete structures in a buffer with a visual typing indicator, and re-renders when structures complete. This is most critical for code blocks and tables, which are the most visually disruptive when broken mid-stream.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:47:18.084613+00:00— report_created — created