From 29072fce9209bb553585543f057df0784a2e95a8 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Fri, 3 May 2019 10:02:41 -0700 Subject: [PATCH] fix issue from encoding breaking html highlighting after save Closes #749 --- components/Editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Editor.js b/components/Editor.js index 49dec64..0b2be6d 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -137,14 +137,14 @@ class Editor extends React.Component { const map = new Map() const undoMap = value => { - map.forEach((value, node) => (node.innerText = value)) + map.forEach((value, node) => (node.innerHTML = value)) return value } if (isPNG) { node.querySelectorAll('span[role="presentation"]').forEach(node => { if (node.innerText && node.innerText.match(/%[A-Za-z0-9]{2}/)) { - map.set(node, node.innerText) + map.set(node, node.innerHTML) node.innerText.match(/%[A-Za-z0-9]{2}/g).forEach(t => { node.innerText = node.innerText.replace(t, encodeURIComponent(t)) })