From e2e8e342d206fd66f99a4efaebba096111210af3 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Mon, 6 Aug 2018 15:09:26 -0700 Subject: [PATCH] sync up dom-to-image filter w/ custom one for Safari --- handlers/image.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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