marked 15.0.5 → 15.0.6
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 +8 -3
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.esm.js +8 -3
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +8 -3
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +5 -5
package/lib/marked.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked v15.0.
|
|
2
|
+
* marked v15.0.6 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -266,9 +266,13 @@ const _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
|
|
|
266
266
|
const _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
267
267
|
// sequences em should skip over [title](link), `code`, <html>
|
|
268
268
|
const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
|
|
269
|
-
const
|
|
269
|
+
const emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
270
|
+
const emStrongLDelim = edit(emStrongLDelimCore, 'u')
|
|
270
271
|
.replace(/punct/g, _punctuation)
|
|
271
272
|
.getRegex();
|
|
273
|
+
const emStrongLDelimGfm = edit(emStrongLDelimCore, 'u')
|
|
274
|
+
.replace(/punct/g, _punctuationGfmStrongEm)
|
|
275
|
+
.getRegex();
|
|
272
276
|
const emStrongRDelimAstCore = '^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)' // Skip orphan inside strong
|
|
273
277
|
+ '|[^*]+(?=[^*])' // Consume to delim
|
|
274
278
|
+ '|(?!\\*)punct(\\*+)(?=[\\s]|$)' // (1) #*** can only be a Right Delimiter
|
|
@@ -375,6 +379,7 @@ const inlinePedantic = {
|
|
|
375
379
|
const inlineGfm = {
|
|
376
380
|
...inlineNormal,
|
|
377
381
|
emStrongRDelimAst: emStrongRDelimAstGfm,
|
|
382
|
+
emStrongLDelim: emStrongLDelimGfm,
|
|
378
383
|
url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, 'i')
|
|
379
384
|
.replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)
|
|
380
385
|
.getRegex(),
|
|
@@ -500,7 +505,7 @@ function rtrim(str, c, invert) {
|
|
|
500
505
|
// Step left until we fail to match the invert condition.
|
|
501
506
|
while (suffLen < l) {
|
|
502
507
|
const currChar = str.charAt(l - suffLen - 1);
|
|
503
|
-
if (currChar === c &&
|
|
508
|
+
if (currChar === c && true) {
|
|
504
509
|
suffLen++;
|
|
505
510
|
}
|
|
506
511
|
else {
|