marked 15.0.6 → 15.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/marked.cjs +18 -6
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.esm.js +18 -6
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +18 -6
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +12 -9
package/lib/marked.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked v15.0.
|
|
2
|
+
* marked v15.0.8 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -120,13 +120,24 @@
|
|
|
120
120
|
const hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
121
121
|
const heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
122
122
|
const bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
123
|
-
const
|
|
123
|
+
const lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
124
|
+
const lheading = edit(lheadingCore)
|
|
124
125
|
.replace(/bull/g, bullet) // lists can interrupt
|
|
125
126
|
.replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
|
|
126
127
|
.replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
|
|
127
128
|
.replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
|
|
128
129
|
.replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
|
|
129
130
|
.replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
|
|
131
|
+
.replace(/\|table/g, '') // table not in commonmark
|
|
132
|
+
.getRegex();
|
|
133
|
+
const lheadingGfm = edit(lheadingCore)
|
|
134
|
+
.replace(/bull/g, bullet) // lists can interrupt
|
|
135
|
+
.replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
|
|
136
|
+
.replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
|
|
137
|
+
.replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
|
|
138
|
+
.replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
|
|
139
|
+
.replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
|
|
140
|
+
.replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/) // table can interrupt
|
|
130
141
|
.getRegex();
|
|
131
142
|
const _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
132
143
|
const blockText = /^[^\n]+/;
|
|
@@ -208,6 +219,7 @@
|
|
|
208
219
|
.getRegex();
|
|
209
220
|
const blockGfm = {
|
|
210
221
|
...blockNormal,
|
|
222
|
+
lheading: lheadingGfm,
|
|
211
223
|
table: gfmTable,
|
|
212
224
|
paragraph: edit(_paragraph)
|
|
213
225
|
.replace('hr', hr)
|
|
@@ -1607,14 +1619,14 @@
|
|
|
1607
1619
|
}
|
|
1608
1620
|
}
|
|
1609
1621
|
}
|
|
1610
|
-
// Mask out other blocks
|
|
1611
|
-
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
|
|
1612
|
-
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1613
|
-
}
|
|
1614
1622
|
// Mask out escaped characters
|
|
1615
1623
|
while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
|
|
1616
1624
|
maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
1617
1625
|
}
|
|
1626
|
+
// Mask out other blocks
|
|
1627
|
+
while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
|
|
1628
|
+
maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1629
|
+
}
|
|
1618
1630
|
let keepPrevChar = false;
|
|
1619
1631
|
let prevChar = '';
|
|
1620
1632
|
while (src) {
|