Skip to content

Commit

Permalink
🗜️ build [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkedJS bot committed May 2, 2022
1 parent 9c10b4d commit 6a3ffa2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 30 deletions.
24 changes: 15 additions & 9 deletions lib/marked.cjs
Expand Up @@ -416,15 +416,15 @@ function outputLink(cap, link, raw, lexer) {
};
lexer.state.inLink = false;
return token;
} else {
return {
type: 'image',
raw: raw,
href: href,
title: title,
text: escape(text)
};
}

return {
type: 'image',
raw: raw,
href: href,
title: title,
text: escape(text)
};
}

function indentCodeCompensation(raw, text) {
Expand Down Expand Up @@ -620,7 +620,8 @@ var Tokenizer = /*#__PURE__*/function () {
}

if (!endEarly) {
var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])"); // Check if following lines should be included in List Item
var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))");
var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"); // Check if following lines should be included in List Item

while (src) {
rawLine = src.split('\n', 1)[0];
Expand All @@ -633,6 +634,11 @@ var Tokenizer = /*#__PURE__*/function () {

if (nextBulletRegex.test(line)) {
break;
} // Horizontal rule found


if (hrRegex.test(src)) {
break;
}

if (line.search(/[^ ]/) >= indent || !line.trim()) {
Expand Down
27 changes: 16 additions & 11 deletions lib/marked.esm.js
Expand Up @@ -333,15 +333,14 @@ function outputLink(cap, link, raw, lexer) {
};
lexer.state.inLink = false;
return token;
} else {
return {
type: 'image',
raw,
href,
title,
text: escape(text)
};
}
return {
type: 'image',
raw,
href,
title,
text: escape(text)
};
}

function indentCodeCompensation(raw, text) {
Expand Down Expand Up @@ -440,7 +439,7 @@ class Tokenizer {
type: 'heading',
raw: cap[0],
depth: cap[1].length,
text: text,
text,
tokens: []
};
this.lexer.inline(token.text, token.tokens);
Expand Down Expand Up @@ -535,7 +534,8 @@ class Tokenizer {
}

if (!endEarly) {
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])`);
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`);
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);

// Check if following lines should be included in List Item
while (src) {
Expand All @@ -552,6 +552,11 @@ class Tokenizer {
break;
}

// Horizontal rule found
if (hrRegex.test(src)) {
break;
}

if (line.search(/[^ ]/) >= indent || !line.trim()) { // Dedent if possible
itemContents += '\n' + line.slice(indent);
} else if (!blankLine) { // Until blank line, item doesn't need indentation
Expand Down Expand Up @@ -589,7 +594,7 @@ class Tokenizer {

list.items.push({
type: 'list_item',
raw: raw,
raw,
task: !!istask,
checked: ischecked,
loose: false,
Expand Down
24 changes: 15 additions & 9 deletions lib/marked.umd.js
Expand Up @@ -418,15 +418,15 @@
};
lexer.state.inLink = false;
return token;
} else {
return {
type: 'image',
raw: raw,
href: href,
title: title,
text: escape(text)
};
}

return {
type: 'image',
raw: raw,
href: href,
title: title,
text: escape(text)
};
}

function indentCodeCompensation(raw, text) {
Expand Down Expand Up @@ -622,7 +622,8 @@
}

if (!endEarly) {
var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])"); // Check if following lines should be included in List Item
var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))");
var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"); // Check if following lines should be included in List Item

while (src) {
rawLine = src.split('\n', 1)[0];
Expand All @@ -635,6 +636,11 @@

if (nextBulletRegex.test(line)) {
break;
} // Horizontal rule found


if (hrRegex.test(src)) {
break;
}

if (line.search(/[^ ]/) >= indent || !line.trim()) {
Expand Down
2 changes: 1 addition & 1 deletion marked.min.js

Large diffs are not rendered by default.

0 comments on commit 6a3ffa2

Please sign in to comment.