-
-
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] textContent should not be set for <template> element. #7297
[fix] textContent should not be set for <template> element. #7297
Conversation
…a variable and replace usages.
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 for the explanation and refactor! This makes sense to me. It would be great to have a test for this too to prevent regressions.
I assume we are looking for a snapshot testing of the compiler output where should this test be |
There's https://github.com/sveltejs/svelte/blob/dispatch-cancelable/test/runtime/samples/template/_config.js currently, but that checks things imperatively. I think something similar could be done instead of a snapshot by checking for |
I tried modifying this test, to make some assertions on the dom
my guess svelte component has c() and m(), and |
|
tests should be passing now. |
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.
LGTM 👍 Thanks for adding the tests.
This has been released in 3.48.0 - thanks! |
fix inconsistent rendering of template tags, where text only content is not inserted in the fragment (
.content
)elements directly under a template element is non standard, and may break some functionality
for example
$(template).innerHTML
will be empty when elements are not part of the fragment.current behavior
for
A
,B
content is not part of the template fragment(.content
)