1 | /** Used to map characters to HTML entities. */
|
2 | var htmlEscapes = {
|
3 | '&': '&',
|
4 | '<': '<',
|
5 | '>': '>',
|
6 | '"': '"',
|
7 | "'": ''',
|
8 | '`': '`'
|
9 | };
|
10 |
|
11 | /**
|
12 | * Used by `_.escape` to convert characters to HTML entities.
|
13 | *
|
14 | * @private
|
15 | * @param {string} chr The matched character to escape.
|
16 | * @returns {string} Returns the escaped character.
|
17 | */
|
18 | function escapeHtmlChar(chr) {
|
19 | return htmlEscapes[chr];
|
20 | }
|
21 |
|
22 | export default escapeHtmlChar;
|