Skip to content

fix(parse/html/astro): accept astro files with empty frontmatter#8836

Merged
ematipico merged 1 commit intomainfrom
dyc3/astro-empty-frontmatter
Jan 23, 2026
Merged

fix(parse/html/astro): accept astro files with empty frontmatter#8836
ematipico merged 1 commit intomainfrom
dyc3/astro-empty-frontmatter

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Jan 22, 2026

Summary

This PR allows the HTML parser to accept astro files that have frontmatter present, but it's empty. This was completely done using gpt 5.2.

fixes #7858

Test Plan

Added a new snapshot test.

Docs

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2026

🦋 Changeset detected

Latest commit: 736113f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch
@biomejs/prettier-compare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Parser Area: parser L-HTML Language: HTML and super languages labels Jan 22, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

Walkthrough

This PR addresses Astro frontmatter parsing in Biome's HTML parser. The changes modify how empty frontmatter blocks are handled by converting silent parse result discarding into conditional node creation. When embedded content parsing returns Absent, the parser now explicitly constructs an ASTRO_EMBEDDED_CONTENT node. The fix includes a changelog entry and a test case validating that Astro files containing empty frontmatter (two --- delimiters) parse correctly.

Suggested labels

A-Parser, L-HTML

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: enabling Astro file parsing with empty frontmatter blocks.
Description check ✅ Passed The description is related to the changeset, explaining the motivation (accepting Astro files with empty frontmatter) and referencing issue #7858.
Linked Issues check ✅ Passed The PR successfully addresses issue #7858 by modifying the Astro parser to handle empty frontmatter blocks and includes a snapshot test validating the fix.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing empty frontmatter parsing: a changelog entry, parser logic modification, and a test case—nothing extraneous included.

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

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@dyc3 dyc3 requested review from a team January 22, 2026 22:59
@ematipico ematipico merged commit aab1d17 into main Jan 23, 2026
13 checks passed
@ematipico ematipico deleted the dyc3/astro-empty-frontmatter branch January 23, 2026 00:08
@github-actions github-actions bot mentioned this pull request Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Parser Area: parser L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📝 Empty frontmatter isn't recognized as valid Astro syntax

2 participants