|
|
@ -327,9 +327,8 @@
|
|
|
|
node.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml')
|
|
|
|
node.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml')
|
|
|
|
return new XMLSerializer().serializeToString(node)
|
|
|
|
return new XMLSerializer().serializeToString(node)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then(function (str) {
|
|
|
|
.then(util.escapeXhtml)
|
|
|
|
return util.escapeXhtml(str, escapePercentSign)
|
|
|
|
.then(str => (escapePercentSign ? str.replace(/%/g, '%25') : str))
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(function (xhtml) {
|
|
|
|
.then(function (xhtml) {
|
|
|
|
return '<foreignObject x="0" y="0" width="100%" height="100%">' + xhtml + '</foreignObject>'
|
|
|
|
return '<foreignObject x="0" y="0" width="100%" height="100%">' + xhtml + '</foreignObject>'
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -552,10 +551,7 @@
|
|
|
|
return array
|
|
|
|
return array
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function escapeXhtml(string, escapePercentSign) {
|
|
|
|
function escapeXhtml(string) {
|
|
|
|
if (escapePercentSign) {
|
|
|
|
|
|
|
|
string = string.replace(/%/g, '%25')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return string.replace(/#/g, '%23').replace(/\n/g, '%0A')
|
|
|
|
return string.replace(/#/g, '%23').replace(/\n/g, '%0A')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|