diff options
| -rw-r--r-- | background_page.html | 4 | ||||
| -rw-r--r-- | lib/utils.js | 7 |
2 files changed, 2 insertions, 9 deletions
diff --git a/background_page.html b/background_page.html index 9b5487c3..a1af1396 100644 --- a/background_page.html +++ b/background_page.html @@ -198,7 +198,7 @@ if (showUnboundCommands || commandsToKey[command]) { html.push( "<tr class='vimiumReset " + (advancedCommands.indexOf(command) >= 0 ? "advanced" : "") + "'>", - "<td class='vimiumReset'>", escapeHtml(bindings), "</td>", + "<td class='vimiumReset'>", utils.escapeHtml(bindings), "</td>", "<td class='vimiumReset'>:</td><td class='vimiumReset'>", availableCommands[command].description); if (showCommandNames) @@ -210,8 +210,6 @@ return html.join("\n"); } - function escapeHtml(string) { return string.replace(/</g, "<").replace(/>/g, ">"); } - /* * Fetches the contents of a file bundled with this extension. */ diff --git a/lib/utils.js b/lib/utils.js index ac6f32c3..9db3c91a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -54,12 +54,7 @@ var utils = { return tmp.firstChild; }, - /** Escapes HTML */ - escapeHtml: function(html) { - var tmp = document.createElement("div"); - tmp.textContent = html; - return tmp.innerHTML; - }, + escapeHtml: function(string) { return string.replace(/</g, "<").replace(/>/g, ">"); }, /** * Generates a unique ID |
