|
@@ -372,26 +372,6 @@ function checkDeprecations(opt, callback) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// copied from https://stackoverflow.com/a/5450113/806777
|
|
|
|
-/**
|
|
|
|
- * @param {string} pattern
|
|
|
|
- * @param {number} count
|
|
|
|
- */
|
|
|
|
-function repeatString(pattern, count) {
|
|
|
|
- if (count < 1) {
|
|
|
|
- return '';
|
|
|
|
- }
|
|
|
|
- var result = '';
|
|
|
|
- while (count > 1) {
|
|
|
|
- if (count & 1) {
|
|
|
|
- result += pattern;
|
|
|
|
- }
|
|
|
|
- count >>= 1;
|
|
|
|
- pattern += pattern;
|
|
|
|
- }
|
|
|
|
- return result + pattern;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function outputLink(cap, link, raw, lexer) {
|
|
function outputLink(cap, link, raw, lexer) {
|
|
var href = link.href;
|
|
var href = link.href;
|
|
var title = link.title ? escape(link.title) : null;
|
|
var title = link.title ? escape(link.title) : null;
|
|
@@ -1649,14 +1629,14 @@ var Lexer = /*#__PURE__*/function () {
|
|
if (links.length > 0) {
|
|
if (links.length > 0) {
|
|
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
|
|
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
|
|
if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
|
|
if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
|
|
- maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
|
|
|
|
|
|
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// Mask out other blocks
|
|
// Mask out other blocks
|
|
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
|
|
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
|
|
- maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
|
|
|
|
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
}
|
|
}
|
|
|
|
|
|
// Mask out escaped em & strong delimiters
|
|
// Mask out escaped em & strong delimiters
|