mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-24 17:03:27 +03:00
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.
|
||||
*
|
||||
* Old Name: GeneralFunctions.upperCaseFirstLetter
|
||||
*
|
||||
* @param {String} value
|
||||
*
|
||||
* @returns {string}
|
||||
|
@ -26,7 +28,21 @@ window.App.Utils.String = (function () {
|
|||
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 {
|
||||
upperCaseFirstLetter
|
||||
upperCaseFirstLetter,
|
||||
escapeHtml
|
||||
};
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue