diff --git a/handlers/image.js b/handlers/image.js index 7bdeab0..09962d0 100644 --- a/handlers/image.js +++ b/handlers/image.js @@ -26,11 +26,11 @@ module.exports = browser => async (req, res) => { filter: n => { // %[00 -> 19] cause failures if ( - n.innerText && n.innerText.match(/%[0-1][0-9]/) && + n.innerText && n.innerText.match(/%\S\S/) && n.className && n.className.startsWith('cm-') // is CodeMirror primitive string ) { - n.innerText = n.innerText.replace('%', '%25') + n.innerText = encodeURIComponent(n.innerText) } if (n.className) { return String(n.className).indexOf('eliminateOnRender') < 0