diff --git a/src/compiler/compile/render_dom/wrappers/Fragment.ts b/src/compiler/compile/render_dom/wrappers/Fragment.ts index de77dfc7c5..9413919c89 100644 --- a/src/compiler/compile/render_dom/wrappers/Fragment.ts +++ b/src/compiler/compile/render_dom/wrappers/Fragment.ts @@ -127,10 +127,9 @@ export default class FragmentWrapper { if (strip_whitespace) { const first = this.nodes[0] as Text; - if (first && first.node.type === 'Text') { - if (!first.node.keep_space()) { - first.data = trim_start(first.data); - } + + if (first && first.node.type === 'Text' && !first.node.keep_space()) { + first.data = trim_start(first.data); if (!first.data) { first.var = null; this.nodes.shift();