|
|
@ -84,7 +84,9 @@ function replaceEntityPattern(match, name) { |
|
|
|
|
|
|
|
if (has(entities, name)) { |
|
|
|
return entities[name]; |
|
|
|
} else if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { |
|
|
|
} |
|
|
|
|
|
|
|
if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { |
|
|
|
code = name[1].toLowerCase() === 'x' ? |
|
|
|
parseInt(name.slice(2), 16) |
|
|
|
: |
|
|
@ -93,14 +95,15 @@ function replaceEntityPattern(match, name) { |
|
|
|
return fromCodePoint(code); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return match; |
|
|
|
} |
|
|
|
|
|
|
|
function replaceEntities(str) { |
|
|
|
/*function replaceEntities(str) { |
|
|
|
if (str.indexOf('&') < 0) { return str; } |
|
|
|
|
|
|
|
return str.replace(ENTITY_RE, replaceEntityPattern); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
function unescapeMd(str) { |
|
|
|
if (str.indexOf('\\') < 0) { return str; } |
|
|
@ -252,7 +255,7 @@ exports.unescapeMd = unescapeMd; |
|
|
|
exports.unescapeAll = unescapeAll; |
|
|
|
exports.isValidEntityCode = isValidEntityCode; |
|
|
|
exports.fromCodePoint = fromCodePoint; |
|
|
|
exports.replaceEntities = replaceEntities; |
|
|
|
// exports.replaceEntities = replaceEntities;
|
|
|
|
exports.escapeHtml = escapeHtml; |
|
|
|
exports.arrayReplaceAt = arrayReplaceAt; |
|
|
|
exports.isWhiteSpace = isWhiteSpace; |
|
|
|