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) {
|
htmlEncode: function(string) {
|
||||||
//return _.escape(string);
|
return !!_ ? _.escape(string) :
|
||||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
|
||||||
},
|
},
|
||||||
|
|
||||||
htmlDecode: function(string) {
|
htmlDecode: function(string) {
|
||||||
|
|
Loading…
Reference in a new issue