marked 11.2.0 → 12.0.1
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 +11 -6
- package/lib/marked.cjs.map +1 -1
- package/lib/marked.d.cts +21 -2
- package/lib/marked.d.ts +21 -2
- package/lib/marked.esm.js +11 -6
- package/lib/marked.esm.js.map +1 -1
- package/lib/marked.umd.js +11 -6
- package/lib/marked.umd.js.map +1 -1
- package/man/marked.1 +1 -1
- package/marked.min.js +2 -2
- package/package.json +14 -14
package/lib/marked.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* marked
|
|
2
|
+
* marked v12.0.1 - a markdown parser
|
|
3
3
|
* Copyright (c) 2011-2024, Christopher Jeffrey. (MIT Licensed)
|
|
4
4
|
* https://github.com/markedjs/marked
|
|
5
5
|
*/
|
|
@@ -918,8 +918,13 @@ const fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\
|
|
|
918
918
|
const hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
919
919
|
const heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
920
920
|
const bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
921
|
-
const lheading = edit(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/)
|
|
921
|
+
const lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/)
|
|
922
922
|
.replace(/bull/g, bullet) // lists can interrupt
|
|
923
|
+
.replace(/blockCode/g, / {4}/) // indented code blocks can interrupt
|
|
924
|
+
.replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt
|
|
925
|
+
.replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt
|
|
926
|
+
.replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt
|
|
927
|
+
.replace(/html/g, / {0,3}<[^\n>]+>\n/) // block html can interrupt
|
|
923
928
|
.getRegex();
|
|
924
929
|
const _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
925
930
|
const blockText = /^[^\n]+/;
|
|
@@ -935,9 +940,9 @@ const _tag = 'address|article|aside|base|basefont|blockquote|body|caption'
|
|
|
935
940
|
+ '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
|
|
936
941
|
+ '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
|
|
937
942
|
+ '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
|
|
938
|
-
+ '|p|param|section|
|
|
939
|
-
+ '|track|ul';
|
|
940
|
-
const _comment = /<!--(
|
|
943
|
+
+ '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'
|
|
944
|
+
+ '|tr|track|ul';
|
|
945
|
+
const _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
941
946
|
const html = edit('^ {0,3}(?:' // optional indentation
|
|
942
947
|
+ '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
|
|
943
948
|
+ '|comment[^\\n]*(\\n+|$)' // (2)
|
|
@@ -1052,7 +1057,7 @@ const inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
|
1052
1057
|
const br = /^( {2,}|\\)\n(?!\s*$)/;
|
|
1053
1058
|
const inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
1054
1059
|
// list of unicode punctuation marks, plus any missing characters from CommonMark spec
|
|
1055
|
-
const _punctuation = '\\p{P}
|
|
1060
|
+
const _punctuation = '\\p{P}\\p{S}';
|
|
1056
1061
|
const punctuation = edit(/^((?![*_])[\spunctuation])/, 'u')
|
|
1057
1062
|
.replace(/punctuation/g, _punctuation).getRegex();
|
|
1058
1063
|
// sequences em should skip over [title](link), `code`, <html>
|