preserve whitespace inside lists

pull/1637/head
Rich Harris 6 years ago
parent b3f009122b
commit 28e145e96d

@ -9,10 +9,8 @@ const elementsWithoutText = new Set([
'audio', 'audio',
'datalist', 'datalist',
'dl', 'dl',
'ol',
'optgroup', 'optgroup',
'select', 'select',
'ul',
'video', 'video',
]); ]);
@ -39,8 +37,6 @@ export default class Text extends Node {
} }
init(block: Block) { init(block: Block) {
const parentElement = this.findNearest(/(?:Element|Component)/);
if (shouldSkip(this)) { if (shouldSkip(this)) {
this.shouldSkip = true; this.shouldSkip = true;
return; return;

@ -0,0 +1,22 @@
export default {
data: {
// so it doesn't use innerHTML
one: 'one',
two: 'two',
three: 'three'
},
html: `
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
`,
test(assert, component, target) {
const ul = target.querySelector('ul');
assert.equal(ul.childNodes.length, 5);
},
};

@ -0,0 +1,5 @@
<ul>
<li>{one}</li>
<li>{two}</li>
<li>{three}</li>
</ul>
Loading…
Cancel
Save