aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPhil Crosby2012-05-29 16:52:18 -0700
committerPhil Crosby2012-05-29 16:52:18 -0700
commit5180f2108777b50aefebdf0167b0a1c605bb784e (patch)
tree6e6315c1bd984cdccb9364686994de8d48887283 /lib
parent4f7d314135793bf315304d2663df2144441dc33a (diff)
downloadvimium-5180f2108777b50aefebdf0167b0a1c605bb784e.tar.bz2
Use a less wasteful escapeHtml function
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.js7
1 files changed, 1 insertions, 6 deletions
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, "&lt;").replace(/>/g, "&gt;"); },
/**
* Generates a unique ID