Repository navigation
Formatter: prefix every line of a blockquote's children with > - #640
Merged
Merged
Conversation
The formatter prefixed each blockquote child only on its first line, so any child spanning several lines lost the quote on the rest. A list inside a blockquote came out as one quoted item followed by a plain list; a nested blockquote or fenced code block broke the same way. Prefix every line of each child instead, dropping the child's own indent first so a blockquote inside a list item still nests correctly. Fixes lists, nested blockquotes and code fences inside blockquotes.
nsafai
force-pushed
the
fix-blockquote-formatting
branch
3 times, most recently
from
September 11, 2026 04:20
838f45f to
7586686
Compare
nsafai
marked this pull request as ready for review
September 11, 2026 04:23
joelzwarrington
approved these changes
Sep 11, 2026
joelzwarrington
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the contribution!
Contributor
Author
Happy to! Btw, thanks for the quick merge @joelzwarrington Any chance this could go out in a patch release soon? Hoping to bump Keystatic's Markdoc dependency to pick it up, since its editor writes files with format(). |
Merged
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
format()prefixes each child of a blockquote with>on its first line only, so any child spanning several lines loses the quote on the rest. The multi-line sibling of #321, which fixed the two-paragraph case.Input:
Output on
main:Nested blockquotes and fenced code inside a blockquote break the same way. Found via Keystatic, which writes files with
format(): saving an essay with a quoted list silently restructured it.Fix: format the children unindented, join them with a blank line, and prefix every line with
>at the blockquote's own indent, so a quote inside a list item still nests. Three tests added; all fail onmain.