From 5180f2108777b50aefebdf0167b0a1c605bb784e Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Tue, 29 May 2012 16:52:18 -0700 Subject: Use a less wasteful escapeHtml function --- lib/utils.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') 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, ">"); }, /** * Generates a unique ID -- cgit v1.2.3