refactor(markdown): deduplicate shared helper functions#9766
refactor(markdown): deduplicate shared helper functions#9766dyc3 merged 2 commits intobiomejs:mainfrom
Conversation
Extract `is_whitespace_only` as `pub(crate)` in `syntax/mod.rs` and remove identical copies from `list.rs` and `quote.rs`. Extract `find_line_start` as `pub(crate)` in `token_source.rs` and remove the identical copy from `fenced_code_block.rs`.
|
Merging this PR will not alter performance
Comparing Footnotes
|
|
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 selected for processing (1)
WalkthroughThis PR centralises two previously duplicated helpers in the markdown parser by making 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 |
49d028c to
7180db4
Compare
Note
This PR was created with AI assistance (Claude Code).
Summary
Extract two duplicated helper functions into shared
pub(crate)definitions:is_whitespace_only: was identical inlist.rs,quote.rs, andmod.rs. Now lives once insyntax/mod.rs.find_line_start: was identical intoken_source.rsandfenced_code_block.rs. Now lives once intoken_source.rs.No behavior change.
Test Plan
just test-crate biome_markdown_parser— all passedjust test-markdown-conformance— 652/652just fjust lDocs
N/A.