From 1ac63e5ca4b8bb38fc0f27080c67fd111933c5dd Mon Sep 17 00:00:00 2001 From: Bryan Terce Date: Thu, 20 Jun 2019 01:34:17 -0700 Subject: [PATCH] Prevent trim at EachBlock boundary --- src/compiler/compile/render-dom/wrappers/Fragment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/compile/render-dom/wrappers/Fragment.ts b/src/compiler/compile/render-dom/wrappers/Fragment.ts index f2e2ab7a7a..97718e95fa 100644 --- a/src/compiler/compile/render-dom/wrappers/Fragment.ts +++ b/src/compiler/compile/render-dom/wrappers/Fragment.ts @@ -85,7 +85,7 @@ export default class FragmentWrapper { if (this.nodes.length === 0) { const should_trim = ( // @ts-ignore todo: probably error, should it be next_sibling.node.data? - next_sibling ? (next_sibling.node.type === 'Text' && /^\s/.test(next_sibling.data)) : !child.has_ancestor('EachBlock') + next_sibling ? (next_sibling.node.type === 'Text' && /^\s/.test(next_sibling.data) && next_sibling.node.find_nearest(/EachBlock/) === child.find_nearest(/EachBlock/)) : !child.has_ancestor('EachBlock') ); if (should_trim) {