aboutsummaryrefslogtreecommitdiff
path: root/js/Utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Utils.js')
-rw-r--r--js/Utils.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/Utils.js b/js/Utils.js
index 9094ca4f..e031c78a 100644
--- a/js/Utils.js
+++ b/js/Utils.js
@@ -130,3 +130,13 @@ function parseDateStringOrRestoreHeightAsInteger(value) {
}
return restoreHeight;
}
+
+function htmlEscape(s) {
+ if (s === null || s === undefined)
+ return "";
+ return String(s)
+ .replace(/&/g, "&")
+ .replace(/</g, "&lt;")
+ .replace(/>/g, "&gt;")
+ .replace(/"/g, "&quot;");
+}