Skip to content

fix(markdown): fix false diagnostic on nested lists with double blank lines#9764

Merged
dyc3 merged 2 commits intobiomejs:mainfrom
jfmcdowell:fix/markdown-double-blank-nested-list
Apr 1, 2026
Merged

fix(markdown): fix false diagnostic on nested lists with double blank lines#9764
dyc3 merged 2 commits intobiomejs:mainfrom
jfmcdowell:fix/markdown-double-blank-nested-list

Conversation

@jfmcdowell
Copy link
Copy Markdown
Contributor

@jfmcdowell jfmcdowell commented Apr 1, 2026

Note

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

Summary

Fix false "Expected a list item" diagnostic emitted when nested list items are separated by two or more blank lines.

The blank-line skip loop in has_list_item_after_blank_lines_at_indent consumed leading whitespace on the content line during blank-line detection, leaving the subsequent indent counter at 0. This caused indent validation to fail for nested lists where expected_indent > 0, which in turn prevented skip_blank_lines_between_items from recognizing the next sibling item.

Merged indent tracking into the skip loop so the indent is correctly measured from the whitespace consumed on the final (non-blank) line.

Added a regression in crates/biome_markdown_parser/tests/spec_test.rs covering nested sibling items after blank lines.

Test Plan

  • just test-crate biome_markdown_parser — all passed
  • just test-crate biome_markdown_formatter — all passed
  • just test-markdown-conformance — 652/652
  • just f
  • just l

Docs

N/A.

… lines

The blank-line skip loop in `has_list_item_after_blank_lines_at_indent`
consumed leading whitespace on the content line, then the separate indent
counter read 0. This caused indent validation to fail for nested lists
where `expected_indent > 0`.

Merged indent tracking into the skip loop so the indent is correctly
measured from the whitespace consumed on the final (non-blank) line.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: 9aa5f21

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

@jfmcdowell jfmcdowell marked this pull request as draft April 1, 2026 13:08
@github-actions github-actions bot added A-Parser Area: parser L-Markdown Language: Markdown labels Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 49a156a1-640d-48f3-be01-df0acb121f25

📥 Commits

Reviewing files that changed from the base of the PR and between bf16d9b and 9aa5f21.

⛔ Files ignored due to path filters (1)
  • crates/biome_markdown_parser/tests/md_test_suite/ok/nested_list_double_blank.md.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (1)
  • crates/biome_markdown_parser/tests/md_test_suite/ok/nested_list_double_blank.md
✅ Files skipped from review due to trivial changes (1)
  • crates/biome_markdown_parser/tests/md_test_suite/ok/nested_list_double_blank.md

Walkthrough

The list blank-line lookahead in the markdown parser was changed to compute indentation while consuming blank lines instead of doing a separate post-skip pass. has_list_item_after_blank_lines_at_indent now accumulates indent across traversed blank lines and uses that tracked value for the marker-indent range check. Three tests and a markdown fixture were added to verify nested unordered-list behaviour across varying counts of blank lines.

Possibly related PRs

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically summarizes the main fix: addressing false diagnostics on nested lists when separated by double blank lines.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the bug, the root cause, the fix applied, and test coverage added.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 1, 2026

Merging this PR will not alter performance

✅ 28 untouched benchmarks
⏩ 228 skipped benchmarks1


Comparing jfmcdowell:fix/markdown-double-blank-nested-list (9aa5f21) with main (716e4e1)

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.

@jfmcdowell jfmcdowell marked this pull request as ready for review April 1, 2026 13:33
@dyc3 dyc3 merged commit f009153 into biomejs:main Apr 1, 2026
16 checks passed
@jfmcdowell jfmcdowell deleted the fix/markdown-double-blank-nested-list branch April 13, 2026 12:29
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.

2 participants