marked 15.0.5 → 15.0.7

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.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v15.0.5 - a markdown parser
2
+ * marked v15.0.7 - a markdown parser
3
3
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
@@ -114,13 +114,24 @@ const fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\
114
114
  const hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
115
115
  const heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
116
116
  const bullet = /(?:[*+-]|\d{1,9}[.)])/;
117
- const lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/)
117
+ const lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
118
+ const lheading = edit(lheadingCore)
118
119
  .replace(/bull/g, bullet) // lists can interrupt
119
120
  .replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
120
121
  .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
121
122
  .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
122
123
  .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
123
124
  .replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
125
+ .replace(/\|table/g, '') // table not in commonmark
126
+ .getRegex();
127
+ const lheadingGfm = edit(lheadingCore)
128
+ .replace(/bull/g, bullet) // lists can interrupt
129
+ .replace(/blockCode/g, /(?: {4}| {0,3}\t)/) // indented code blocks can interrupt
130
+ .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
131
+ .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
132
+ .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
133
+ .replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
134
+ .replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/) // table can interrupt
124
135
  .getRegex();
125
136
  const _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
126
137
  const blockText = /^[^\n]+/;
@@ -202,6 +213,7 @@ const gfmTable = edit('^ *([^\\n ].*)\\n' // Header
202
213
  .getRegex();
203
214
  const blockGfm = {
204
215
  ...blockNormal,
216
+ lheading: lheadingGfm,
205
217
  table: gfmTable,
206
218
  paragraph: edit(_paragraph)
207
219
  .replace('hr', hr)
@@ -264,9 +276,13 @@ const _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
264
276
  const _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
265
277
  // sequences em should skip over [title](link), `code`, <html>
266
278
  const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
267
- const emStrongLDelim = edit(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, 'u')
279
+ const emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
280
+ const emStrongLDelim = edit(emStrongLDelimCore, 'u')
268
281
  .replace(/punct/g, _punctuation)
269
282
  .getRegex();
283
+ const emStrongLDelimGfm = edit(emStrongLDelimCore, 'u')
284
+ .replace(/punct/g, _punctuationGfmStrongEm)
285
+ .getRegex();
270
286
  const emStrongRDelimAstCore = '^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)' // Skip orphan inside strong
271
287
  + '|[^*]+(?=[^*])' // Consume to delim
272
288
  + '|(?!\\*)punct(\\*+)(?=[\\s]|$)' // (1) #*** can only be a Right Delimiter
@@ -373,6 +389,7 @@ const inlinePedantic = {
373
389
  const inlineGfm = {
374
390
  ...inlineNormal,
375
391
  emStrongRDelimAst: emStrongRDelimAstGfm,
392
+ emStrongLDelim: emStrongLDelimGfm,
376
393
  url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, 'i')
377
394
  .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)
378
395
  .getRegex(),
@@ -498,7 +515,7 @@ function rtrim(str, c, invert) {
498
515
  // Step left until we fail to match the invert condition.
499
516
  while (suffLen < l) {
500
517
  const currChar = str.charAt(l - suffLen - 1);
501
- if (currChar === c && !invert) {
518
+ if (currChar === c && true) {
502
519
  suffLen++;
503
520
  }
504
521
  else {