Skip to content

refactor(markdown-parser): decompose handle_blank_lines into phase helpers#9453

Open
jfmcdowell wants to merge 1 commit intobiomejs:mainfrom
jfmcdowell:refactor/list-handle-blank-lines
Open

refactor(markdown-parser): decompose handle_blank_lines into phase helpers#9453
jfmcdowell wants to merge 1 commit intobiomejs:mainfrom
jfmcdowell:refactor/list-handle-blank-lines

Conversation

@jfmcdowell
Copy link
Contributor

@jfmcdowell jfmcdowell commented Mar 12, 2026

Note

AI Assistance Disclosure: This PR was developed with assistance from Claude Code.

Summary

Decompose handle_blank_lines into a named result type and five phase-specific helpers so the quote-aware blank-line state machine in list parsing is easier to audit without changing behavior.

  • Replace the opaque (LoopAction, bool) return type with BlankLineOutcome, making line_has_quote_prefix explicit at the call site.
  • Extract phase-specific helpers for quote-depth exit, quote-only blank lines, non-quote blank line classification, quote-only lines after prefix, and blank lines after prefix.
  • Reduce handle_blank_lines to a thin orchestrator over those phases.

Test Plan

  • just test-crate biome_markdown_parser
  • just test-markdown-conformance (652/652, 100%)
  • just f
  • just l

Docs

N/A — internal parser refactor with no user-facing behavior change.

@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2026

⚠️ No Changeset found

Latest commit: d78bd7e

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 Mar 12, 2026
@jfmcdowell jfmcdowell marked this pull request as ready for review March 12, 2026 01:28
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 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: d87076f9-73c2-486e-9826-bc3d63da84b5

📥 Commits

Reviewing files that changed from the base of the PR and between 89bf719 and d78bd7e.

📒 Files selected for processing (1)
  • crates/biome_markdown_parser/src/syntax/list.rs

Walkthrough

A refactoring of blank-line handling in the markdown list parser that replaces a (LoopAction, bool) tuple return type with a dedicated BlankLineOutcome struct. The change introduces five phase-specific helper functions to orchestrate blank-line logic, making the control flow more explicit whilst maintaining the same overall behaviour.

Possibly related PRs

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring handle_blank_lines by decomposing it into phase helper functions.
Description check ✅ Passed The description is directly related to the changeset, detailing the replacement of opaque tuple returns with BlankLineOutcome and the extraction of five phase-specific helpers.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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.

1 participant