diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index a8b542053b..972b1ff537 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -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); diff --git a/test/hydration/samples/raw-with-empty-line-at-top/_after.html b/test/hydration/samples/raw-with-empty-line-at-top/_after.html new file mode 100644 index 0000000000..28ee6452d3 --- /dev/null +++ b/test/hydration/samples/raw-with-empty-line-at-top/_after.html @@ -0,0 +1,6 @@ + +