_unescapeHtmlChar.js 493 B

123456789101112131415161718192021
  1. var basePropertyOf = require('./_basePropertyOf');
  2. /** Used to map HTML entities to characters. */
  3. var htmlUnescapes = {
  4. '&': '&',
  5. '&lt;': '<',
  6. '&gt;': '>',
  7. '&quot;': '"',
  8. '&#39;': "'"
  9. };
  10. /**
  11. * Used by `_.unescape` to convert HTML entities to characters.
  12. *
  13. * @private
  14. * @param {string} chr The matched character to unescape.
  15. * @returns {string} Returns the unescaped character.
  16. */
  17. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  18. module.exports = unescapeHtmlChar;