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

Do not require <head> and <body> elements for transformers #241

Closed
natemoo-re opened this issue May 25, 2021 · 0 comments · Fixed by #447
Closed

Do not require <head> and <body> elements for transformers #241

natemoo-re opened this issue May 25, 2021 · 0 comments · Fixed by #447
Assignees

Comments

@natemoo-re
Copy link
Member

We really shouldn't be requiring <head> and <body> elements [in transformers/optimizers] as those are not required in HTML. What we should be doing in a case like this is if there is not a head, find the first non-head element (so anything that's not one of these: https://htmlhead.dev/#elements) and inject before that element. The browser will parse it as inside of the head. We could create a utility to make these easier for transformers to do.

Originally posted by @matthewp in #231 (comment)

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 a pull request may close this issue.

2 participants