only preserve whitespace if it is not right after starting tag

This commit is contained in:
Evan You 2016-04-14 08:59:29 -04:00
parent 8218eae1f9
commit e223b87bd3

View File

@ -112,7 +112,8 @@ export function parse (template, preserveWhitespace) {
}
text = currentParent.tag === 'pre' || text.trim()
? decodeHTML(text)
: preserveWhitespace ? ' ' : null
// only preserve whitespace if its not right after a starting tag
: preserveWhitespace && currentParent.children.length ? ' ' : null
if (text) {
let expression
if (text !== ' ' && (expression = parseText(text))) {