According to issue #177 we need only tags to be escaped, but not other special characters, not to be escaped twice
This commit is contained in:
parent
ae7429fb28
commit
c3fbb1fcbc
7
util.js
7
util.js
|
@ -44,6 +44,13 @@ var Util = (function (my) {
|
|||
* Escapes the given text.
|
||||
*/
|
||||
my.escapeHtml = function (unsafeText) {
|
||||
return $('<div/>').text(unsafeText).html();
|
||||
};
|
||||
|
||||
/**
|
||||
* Escapes only tags from the given text.
|
||||
*/
|
||||
my.escapeTags = function (unsafeText) {
|
||||
return unsafeText.replace(/</g, '<').replace(/>/g, '>');
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue