diff --git a/util.js b/util.js index c54425444..daebfd914 100644 --- a/util.js +++ b/util.js @@ -44,6 +44,13 @@ var Util = (function (my) { * Escapes the given text. */ my.escapeHtml = function (unsafeText) { + return $('
').text(unsafeText).html(); + }; + + /** + * Escapes only tags from the given text. + */ + my.escapeTags = function (unsafeText) { return unsafeText.replace(//g, '>'); };