Conversation
|
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)
✅ Files skipped from review due to trivial changes (1)
WalkthroughRefactors many Markdown formatter rules to stop emitting verbatim node syntax and instead destructure nodes into fields and format tokens/contents explicitly. Introduces a new trimming variant 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)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/biome_markdown_formatter/src/markdown/auxiliary/textual.rs`:
- Around line 48-49: The whitespace-detection uses ASCII-only checks which
mismatch split_whitespace() Unicode semantics; update the checks that set
has_leading_ws and has_trailing_ws to use char::is_whitespace() (i.e., replace
starts_with(|c: char| c.is_ascii_whitespace()) and ends_with(|c: char|
c.is_ascii_whitespace()) with Unicode-aware checks) so leading/trailing
non-ASCII whitespace (e.g., U+2009) is detected consistently with
split_whitespace().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9036387a-4567-461d-aa0a-25ce81a1cc25
⛔ Files ignored due to path filters (25)
crates/biome_markdown_formatter/tests/specs/markdown/autolink.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/markdown/blockquote.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/markdown/html_block.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/markdown/inline_code.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/markdown/inline_image.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/markdown/link_reference_definition.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/blockquote/code.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/blockquote/ignore-code.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/linkReference/case-and-space/case-and-space.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/markdown/real-world-case.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/paragraph/lorem.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-157.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-158.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-159.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-162.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-170.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-177.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-187.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-200.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-201.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-476.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-507.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-542.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/spec/example-85.md.snapis excluded by!**/*.snapand included by**crates/biome_markdown_formatter/tests/specs/prettier/markdown/splitCjkText/symbolSpaceNewLine.md.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (28)
crates/biome_markdown_formatter/src/markdown/auxiliary/autolink.rscrates/biome_markdown_formatter/src/markdown/auxiliary/entity_reference.rscrates/biome_markdown_formatter/src/markdown/auxiliary/html_block.rscrates/biome_markdown_formatter/src/markdown/auxiliary/indent.rscrates/biome_markdown_formatter/src/markdown/auxiliary/inline_code.rscrates/biome_markdown_formatter/src/markdown/auxiliary/inline_html.rscrates/biome_markdown_formatter/src/markdown/auxiliary/inline_image.rscrates/biome_markdown_formatter/src/markdown/auxiliary/link_destination.rscrates/biome_markdown_formatter/src/markdown/auxiliary/link_label.rscrates/biome_markdown_formatter/src/markdown/auxiliary/link_reference_definition.rscrates/biome_markdown_formatter/src/markdown/auxiliary/link_title.rscrates/biome_markdown_formatter/src/markdown/auxiliary/newline.rscrates/biome_markdown_formatter/src/markdown/auxiliary/quote.rscrates/biome_markdown_formatter/src/markdown/auxiliary/quote_indent.rscrates/biome_markdown_formatter/src/markdown/auxiliary/quote_prefix.rscrates/biome_markdown_formatter/src/markdown/auxiliary/soft_break.rscrates/biome_markdown_formatter/src/markdown/auxiliary/textual.rscrates/biome_markdown_formatter/src/markdown/auxiliary/thematic_break_block.rscrates/biome_markdown_formatter/src/markdown/auxiliary/thematic_break_char.rscrates/biome_markdown_formatter/src/markdown/lists/inline_item_list.rscrates/biome_markdown_formatter/src/shared.rscrates/biome_markdown_formatter/tests/quick_test.rscrates/biome_markdown_formatter/tests/specs/markdown/autolink.mdcrates/biome_markdown_formatter/tests/specs/markdown/blockquote.mdcrates/biome_markdown_formatter/tests/specs/markdown/html_block.mdcrates/biome_markdown_formatter/tests/specs/markdown/inline_code.mdcrates/biome_markdown_formatter/tests/specs/markdown/inline_image.mdcrates/biome_markdown_formatter/tests/specs/markdown/link_reference_definition.md
There was a problem hiding this comment.
i'll change it a lot, so i'll keep it as is for now
Summary
Markdown formatting of the following nodes:
Added a new printing mode where words are normalised: leading and trailing spaces that exceed 1 are normalised to 1. This matches prettier behaviour
Test Plan
I used AI to help me with the creation of tests
Docs