|
|
@ -278,22 +278,32 @@ function isMdAsciiPunct(ch) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Hepler to unify [reference labels].
|
|
|
|
//
|
|
|
|
function normalizeReference(str) { |
|
|
|
// use .toUpperCase() instead of .toLowerCase()
|
|
|
|
// here to avoid a conflict with Object.prototype
|
|
|
|
// members (most notably, `__proto__`)
|
|
|
|
return str.trim().replace(/\s+/g, ' ').toUpperCase(); |
|
|
|
} |
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
exports.assign = assign; |
|
|
|
exports.isString = isString; |
|
|
|
exports.has = has; |
|
|
|
exports.unescapeMd = unescapeMd; |
|
|
|
exports.isValidEntityCode = isValidEntityCode; |
|
|
|
exports.fromCodePoint = fromCodePoint; |
|
|
|
exports.replaceEntities = replaceEntities; |
|
|
|
exports.escapeHtml = escapeHtml; |
|
|
|
exports.arrayReplaceAt = arrayReplaceAt; |
|
|
|
exports.normalizeLink = normalizeLink; |
|
|
|
exports.isWhiteSpace = isWhiteSpace; |
|
|
|
exports.isMdAsciiPunct = isMdAsciiPunct; |
|
|
|
exports.isPunctChar = isPunctChar; |
|
|
|
exports.escapeRE = escapeRE; |
|
|
|
exports.assign = assign; |
|
|
|
exports.isString = isString; |
|
|
|
exports.has = has; |
|
|
|
exports.unescapeMd = unescapeMd; |
|
|
|
exports.isValidEntityCode = isValidEntityCode; |
|
|
|
exports.fromCodePoint = fromCodePoint; |
|
|
|
exports.replaceEntities = replaceEntities; |
|
|
|
exports.escapeHtml = escapeHtml; |
|
|
|
exports.arrayReplaceAt = arrayReplaceAt; |
|
|
|
exports.normalizeLink = normalizeLink; |
|
|
|
exports.isWhiteSpace = isWhiteSpace; |
|
|
|
exports.isMdAsciiPunct = isMdAsciiPunct; |
|
|
|
exports.isPunctChar = isPunctChar; |
|
|
|
exports.escapeRE = escapeRE; |
|
|
|
exports.normalizeReference = normalizeReference; |
|
|
|
|
|
|
|
// for testing only
|
|
|
|
exports.fixBrokenSurrogates = fixBrokenSurrogates; |
|
|
|