fix(compiler): should not condense  

fix #945
This commit is contained in:
Evan You
2020-04-08 17:33:07 -04:00
parent be666ebd59
commit 8c17535a47
3 changed files with 16 additions and 4 deletions

View File

@@ -194,7 +194,7 @@ function parseChildren(
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i]
if (node.type === NodeTypes.TEXT) {
if (!node.content.trim()) {
if (!/[^\t\r\n\f ]/.test(node.content)) {
const prev = nodes[i - 1]
const next = nodes[i + 1]
// If:
@@ -219,7 +219,7 @@ function parseChildren(
node.content = ' '
}
} else {
node.content = node.content.replace(/\s+/g, ' ')
node.content = node.content.replace(/[\t\r\n\f ]+/g, ' ')
}
}
}