-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix: ssr comments in head elements that require raw content #10936
Conversation
🦋 Changeset detectedLatest commit: 22cac41 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@@ -64,6 +64,8 @@ export const VoidElements = new Set([ | |||
'wbr' | |||
]); | |||
|
|||
export const RawTextElements = new Set(['textarea', 'script', 'style', 'title']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you put these in constants.js
where all the others are? Plus it doesn't need to be a Set, an array here would be slightly faster than a Set as there are so few elements in it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have moved and changed it now. I had just used the same method as the VoidElements
set that was above.
Fixes #10935 - HTML comments being added to
<title>
is annoying, but adding it to<style>
and<script>
can down right break the entire site, this fixes it the same way the SSR comments were removed from the <textarea> valueNote: I had an issue with creating the test, if i placed the elements inside the
<svelte:head>
component the test would not fail, even though the_actual-head.html
and_expected-head.html
did not match up. I've made the test without<svelte:head>
so that it actually fails and succeeds and expected.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint