marked 15.0.7 → 15.0.9

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.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v15.0.7 - a markdown parser
2
+ * marked v15.0.9 - a markdown parser
3
3
  * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
@@ -549,6 +549,9 @@
549
549
  }
550
550
  }
551
551
  }
552
+ if (level > 0) {
553
+ return -2;
554
+ }
552
555
  return -1;
553
556
  }
554
557
 
@@ -1115,6 +1118,10 @@
1115
1118
  else {
1116
1119
  // find closing parenthesis
1117
1120
  const lastParenIndex = findClosingBracket(cap[2], '()');
1121
+ if (lastParenIndex === -2) {
1122
+ // more open parens than closed
1123
+ return;
1124
+ }
1118
1125
  if (lastParenIndex > -1) {
1119
1126
  const start = cap[0].indexOf('!') === 0 ? 5 : 4;
1120
1127
  const linkLen = start + cap[1].length + lastParenIndex;
@@ -1619,14 +1626,14 @@
1619
1626
  }
1620
1627
  }
1621
1628
  }
1622
- // Mask out other blocks
1623
- while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
1624
- maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1625
- }
1626
1629
  // Mask out escaped characters
1627
1630
  while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
1628
1631
  maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1629
1632
  }
1633
+ // Mask out other blocks
1634
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
1635
+ maskedSrc = maskedSrc.slice(0, match.index) + '[' + 'a'.repeat(match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1636
+ }
1630
1637
  let keepPrevChar = false;
1631
1638
  let prevChar = '';
1632
1639
  while (src) {