Port escapeHtml method to string utility module.
This commit is contained in:
parent
d333869952
commit
1986438357
1 changed files with 17 additions and 1 deletions
|
@ -18,6 +18,8 @@ window.App.Utils.String = (function () {
|
||||||
/**
|
/**
|
||||||
* Upper case the first letter of the provided string.
|
* Upper case the first letter of the provided string.
|
||||||
*
|
*
|
||||||
|
* Old Name: GeneralFunctions.upperCaseFirstLetter
|
||||||
|
*
|
||||||
* @param {String} value
|
* @param {String} value
|
||||||
*
|
*
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
|
@ -26,7 +28,21 @@ window.App.Utils.String = (function () {
|
||||||
return value.charAt(0).toUpperCase() + value.slice(1);
|
return value.charAt(0).toUpperCase() + value.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escape HTML content with the use of jQuery.
|
||||||
|
*
|
||||||
|
* Old Name: GeneralFunctions.escapeHtml
|
||||||
|
*
|
||||||
|
* @param {String} content
|
||||||
|
*
|
||||||
|
* @return {String}
|
||||||
|
*/
|
||||||
|
function escapeHtml(content) {
|
||||||
|
return $('<div/>').text(content).html();
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
upperCaseFirstLetter
|
upperCaseFirstLetter,
|
||||||
|
escapeHtml
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue