Merge pull request #865 from ONLYOFFICE/feature/fix-utils-html-encode
[common] extend htmlEncode function
This commit is contained in:
commit
0949cce8a8
|
@ -587,8 +587,8 @@ Common.Utils.String = new (function() {
|
|||
},
|
||||
|
||||
htmlEncode: function(string) {
|
||||
//return _.escape(string);
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
return !!_ ? _.escape(string) :
|
||||
string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||
},
|
||||
|
||||
htmlDecode: function(string) {
|
||||
|
|
Loading…
Reference in a new issue