diff options
author | Oleg Kalandarashvili <V1RTUOZ@users.noreply.github.com> | 2015-03-17 14:08:36 +0300 |
---|---|---|
committer | Oleg Kalandarashvili <V1RTUOZ@users.noreply.github.com> | 2015-03-17 14:08:36 +0300 |
commit | 657694df38b2ae35a11bcf4f8f2f7d42ce1dfb69 (patch) | |
tree | 3d3acba346802a7303e4a9ec7386482396bc99b4 /app | |
parent | 620c00433a79c8b60cb8c62625c34f53531a8244 (diff) |
htmlentities method added (for #533)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascripts/common.js | 11 |
1 files changed, 11 insertions, 0 deletions
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 $('<div/>').text(s + '').html(); + }; + /** |