|
|
@ -71,10 +71,12 @@ function fromCodePoint(c) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; |
|
|
|
var NAMED_ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; |
|
|
|
var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; |
|
|
|
var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; |
|
|
|
var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); |
|
|
|
|
|
|
|
var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; |
|
|
|
var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + NAMED_ENTITY_RE.source, 'gi'); |
|
|
|
|
|
|
|
var entities = require('./entities'); |
|
|
|
|
|
|
|
function replaceEntityPattern(match, name) { |
|
|
@ -97,7 +99,7 @@ function replaceEntityPattern(match, name) { |
|
|
|
function replaceEntities(str) { |
|
|
|
if (str.indexOf('&') < 0) { return str; } |
|
|
|
|
|
|
|
return str.replace(NAMED_ENTITY_RE, replaceEntityPattern); |
|
|
|
return str.replace(ENTITY_RE, replaceEntityPattern); |
|
|
|
} |
|
|
|
|
|
|
|
function unescapeMd(str) { |
|
|
|