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