🗜️ build [skip ci]

This commit is contained in:
MarkedJS bot 2020-10-21 14:57:55 +00:00
parent 27070705d3
commit 2cf0421112
3 changed files with 47 additions and 7 deletions

View File

@ -281,6 +281,22 @@ function checkSanitizeDeprecation(opt) {
}
}
// copied from https://stackoverflow.com/a/5450113/806777
function repeatString(pattern, count) {
if (count < 1) {
return '';
}
let result = '';
while (count > 1) {
if (count & 1) {
result += pattern;
}
count >>= 1;
pattern += pattern;
}
return result + pattern;
}
var helpers = {
escape,
unescape,
@ -292,7 +308,8 @@ var helpers = {
splitCells,
rtrim,
findClosingBracket,
checkSanitizeDeprecation
checkSanitizeDeprecation,
repeatString
};
const { defaults: defaults$1 } = defaults;
@ -1297,6 +1314,7 @@ var rules = {
const { defaults: defaults$2 } = defaults;
const { block: block$1, inline: inline$1 } = rules;
const { repeatString: repeatString$1 } = helpers;
/**
* smartypants text replacement
@ -1633,14 +1651,14 @@ var Lexer_1 = class Lexer {
if (links.length > 0) {
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
}
}
}
}
// Mask out other blocks
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
}
while (src) {

View File

@ -370,6 +370,26 @@
if (opt && opt.sanitize && !opt.silent) {
console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
}
} // copied from https://stackoverflow.com/a/5450113/806777
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;
}
var helpers = {
@ -383,7 +403,8 @@
splitCells: splitCells,
rtrim: rtrim,
findClosingBracket: findClosingBracket,
checkSanitizeDeprecation: checkSanitizeDeprecation
checkSanitizeDeprecation: checkSanitizeDeprecation,
repeatString: repeatString
};
var defaults$1 = defaults.defaults;
@ -1288,6 +1309,7 @@
var defaults$2 = defaults.defaults;
var block$1 = rules.block,
inline$1 = rules.inline;
var repeatString$1 = helpers.repeatString;
/**
* smartypants text replacement
*/
@ -1658,7 +1680,7 @@
if (links.length > 0) {
while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
}
}
}
@ -1666,7 +1688,7 @@
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
}
while (src) {

2
marked.min.js vendored

File diff suppressed because one or more lines are too long