# HG changeset patch # User Nicholas Jillings # Date 1484840973 0 # Node ID dc08127a5084d9ea842a657be1c2e7148d996ae5 # Parent 130ae66c3b25d4d3aaf668fe99665676e55d0cfd #9: Use DOMParser to conver HTML string to DOM for injection diff -r 130ae66c3b25 -r dc08127a5084 js/core.js --- a/js/core.js Thu Jan 19 15:46:17 2017 +0000 +++ b/js/core.js Thu Jan 19 15:49:33 2017 +0000 @@ -635,9 +635,10 @@ this.postNode = function () { // This will take the node from the popupOptions and display it var node = this.popupOptions[this.currentIndex], - converter = new showdown.Converter(); + converter = new showdown.Converter(), + p = new DOMParser(); this.popupResponse.innerHTML = ""; - this.popupTitle = converter.makeHtml(node.specification.statement); + this.popupTitle = p.parseFromString(converter.makeHtml(node.specification.statement), "text/html").getElementsByTagName("body")[0].firstElementChild; if (node.specification.type == 'question') { var textArea = document.createElement('textarea'); switch (node.specification.boxsize) {