From 62e7c92cae0cb29bbdf194c56454dc842d5ea852 Mon Sep 17 00:00:00 2001 From: Anton Khodakivskiy Date: Thu, 6 Dec 2012 06:37:56 +0200 Subject: [PATCH] Closes #35. Replaced innerHtml with Ci.nsIParserUtils --- extension/packages/help.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extension/packages/help.coffee b/extension/packages/help.coffee index 2f7da4f..cf2337a 100644 --- a/extension/packages/help.coffee +++ b/extension/packages/help.coffee @@ -10,7 +10,7 @@ showHelp = (document, commandsHelp) -> div.id = CONTAINER_ID div.className = 'VimFxReset' - div.innerHTML = helpDialogHtml(commandsHelp) + div.appendChild parseHTML(document, helpDialogHtml(commandsHelp)) body.appendChild div @@ -21,6 +21,11 @@ showHelp = (document, commandsHelp) -> hideHelp(document) button.addEventListener 'click', clickHandler, false +parseHTML = (doc, html) -> + parser = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils) + flags = parser.SanitizerAllowStyle + return parser.parseFragment(html, flags, false, null, doc.documentElement) + hideHelp = (document) -> if div = document.getElementById CONTAINER_ID div.parentNode.removeChild div -- 2.39.3