aboutsummaryrefslogtreecommitdiff
path: root/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/util.js b/lib/util.js
index dbefa14..267df9f 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -134,3 +134,9 @@ u.customError = function (name) {
return error
}
}
+
+u.escapeHTML = function (html) {
+ return html.toString('utf8')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+}