From ea447c5b3c3cfbd76de58ff3b22af7eb9dbe3bbf Mon Sep 17 00:00:00 2001 From: Dave Date: Wed, 25 Feb 2026 16:29:26 +0000 Subject: [PATCH] story-kit: create 192_bug_code_fences_lose_newlines_when_pasted_from_agent_output --- ..._newlines_when_pasted_from_agent_output.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .story_kit/work/1_upcoming/192_bug_code_fences_lose_newlines_when_pasted_from_agent_output.md diff --git a/.story_kit/work/1_upcoming/192_bug_code_fences_lose_newlines_when_pasted_from_agent_output.md b/.story_kit/work/1_upcoming/192_bug_code_fences_lose_newlines_when_pasted_from_agent_output.md new file mode 100644 index 0000000..ec5cda9 --- /dev/null +++ b/.story_kit/work/1_upcoming/192_bug_code_fences_lose_newlines_when_pasted_from_agent_output.md @@ -0,0 +1,28 @@ +--- +name: "Code fences lose newlines when pasted from agent output" +--- + +# Bug 192: Code fences lose newlines when pasted from agent output + +## Description + +When the assistant pastes a multi-line Rust function using a fenced code block, the second half of the code loses its line breaks and renders as a single long line. This has been reproduced twice in the Matrix chat interface. + +## How to Reproduce + +1. Ask the assistant to paste a multi-line Rust function in a fenced code block +2. The function `mentions_bot()` from the matrix bot module was used as the test case +3. Observe the rendered output in Matrix + +## Actual Result + +The first portion of the code block renders with proper newlines, but partway through (around the `let short = format!(...)` line), all remaining lines collapse into a single line with no line breaks. + +## Expected Result + +The entire code block should render with proper newlines preserved, matching the original source formatting. + +## Acceptance Criteria + +- [ ] Code fences with multi-line content preserve all newlines when sent through the Matrix bot interface +- [ ] Verify the issue is not a Matrix client rendering bug vs. a message sending bug (inspect the raw message content)