-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fragment with set:html before <head> element inserts to wrong place and removes the head element #6478
Comments
What's the use-case here? |
I wanted to insert a comment about the current version of the page + build time so that I can keep track of my releases. It's more of a visual aspect. I moved the comment inside the head element, and that works ok. The very top of the document would be just a tiny bit more convenient. |
Can you use a regular comment node |
I'm not sure how. The content of the fingerprint is generated using dynamic data. const BUILD_FINGERPRINT = `<!-- v${version} : ${process.env.ENVIRONMENT} - ${new Date().toUTCString()} -->`; If i did this <!-- v{version} : {process.env.ENVIRONMENT} - {new Date().toUTCString()} --> It's treated correctly as a comment. |
what about this?
|
I just verified that all content from |
There was a compiler bug that was fixed here: withastro/compiler#985 Everything should be working now. |
What version of
astro
are you using?2.1.2
Are you using an SSR adapter? If so, which one?
No
What package manager are you using?
pnpm
What operating system are you using?
Windows
Describe the Bug
When Fragment with
set:html
orset:text
is used before head element it breaks the HTML structure completely by removing head element in the final output and inserting the content of the fragment to the body.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-45dh9n-qyhnbj?file=src/pages/index.astro
Participation
The text was updated successfully, but these errors were encountered: