marked 15.0.8 → 15.0.10
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 +10 -3
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.esm.js +10 -3
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +10 -3
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +4 -4
package/lib/marked.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked v15.0.
|
|
2
|
+
* marked v15.0.10 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -333,9 +333,9 @@ const tag = edit('^comment'
|
|
|
333
333
|
.replace('attribute', /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/)
|
|
334
334
|
.getRegex();
|
|
335
335
|
const _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
|
|
336
|
-
const link = edit(/^!?\[(label)\]\(\s*(href)(?:\
|
|
336
|
+
const link = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/)
|
|
337
337
|
.replace('label', _inlineLabel)
|
|
338
|
-
.replace('href', /<(?:\\.|[^\n<>\\])+>|[
|
|
338
|
+
.replace('href', /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/)
|
|
339
339
|
.replace('title', /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/)
|
|
340
340
|
.getRegex();
|
|
341
341
|
const reflink = edit(/^!?\[(label)\]\[(ref)\]/)
|
|
@@ -545,6 +545,9 @@ function findClosingBracket(str, b) {
|
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
+
if (level > 0) {
|
|
549
|
+
return -2;
|
|
550
|
+
}
|
|
548
551
|
return -1;
|
|
549
552
|
}
|
|
550
553
|
|
|
@@ -1111,6 +1114,10 @@ class _Tokenizer {
|
|
|
1111
1114
|
else {
|
|
1112
1115
|
// find closing parenthesis
|
|
1113
1116
|
const lastParenIndex = findClosingBracket(cap[2], '()');
|
|
1117
|
+
if (lastParenIndex === -2) {
|
|
1118
|
+
// more open parens than closed
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1114
1121
|
if (lastParenIndex > -1) {
|
|
1115
1122
|
const start = cap[0].indexOf('!') === 0 ? 5 : 4;
|
|
1116
1123
|
const linkLen = start + cap[1].length + lastParenIndex;
|