fix claim_text (#6275)

pull/6287/head
Tan Li Hau 4 years ago committed by GitHub
parent b3a642c3d3
commit 94bfeae5d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -216,7 +216,7 @@ export function claim_text(nodes, data) {
const node = nodes[i];
if (node.nodeType === 3) {
node.data = '' + data;
return nodes.shift();
return nodes.splice(i, 1)[0];
}
}

@ -0,0 +1,5 @@
<svelte:head>
<title>Title</title>
</svelte:head>
<main>There should be one</main>

@ -0,0 +1,2 @@
<p>This <code>p</code> and the <code>slot</code> below are direct children of the root.</p>
<slot />

@ -0,0 +1,3 @@
<p>This <code>p</code> and the <code>slot</code> below are direct children of the root.</p>
<main>There should be one</main>

@ -0,0 +1,5 @@
<p>This <code>p</code> and the <code>slot</code> below are direct children of the root.</p>
<main>There should be one</main>
<!-- need extra space after <main> -->

@ -0,0 +1,8 @@
<script>
import Layout from './Layout.svelte';
import Component from './Component.svelte';
</script>
<Layout>
<Component />
</Layout>
Loading…
Cancel
Save