mirror of https://github.com/sveltejs/svelte
preserve whitespace at each block boundaries (#713)
parent
5d51d50613
commit
fee4d351e1
@ -0,0 +1,16 @@
|
||||
const message = "the quick brown fox jumps over the lazy dog";
|
||||
const expected = [...message].map(c => `<span>${c + " "}</span>`).join("");
|
||||
|
||||
export default {
|
||||
props: {
|
||||
message
|
||||
},
|
||||
|
||||
async test({ assert, target }) {
|
||||
const firstSpanList = target.children[0];
|
||||
assert.equal(firstSpanList.innerHTML, expected);
|
||||
|
||||
const secondSpanList = target.children[1];
|
||||
assert.equal(secondSpanList.innerHTML, expected);
|
||||
}
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
let message = "the quick brown fox jumps over the lazy dog"
|
||||
</script>
|
||||
|
||||
<div id="first">
|
||||
{#each message as char}
|
||||
<span>{char} </span>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div id="second">{#each message as char}<span>{char} </span>{/each}</div>
|
Loading…
Reference in new issue