Repository navigation
Description
Editing an ordinary paragraph can corrupt an otherwise untouched fenced code block inside a blockquote when the document is saved. Fences disappear, code lines concatenate, and code-toolbar text enters the saved Markdown.
Validated on main at d50e1fd1ad080fadf416098a582fe0a277d1ad43 (package version 0.2.1), 2026-09-16 UTC. Environment: macOS 26.5.2, arm64.
Reproduction
Open this synthetic document in visual mode using the Things theme:
> ```
> alpha
> beta
> ```
After- Confirm that the quoted code block initially contains two lines.
- Append
updatedto theAfterparagraph. Do not edit the code block. - Save and inspect the resulting Markdown.
- Reload that saved Markdown in preview.
Expected: only the final paragraph changes; the quoted fence, its language, and both code lines remain intact.
Observed saved content with English UI labels:
> ⤢plaintextCopy
> alphabeta
After updatedReloading this output produces no code block. The same failure occurs with a javascript fence. Saving the untouched original before making any edit preserves its source; the corruption occurs when a visual edit requires DOM serialization. The code Copy control separately preserves the two original lines.
Cause and suggested scope
mdProcessBlockquote lacks a fenced-pre branch. It walks the code header as content and handles the block's code element through the inline path. Add block-aware serialization that reuses the existing code-block serializer, excludes editor controls, and prefixes every resulting line with the quote marker.
Regression coverage should include unrelated paragraph edits, labelled/unlabelled quoted code, internal and trailing blank lines, saving/reopening, source switching, copying, and quoted math/Mermaid interactions. This is a source-integrity bug independent of indented-fence recognition.
Validation boundary
Reproduced through real keyboard input and save handling in Chromium with the production webview HTML/CSS/JavaScript. Captured the outgoing save payload at a mocked VS Code API boundary and rendered that payload again. Repeated with vendor JavaScript enabled and disabled; both corrupted the output without JavaScript exceptions. An installed-extension filesystem save was not exercised. All examples are synthetic.
Activity