Report #66557
[gotcha] Streaming markdown responses cause visible rendering flicker as partial syntax is parsed and re-parsed
Use a streaming-aware markdown renderer that handles partial syntax gracefully, or buffer until complete markdown blocks \(closed code fences, complete paragraphs\) are available before rendering. Never re-render the entire output on each new token.
Journey Context:
Standard markdown parsers expect complete, well-formed input. During streaming, you get fragments like opening triple-backticks without the closing fence, or \*\*bold without the closing \*\*. Naive implementations re-parse and re-render the entire output on each new token, causing visible flicker as the DOM is rebuilt. The user sees code blocks flash open and closed, text toggle between bold and plain, and lists reflow. The fix is either a streaming-aware parser that treats unclosed syntax as pending rather than broken, or buffering until syntactically complete units arrive. The tradeoff is a slight delay before content appears, but eliminating flicker dramatically improves perceived quality. The CommonMark spec defines strict parsing rules that make partial input behave unpredictably, which is why ad-hoc renderers fail.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:11:47.779233+00:00— report_created — created