Skip to content

Commit 9fb5721

Browse files
author
MarkedJS bot
committed
🗜️ build [skip ci]
1 parent 01c98d1 commit 9fb5721

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

lib/marked.cjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ var Tokenizer = /*#__PURE__*/function () {
622622
if (!endEarly) {
623623
var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))");
624624
var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)");
625-
var fencesBeginRegex = new RegExp("^( {0," + Math.min(3, indent - 1) + "})(```|~~~)"); // Check if following lines should be included in List Item
625+
var fencesBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:```|~~~)");
626+
var headingBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}#"); // Check if following lines should be included in List Item
626627

627628
while (src) {
628629
rawLine = src.split('\n', 1)[0];
@@ -638,7 +639,7 @@ var Tokenizer = /*#__PURE__*/function () {
638639
} // End list item if found start of new heading
639640

640641

641-
if (this.rules.block.heading.test(line)) {
642+
if (headingBeginRegex.test(line)) {
642643
break;
643644
} // End list item if found start of new bullet
644645

lib/marked.esm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ class Tokenizer {
536536
if (!endEarly) {
537537
const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`);
538538
const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);
539-
const fencesBeginRegex = new RegExp(`^( {0,${Math.min(3, indent - 1)}})(\`\`\`|~~~)`);
539+
const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`);
540+
const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`);
540541

541542
// Check if following lines should be included in List Item
542543
while (src) {
@@ -554,7 +555,7 @@ class Tokenizer {
554555
}
555556

556557
// End list item if found start of new heading
557-
if (this.rules.block.heading.test(line)) {
558+
if (headingBeginRegex.test(line)) {
558559
break;
559560
}
560561

lib/marked.umd.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,8 @@
624624
if (!endEarly) {
625625
var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))");
626626
var hrRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)");
627-
var fencesBeginRegex = new RegExp("^( {0," + Math.min(3, indent - 1) + "})(```|~~~)"); // Check if following lines should be included in List Item
627+
var fencesBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:```|~~~)");
628+
var headingBeginRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}#"); // Check if following lines should be included in List Item
628629

629630
while (src) {
630631
rawLine = src.split('\n', 1)[0];
@@ -640,7 +641,7 @@
640641
} // End list item if found start of new heading
641642

642643

643-
if (this.rules.block.heading.test(line)) {
644+
if (headingBeginRegex.test(line)) {
644645
break;
645646
} // End list item if found start of new bullet
646647

marked.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)