fix: keep blank lines between paragraphs of a list item in a block quote#189
Open
divybot wants to merge 1 commit into
Open
fix: keep blank lines between paragraphs of a list item in a block quote#189divybot wants to merge 1 commit into
divybot wants to merge 1 commit into
Conversation
A blank line inside a block quote is written as `>`, so the leading `>` character prevented `has_leading_blankline` from recognizing the line as blank. As a result the blank line between two paragraphs of a list item nested in a block quote was dropped, merging the paragraphs. Skip block quote markers while scanning backwards for blank lines when inside a block quote. Co-Authored-By: Divy Srivastava <me@littledivy.com>
littledivy
added a commit
to denoland/deno
that referenced
this pull request
Jun 7, 2026
…ck quote `deno fmt` dropped the blank line separating two paragraphs of a list item nested in a block quote, merging them into a single paragraph (and previously indenting the `>` marker). Markdown formatting is handled by the external `dprint-plugin-markdown` crate, where `has_leading_blankline` failed to detect a blank line inside a block quote because such a line is written as `>` and the leading `>` character broke its backwards scan. The fix lives in dprint-plugin-markdown (dprint/dprint-plugin-markdown#189). Until a release containing it is published, consume it via a temporary `[patch.crates-io]` pointing at a branch with the fix backported onto the 0.20.0 release. Adds a spec test verifying the blank line is preserved. Closes #17758 Co-Authored-By: Divy Srivastava <me@littledivy.com>
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.
Fixes the case where a blank line separating two paragraphs of a list item nested in a block quote was dropped, merging the two paragraphs into one.
Input
Before
After (matches input)
Cause
A blank line inside a block quote is written as
>, so the leading>character stoppedhas_leading_blanklinefrom recognizing the line as blank while it scanned backwards.get_conditional_blank_linetherefore only emitted a single newline between the two paragraphs of the list item.Fix
When inside a block quote, skip the block quote markers (
>) while scanning backwards for consecutive newlines. Outside of block quotes behaviour is unchanged.Added spec tests under
tests/specs/Issues/Deno/(ordered + unordered lists, multiple paragraphs, nested block quote,textWrap: never, and a negative test ensuring soft-wrapped lines without a blank line still merge).Reported downstream in Deno: denoland/deno#17758