fix(markdown): fix false diagnostic on nested lists with double blank lines#9764
Conversation
… 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.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThe 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. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
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_indentconsumed 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 whereexpected_indent > 0, which in turn preventedskip_blank_lines_between_itemsfrom 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 passedjust test-crate biome_markdown_formatter— all passedjust test-markdown-conformance— 652/652just fjust lDocs
N/A.