mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-30 00:46:29 +01:00
[fix] hydrate correct elements when using @html
(#6946)
This commit is contained in:
parent
26f767e873
commit
895b4c6721
@ -501,7 +501,7 @@ export function claim_html_tag(nodes) {
|
||||
}
|
||||
|
||||
init_claim_info(nodes);
|
||||
const html_tag_nodes = nodes.splice(start_index, end_index + 1);
|
||||
const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);
|
||||
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);
|
||||
|
@ -0,0 +1,6 @@
|
||||
|
||||
<div>before</div>
|
||||
<br>
|
||||
|
||||
<!-- HTML_TAG_START -->a <!-- HTML_TAG_END --><!-- HTML_TAG_START -->b <!-- HTML_TAG_END --><!-- HTML_TAG_START -->c <!-- HTML_TAG_END -->
|
||||
<div>after</div>
|
@ -0,0 +1,6 @@
|
||||
|
||||
<div>before</div>
|
||||
<br>
|
||||
|
||||
<!-- HTML_TAG_START -->a <!-- HTML_TAG_END --><!-- HTML_TAG_START -->b <!-- HTML_TAG_END --><!-- HTML_TAG_START -->c <!-- HTML_TAG_END -->
|
||||
<div>after</div>
|
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
let content = ["a ", "b ", "c "];
|
||||
</script>
|
||||
|
||||
<div>before</div>
|
||||
<br>
|
||||
|
||||
{#each content as c}
|
||||
{@html c}
|
||||
{/each}
|
||||
<div>after</div>
|
Loading…
Reference in New Issue
Block a user