Skip to content

fix(markdown_parser): emit MdIndentTokenList for headers inside list items#9774

Merged
ematipico merged 1 commit intobiomejs:mainfrom
jfmcdowell:fix/md-header-indent-in-list
Apr 2, 2026
Merged

fix(markdown_parser): emit MdIndentTokenList for headers inside list items#9774
ematipico merged 1 commit intobiomejs:mainfrom
jfmcdowell:fix/md-header-indent-in-list

Conversation

@jfmcdowell
Copy link
Copy Markdown
Contributor

@jfmcdowell jfmcdowell commented Apr 2, 2026

Note

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

Summary

Fixes #9771.

Emit the required MdIndentTokenList when parsing ATX headers in list item content so MdHeader matches the grammar-defined slot layout.

Test Plan

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

Docs

N/A.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

⚠️ No Changeset found

Latest commit: 9b88ca3

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 2, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 2, 2026

Merging this PR will not alter performance

✅ 28 untouched benchmarks
⏩ 228 skipped benchmarks1


Comparing jfmcdowell:fix/md-header-indent-in-list (9b88ca3) with main (552a412)2

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.

  2. No successful run was found on main (ac93071) during the generation of this report, so 552a412 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@jfmcdowell jfmcdowell force-pushed the fix/md-header-indent-in-list branch from 6093778 to 9b88ca3 Compare April 2, 2026 13:33
@jfmcdowell jfmcdowell marked this pull request as ready for review April 2, 2026 13:46
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Walkthrough

This PR fixes the parser's handling of ATX headings within list items by emitting an explicit MdIndentTokenList CST node before parsing the heading content. The fix ensures that header nodes maintain a standard slot layout regardless of context. A test fixture file with various heading-in-list combinations has been added to expand parser test coverage.

Possibly related PRs

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: emitting MdIndentTokenList for headers inside list items, which is the core fix for issue #9771.
Linked Issues check ✅ Passed The PR successfully addresses the coding requirement from #9771 by emitting the missing MdIndentTokenList in parse_first_line_atx_heading when parsing headers in list items, ensuring well-formed MdHeader nodes.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the parser issue: modifying the heading parser logic and adding test fixtures for headers inside lists. No unrelated changes detected.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the fix for issue #9771 and detailing the parser changes with test results.

✏️ 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.

@ematipico ematipico merged commit 35305c9 into biomejs:main Apr 2, 2026
17 checks passed
@jfmcdowell jfmcdowell deleted the fix/md-header-indent-in-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.

fix(markdown_parser): non-standard slot layout for MdHeader inside list items

2 participants