Revert "clean up escapePercentSign (#1101)"

Closes #1115
This reverts commit a1375754f9.
main
Mike Fix 4 years ago
parent d4eb52a04a
commit 1628e15544
No known key found for this signature in database
GPG Key ID: 1D85E862314CA79F

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

Loading…
Cancel
Save