Skip to content

Commit 94bfeae

Browse files
authored
fix claim_text (#6275)
1 parent b3a642c commit 94bfeae

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

src/runtime/internal/dom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export function claim_text(nodes, data) {
216216
const node = nodes[i];
217217
if (node.nodeType === 3) {
218218
node.data = '' + data;
219-
return nodes.shift();
219+
return nodes.splice(i, 1)[0];
220220
}
221221
}
222222

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<svelte:head>
2+
<title>Title</title>
3+
</svelte:head>
4+
5+
<main>There should be one</main>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<p>This <code>p</code> and the <code>slot</code> below are direct children of the root.</p>
2+
<slot />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>This <code>p</code> and the <code>slot</code> below are direct children of the root.</p>
2+
3+
<main>There should be one</main>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<p>This <code>p</code> and the <code>slot</code> below are direct children of the root.</p>
2+
3+
<main>There should be one</main>
4+
5+
<!-- need extra space after <main> -->
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
import Layout from './Layout.svelte';
3+
import Component from './Component.svelte';
4+
</script>
5+
6+
<Layout>
7+
<Component />
8+
</Layout>

0 commit comments

Comments
 (0)