Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spicy-shrimps-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: more robust hydration of html tag
3 changes: 3 additions & 0 deletions packages/svelte/src/runtime/internal/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,9 @@ export function claim_html_tag(nodes, is_svg) {
detach(html_tag_nodes[0]);
detach(html_tag_nodes[html_tag_nodes.length - 1]);
const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);
if (claimed_nodes.length === 0) {
return new HtmlTagHydration(is_svg);
}
for (const n of claimed_nodes) {
n.claim_order = nodes.claim_info.total_claimed;
nodes.claim_info.total_claimed += 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 2 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1
<!-- HTML_TAG_START -->2<!-- HTML_TAG_END -->
3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
const a = 1, b=2, c=3;
</script>

{a} {@html b} {c}