fix(compiler-core): allow spaces between if-else branches (#2305)

fix #2299
This commit is contained in:
ᴜɴвʏтᴇ
2020-10-08 08:57:17 +08:00
committed by GitHub
parent 25d53f09bb
commit 89c5909a6f
2 changed files with 31 additions and 0 deletions

View File

@@ -130,6 +130,16 @@ export function processIf(
comments.unshift(sibling)
continue
}
if (
sibling &&
sibling.type === NodeTypes.TEXT &&
!sibling.content.trim().length
) {
context.removeNode(sibling)
continue
}
if (sibling && sibling.type === NodeTypes.IF) {
// move the node to the if node's branches
context.removeNode()