Skip to content

fix(markdown_parser): blockquote list splitting and tightness#9990

Draft
jfmcdowell wants to merge 1 commit intobiomejs:mainfrom
jfmcdowell:fix/md-blockquote-list-semantics
Draft

fix(markdown_parser): blockquote list splitting and tightness#9990
jfmcdowell wants to merge 1 commit intobiomejs:mainfrom
jfmcdowell:fix/md-blockquote-list-semantics

Conversation

@jfmcdowell
Copy link
Copy Markdown
Contributor

Note

This PR was created with AI assistance (Claude Code).

Summary

Blank blockquote continuation lines (> followed by whitespace + newline) between list items were splitting lists into separate elements and corrupting tightness metadata.

Two narrow fixes in list.rs:

  • Phase 1 (blank_line_phase_quote_depth_exit): no longer breaks early when the next quoted content is a sibling item of the same list type and marker. Falls through so Phase 4 consumes the blank > line into the item and check_continuation_indent breaks at the marker position.
  • Phase 3 (blank_line_phase_non_quote_classify): blank lines without a quote prefix inside a blockquote are now treated as container-escaping — they break the item without falsely loosening the list.

One renderer fix in to_html.rs:

  • is_newline_block now treats MdQuotePrefix as structural-only, preventing trailing newline leaks in tight list items.

Different bullet markers and cross-type transitions still correctly split into separate lists.

Test Plan

  • just test-crate biome_markdown_parser
  • just test-markdown-conformance — 652/652, 100%
  • Added list_in_blockquote.{md,html} fixture covering same-bullet loose, same-ordered loose, same-bullet tight, different-bullet split, and cross-type split
  • Differential fuzz against 1,547-case expanded corpus: 296 fixes, 0 regressions

Docs

N/A

Blank blockquote continuation lines (`>` + whitespace + newline) between
list items no longer split the list or corrupt tightness metadata.

Phase 1 (`blank_line_phase_quote_depth_exit`) now falls through when the
next quoted content is a sibling item of the same list type and marker,
letting Phase 4 consume the blank line and `check_continuation_indent`
break at the correct position.

Phase 3 (`blank_line_phase_non_quote_classify`) now treats blank lines
without a quote prefix as container-escaping when inside a blockquote,
preventing them from falsely loosening the blockquote's internal list.

Also fixes `is_newline_block` in `to_html` to treat `MdQuotePrefix` as
structural-only, preventing trailing newline leaks in tight list items.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

⚠️ No Changeset found

Latest commit: 3e4dc5a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-Parser Area: parser L-Markdown Language: Markdown labels Apr 15, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 15, 2026

Merging this PR will not alter performance

✅ 28 untouched benchmarks
⏩ 228 skipped benchmarks1


Comparing jfmcdowell:fix/md-blockquote-list-semantics (3e4dc5a) with main (79c09f2)

Open in CodSpeed

Footnotes

  1. 228 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Parser Area: parser L-Markdown Language: Markdown

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant