diff --git a/app/javascripts/common.js b/app/javascripts/common.js index 58746044..8f58bfd4 100644 --- a/app/javascripts/common.js +++ b/app/javascripts/common.js @@ -894,6 +894,17 @@ var Common = (function () { } }; + + /** + * Convert all applicable characters to HTML entities + * @public + * @param {string} cb + * @return {string} + */ + self.htmlentities = function(s) { + return $('
').text(s + '').html(); + }; + /**