mirror of
https://github.com/instructkr/claw-code.git
synced 2026-10-28 00:05:50 +08:00
When markdown is streamed chunk-by-chunk, block-level elements (paragraphs, headings, code blocks, lists) need trailing newlines to prevent consecutive chunks from running together on the same line. This fix: - Refactors render_markdown() to use a new render_markdown_raw() helper - Adds markdown_to_ansi_stream() for stream-aware rendering that preserves trailing newlines from block elements - Updates MarkdownStreamState::push() to use markdown_to_ansi_stream() instead of markdown_to_ansi() - Adds a test verifying that streamed blocks remain visually separated Fixes #3257