Website/node_modules/lodash/internal/escapeHtmlChar.js
2015-12-02 18:21:44 -05:00

23 lines
453 B
JavaScript

/** Used to map characters to HTML entities. */
var htmlEscapes = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
'`': '&#96;'
};
/**
* Used by `_.escape` to convert characters to HTML entities.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeHtmlChar(chr) {
return htmlEscapes[chr];
}
module.exports = escapeHtmlChar;