|
@ -252,7 +252,7 @@ export function parse ( |
|
|
} |
|
|
} |
|
|
const children = currentParent.children |
|
|
const children = currentParent.children |
|
|
text = inPre || text.trim() |
|
|
text = inPre || text.trim() |
|
|
? decodeHTMLCached(text) |
|
|
? isTextTag(currentParent) ? text : decodeHTMLCached(text) |
|
|
// only preserve whitespace if its not right after a starting tag
|
|
|
// only preserve whitespace if its not right after a starting tag
|
|
|
: preserveWhitespace && children.length ? ' ' : '' |
|
|
: preserveWhitespace && children.length ? ' ' : '' |
|
|
if (text) { |
|
|
if (text) { |
|
@ -544,6 +544,11 @@ function makeAttrsMap (attrs: Array<Object>): Object { |
|
|
return map |
|
|
return map |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// for script (e.g. type="x/template") or style, do not decode content
|
|
|
|
|
|
function isTextTag (el): boolean { |
|
|
|
|
|
return el.tag === 'script' || el.tag === 'style' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function isForbiddenTag (el): boolean { |
|
|
function isForbiddenTag (el): boolean { |
|
|
return ( |
|
|
return ( |
|
|
el.tag === 'style' || |
|
|
el.tag === 'style' || |
|
|