mirror of https://github.com/sveltejs/svelte
do not collapse whitespace containing nbsp (#3014)
parent
ac185052a5
commit
be783c5c67
@ -0,0 +1,19 @@
|
|||||||
|
export default {
|
||||||
|
html: `<div> hello</div>
|
||||||
|
<div> hello </div>
|
||||||
|
<div> hello hello</div>`,
|
||||||
|
|
||||||
|
test({ assert, component, target }) {
|
||||||
|
var divList = target.querySelectorAll('div')
|
||||||
|
assert.equal( divList[0].textContent.charCodeAt( 0 ), 160 );
|
||||||
|
assert.equal( divList[1].textContent.charCodeAt( 0 ), 160 );
|
||||||
|
assert.equal( divList[1].textContent.charCodeAt( 6 ), 160 );
|
||||||
|
assert.equal( divList[1].textContent.charCodeAt( 7 ), 160 );
|
||||||
|
assert.equal( divList[2].textContent.charCodeAt( 0 ), 160 );
|
||||||
|
assert.equal( divList[2].textContent.charCodeAt( 6 ), 160 );
|
||||||
|
assert.equal( divList[2].textContent.charCodeAt( 7 ), 32 );//normal space
|
||||||
|
assert.equal( divList[2].textContent.charCodeAt( 8 ), 160 );
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
let name = 'hello';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div> {name}</div>
|
||||||
|
<div> {name} </div>
|
||||||
|
<div> {name} {name}</div>
|
Loading…
Reference in new issue