diff --git a/frontend/src/Utils.js b/frontend/src/Utils.js index a27aa65..6068ffc 100644 --- a/frontend/src/Utils.js +++ b/frontend/src/Utils.js @@ -1,9 +1,14 @@ // Module App.BlogEntry +function htmlDecode(input) { + var doc = new DOMParser().parseFromString(input, "text/html"); + return doc.documentElement.textContent; +} + exports.mdify = function(id) { var converter = new showdown.Converter() elem = document.getElementById(id); md = elem.innerHTML; - elem.innerHTML = unescape(converter.makeHtml(md)); + elem.innerHTML = htmlDecode(converter.makeHtml(md)); return "done :)"; }