Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement new fragment behavior to support head and body #177

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

natemoo-re
Copy link
Member

Changes

Testing

WASM test added as that's the only area this behavior is surfaced

Docs

Bug fix

@changeset-bot
Copy link

changeset-bot bot commented Nov 29, 2021

🦋 Changeset detected

Latest commit: 601258b

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

This PR includes changesets to release 1 package
Name Type
@astrojs/compiler Minor

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

@@ -1082,17 +1082,25 @@ func inBodyIM(p *parser) bool {
}
switch p.tok.DataAtom {
case a.Html:
if p.inTemplateFragmentContext() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 This makes sense to me

@@ -2157,7 +2175,7 @@ func inSelectInTableIM(p *parser) bool {
// Section 12.2.6.4.18.
func inTemplateIM(p *parser) bool {
switch p.tok.Type {
case TextToken, CommentToken, DoctypeToken:
case TextToken, CommentToken, DoctypeToken, FrontmatterFenceToken:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh good catch

@matthewp
Copy link
Contributor

lgtm

@natemoo-re natemoo-re merged commit 7e1aded into main Nov 29, 2021
@natemoo-re natemoo-re deleted the feat/new-fragment branch November 29, 2021 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: presence of a body tag in a layout crashes Astro entirely
4 participants