marked 12.0.1 → 12.0.2

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 v12.0.1 - a markdown parser
2
+ * marked v12.0.2 - a markdown parser
3
3
  * Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
@@ -328,7 +328,9 @@
328
328
  blockquote(src) {
329
329
  const cap = this.rules.block.blockquote.exec(src);
330
330
  if (cap) {
331
- const text = rtrim(cap[0].replace(/^ *>[ \t]?/gm, ''), '\n');
331
+ // precede setext continuation with 4 spaces so it isn't a setext
332
+ let text = cap[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, '\n $1');
333
+ text = rtrim(text.replace(/^ *>[ \t]?/gm, ''), '\n');
332
334
  const top = this.lexer.state.top;
333
335
  this.lexer.state.top = true;
334
336
  const tokens = this.lexer.blockTokens(text);
@@ -964,7 +966,7 @@
964
966
  const paragraph = edit(_paragraph)
965
967
  .replace('hr', hr)
966
968
  .replace('heading', ' {0,3}#{1,6}(?:\\s|$)')
967
- .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
969
+ .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs
968
970
  .replace('|table', '')
969
971
  .replace('blockquote', ' {0,3}>')
970
972
  .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
@@ -1014,7 +1016,7 @@
1014
1016
  paragraph: edit(_paragraph)
1015
1017
  .replace('hr', hr)
1016
1018
  .replace('heading', ' {0,3}#{1,6}(?:\\s|$)')
1017
- .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
1019
+ .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs
1018
1020
  .replace('table', gfmTable) // interrupt paragraphs with table
1019
1021
  .replace('blockquote', ' {0,3}>')
1020
1022
  .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')