marked 9.1.2 → 9.1.4

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/README.md CHANGED
@@ -26,8 +26,8 @@ Our [documentation pages](https://marked.js.org) are also rendered using marked
26
26
 
27
27
  Also read about:
28
28
 
29
- * [Options](https://marked.js.org/#/USING_ADVANCED.md)
30
- * [Extensibility](https://marked.js.org/#/USING_PRO.md)
29
+ * [Options](https://marked.js.org/using_advanced)
30
+ * [Extensibility](https://marked.js.org/using_pro)
31
31
 
32
32
  ## Compatibility
33
33
 
@@ -51,7 +51,7 @@ npm install marked
51
51
 
52
52
  ## Usage
53
53
 
54
- ### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/#/USING_ADVANCED.md#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨
54
+ ### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨
55
55
 
56
56
  ```
57
57
  DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`));
package/lib/marked.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v9.1.2 - a markdown parser
2
+ * marked v9.1.4 - a markdown parser
3
3
  * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
@@ -978,7 +978,7 @@ block.lheading = edit(block.lheading)
978
978
  .getRegex();
979
979
  block.paragraph = edit(block._paragraph)
980
980
  .replace('hr', block.hr)
981
- .replace('heading', ' {0,3}#{1,6} ')
981
+ .replace('heading', ' {0,3}#{1,6}(?:\\s|$)')
982
982
  .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
983
983
  .replace('|table', '')
984
984
  .replace('blockquote', ' {0,3}>')
@@ -1005,7 +1005,7 @@ block.gfm = {
1005
1005
  };
1006
1006
  block.gfm.table = edit(block.gfm.table)
1007
1007
  .replace('hr', block.hr)
1008
- .replace('heading', ' {0,3}#{1,6} ')
1008
+ .replace('heading', ' {0,3}#{1,6}(?:\\s|$)')
1009
1009
  .replace('blockquote', ' {0,3}>')
1010
1010
  .replace('code', ' {4}[^\\n]')
1011
1011
  .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
@@ -1015,7 +1015,7 @@ block.gfm.table = edit(block.gfm.table)
1015
1015
  .getRegex();
1016
1016
  block.gfm.paragraph = edit(block._paragraph)
1017
1017
  .replace('hr', block.hr)
1018
- .replace('heading', ' {0,3}#{1,6} ')
1018
+ .replace('heading', ' {0,3}#{1,6}(?:\\s|$)')
1019
1019
  .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
1020
1020
  .replace('table', block.gfm.table) // interrupt paragraphs with table
1021
1021
  .replace('blockquote', ' {0,3}>')
@@ -1303,7 +1303,7 @@ class _Lexer {
1303
1303
  src = src.substring(token.raw.length);
1304
1304
  if (token.raw.length === 1 && tokens.length > 0) {
1305
1305
  // if there's a single \n as a spacer, it's terminating the last line,
1306
- // so move it there so that we don't get unecessary paragraph tags
1306
+ // so move it there so that we don't get unnecessary paragraph tags
1307
1307
  tokens[tokens.length - 1].raw += '\n';
1308
1308
  }
1309
1309
  else {