@powerlines/plugin-marked 0.1.236 → 0.1.238
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/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/node_modules/.pnpm/{marked@17.0.1 → marked@17.0.2}/node_modules/marked/lib/marked.esm.cjs +185 -159
- package/dist/node_modules/.pnpm/{marked@17.0.1 → marked@17.0.2}/node_modules/marked/lib/marked.esm.mjs +185 -159
- package/dist/node_modules/.pnpm/marked@17.0.2/node_modules/marked/lib/marked.esm.mjs.map +1 -0
- package/package.json +9 -9
- package/dist/node_modules/.pnpm/marked@17.0.1/node_modules/marked/lib/marked.esm.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/marked@17.0.
|
|
1
|
+
//#region ../../node_modules/.pnpm/marked@17.0.2/node_modules/marked/lib/marked.esm.js
|
|
2
2
|
/**
|
|
3
|
-
* marked v17.0.
|
|
4
|
-
* Copyright (c) 2018-
|
|
3
|
+
* marked v17.0.2 - a markdown parser
|
|
4
|
+
* Copyright (c) 2018-2026, MarkedJS. (MIT License)
|
|
5
5
|
* Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|
|
6
6
|
* https://github.com/markedjs/marked
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* DO NOT EDIT THIS FILE
|
|
10
10
|
* The code in this file is generated from files in ./src/
|
|
11
11
|
*/
|
|
12
|
-
function
|
|
12
|
+
function M() {
|
|
13
13
|
return {
|
|
14
14
|
async: !1,
|
|
15
15
|
breaks: !1,
|
|
@@ -23,11 +23,11 @@ function L() {
|
|
|
23
23
|
walkTokens: null
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
var T =
|
|
27
|
-
function
|
|
26
|
+
var T = M();
|
|
27
|
+
function H(u) {
|
|
28
28
|
T = u;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var _ = { exec: () => null };
|
|
31
31
|
function k(u, e = "") {
|
|
32
32
|
let t = typeof u == "string" ? u : u.source, n = {
|
|
33
33
|
replace: (r, i) => {
|
|
@@ -38,7 +38,7 @@ function k(u, e = "") {
|
|
|
38
38
|
};
|
|
39
39
|
return n;
|
|
40
40
|
}
|
|
41
|
-
var
|
|
41
|
+
var Re = (() => {
|
|
42
42
|
try {
|
|
43
43
|
return true;
|
|
44
44
|
} catch {
|
|
@@ -61,7 +61,6 @@ var me = (() => {
|
|
|
61
61
|
blockquoteStart: /^ {0,3}>/,
|
|
62
62
|
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
|
|
63
63
|
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
|
|
64
|
-
listReplaceTabs: /^\t+/,
|
|
65
64
|
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
|
|
66
65
|
listIsTask: /^\[[ xX]\] +\S/,
|
|
67
66
|
listReplaceTask: /^\[[ xX]\] +/,
|
|
@@ -101,92 +100,97 @@ var me = (() => {
|
|
|
101
100
|
hrRegex: (u) => /* @__PURE__ */ new RegExp(`^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
|
|
102
101
|
fencesBeginRegex: (u) => /* @__PURE__ */ new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`),
|
|
103
102
|
headingBeginRegex: (u) => /* @__PURE__ */ new RegExp(`^ {0,${Math.min(3, u - 1)}}#`),
|
|
104
|
-
htmlBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
105
|
-
|
|
103
|
+
htmlBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}<(?:[a-z].*>|!--)`, "i"),
|
|
104
|
+
blockquoteBeginRegex: (u) => /* @__PURE__ */ new RegExp(`^ {0,${Math.min(3, u - 1)}}>`)
|
|
105
|
+
}, Te = /^(?:[ \t]*(?:\n|$))+/, Oe = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, we = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ye = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = / {0,3}(?:[*+-]|\d{1,9}[.)])/, re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Pe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Se = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, $e = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), _e = k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), q = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Le = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), U = {
|
|
106
106
|
blockquote: k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex(),
|
|
107
|
-
code:
|
|
108
|
-
def:
|
|
109
|
-
fences:
|
|
110
|
-
heading:
|
|
107
|
+
code: Oe,
|
|
108
|
+
def: $e,
|
|
109
|
+
fences: we,
|
|
110
|
+
heading: ye,
|
|
111
111
|
hr: I,
|
|
112
|
-
html:
|
|
112
|
+
html: Le,
|
|
113
113
|
lheading: se,
|
|
114
|
-
list:
|
|
115
|
-
newline:
|
|
114
|
+
list: _e,
|
|
115
|
+
newline: Te,
|
|
116
116
|
paragraph: ie,
|
|
117
|
-
table:
|
|
118
|
-
text:
|
|
119
|
-
}, te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",
|
|
117
|
+
table: _,
|
|
118
|
+
text: Se
|
|
119
|
+
}, te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex(), ze = {
|
|
120
120
|
...U,
|
|
121
|
-
lheading:
|
|
121
|
+
lheading: Pe,
|
|
122
122
|
table: te,
|
|
123
|
-
paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",
|
|
124
|
-
},
|
|
123
|
+
paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", q).getRegex()
|
|
124
|
+
}, Ce = {
|
|
125
125
|
...U,
|
|
126
126
|
html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
127
127
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
128
128
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
129
|
-
fences:
|
|
129
|
+
fences: _,
|
|
130
130
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
131
131
|
paragraph: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
|
|
132
132
|
]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
133
|
-
},
|
|
134
|
-
_backpedal:
|
|
135
|
-
anyPunctuation:
|
|
136
|
-
autolink:
|
|
137
|
-
blockSkip:
|
|
133
|
+
}, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ie = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Ee = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, v = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ae = /[^\s\p{P}\p{S}]/u, Be = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), le = /(?!~)[\p{P}\p{S}]/u, De = /(?!~)[\s\p{P}\p{S}]/u, qe = /(?:[^\s\p{P}\p{S}]|~)/u, ue = /(?![*_])[\p{P}\p{S}]/u, ve = /(?![*_])[\s\p{P}\p{S}]/u, Ge = /(?:[^\s\p{P}\p{S}]|[*_])/u, He = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Re ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ze = k(pe, "u").replace(/punct/g, v).getRegex(), Ne = k(pe, "u").replace(/punct/g, le).getRegex(), ce = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Qe = k(ce, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, v).getRegex(), Fe = k(ce, "gu").replace(/notPunctSpace/g, qe).replace(/punctSpace/g, De).replace(/punct/g, le).getRegex(), je = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, v).getRegex(), Ue = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, ue).getRegex(), We = k("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ge).replace(/punctSpace/g, ve).replace(/punct/g, ue).getRegex(), Xe = k(/\\(punct)/, "gu").replace(/punct/g, v).getRegex(), Je = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ve = k(j).replace("(?:-->|$)", "-->").getRegex(), Ye = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ve).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), D = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, et = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", D).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), he = k(/^!?\[(label)\]\[(ref)\]/).replace("label", D).replace("ref", F).getRegex(), ke = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), tt = k("reflink|nolink(?!\\()", "g").replace("reflink", he).replace("nolink", ke).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = {
|
|
134
|
+
_backpedal: _,
|
|
135
|
+
anyPunctuation: Xe,
|
|
136
|
+
autolink: Je,
|
|
137
|
+
blockSkip: He,
|
|
138
138
|
br: oe,
|
|
139
|
-
code:
|
|
140
|
-
del:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
139
|
+
code: Ie,
|
|
140
|
+
del: _,
|
|
141
|
+
delLDelim: _,
|
|
142
|
+
delRDelim: _,
|
|
143
|
+
emStrongLDelim: Ze,
|
|
144
|
+
emStrongRDelimAst: Qe,
|
|
145
|
+
emStrongRDelimUnd: je,
|
|
146
|
+
escape: Ae,
|
|
147
|
+
link: et,
|
|
148
|
+
nolink: ke,
|
|
149
|
+
punctuation: Be,
|
|
150
|
+
reflink: he,
|
|
151
|
+
reflinkSearch: tt,
|
|
152
|
+
tag: Ye,
|
|
153
|
+
text: Ee,
|
|
154
|
+
url: _
|
|
155
|
+
}, nt = {
|
|
154
156
|
...W,
|
|
155
|
-
link: k(/^!?\[(label)\]\((.*?)\)/).replace("label",
|
|
156
|
-
reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",
|
|
157
|
-
},
|
|
157
|
+
link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", D).getRegex(),
|
|
158
|
+
reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", D).getRegex()
|
|
159
|
+
}, Z = {
|
|
158
160
|
...W,
|
|
159
|
-
emStrongRDelimAst:
|
|
160
|
-
emStrongLDelim:
|
|
161
|
+
emStrongRDelimAst: Fe,
|
|
162
|
+
emStrongLDelim: Ne,
|
|
163
|
+
delLDelim: Ue,
|
|
164
|
+
delRDelim: We,
|
|
161
165
|
url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
162
166
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
163
167
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
164
168
|
text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex()
|
|
165
|
-
},
|
|
166
|
-
...
|
|
169
|
+
}, rt = {
|
|
170
|
+
...Z,
|
|
167
171
|
br: k(oe).replace("{2,}", "*").getRegex(),
|
|
168
|
-
text: k(
|
|
172
|
+
text: k(Z.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
169
173
|
}, E = {
|
|
170
174
|
normal: U,
|
|
171
|
-
gfm:
|
|
172
|
-
pedantic:
|
|
173
|
-
},
|
|
175
|
+
gfm: ze,
|
|
176
|
+
pedantic: Ce
|
|
177
|
+
}, z = {
|
|
174
178
|
normal: W,
|
|
175
|
-
gfm:
|
|
176
|
-
breaks:
|
|
177
|
-
pedantic:
|
|
179
|
+
gfm: Z,
|
|
180
|
+
breaks: rt,
|
|
181
|
+
pedantic: nt
|
|
178
182
|
};
|
|
179
|
-
var
|
|
183
|
+
var st = {
|
|
180
184
|
"&": "&",
|
|
181
185
|
"<": "<",
|
|
182
186
|
">": ">",
|
|
183
187
|
"\"": """,
|
|
184
188
|
"'": "'"
|
|
185
|
-
},
|
|
186
|
-
function
|
|
189
|
+
}, de = (u) => st[u];
|
|
190
|
+
function O(u, e) {
|
|
187
191
|
if (e) {
|
|
188
|
-
if (m.escapeTest.test(u)) return u.replace(m.escapeReplace,
|
|
189
|
-
} else if (m.escapeTestNoEncode.test(u)) return u.replace(m.escapeReplaceNoEncode,
|
|
192
|
+
if (m.escapeTest.test(u)) return u.replace(m.escapeReplace, de);
|
|
193
|
+
} else if (m.escapeTestNoEncode.test(u)) return u.replace(m.escapeReplaceNoEncode, de);
|
|
190
194
|
return u;
|
|
191
195
|
}
|
|
192
196
|
function X(u) {
|
|
@@ -208,7 +212,7 @@ function J(u, e) {
|
|
|
208
212
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
209
213
|
return n;
|
|
210
214
|
}
|
|
211
|
-
function
|
|
215
|
+
function C(u, e, t) {
|
|
212
216
|
let n = u.length;
|
|
213
217
|
if (n === 0) return "";
|
|
214
218
|
let r = 0;
|
|
@@ -220,7 +224,7 @@ function z(u, e, t) {
|
|
|
220
224
|
}
|
|
221
225
|
return u.slice(0, n - r);
|
|
222
226
|
}
|
|
223
|
-
function
|
|
227
|
+
function ge(u, e) {
|
|
224
228
|
if (u.indexOf(e[1]) === -1) return -1;
|
|
225
229
|
let t = 0;
|
|
226
230
|
for (let n = 0; n < u.length; n++) if (u[n] === "\\") n++;
|
|
@@ -228,7 +232,15 @@ function de(u, e) {
|
|
|
228
232
|
else if (u[n] === e[1] && (t--, t < 0)) return n;
|
|
229
233
|
return t > 0 ? -2 : -1;
|
|
230
234
|
}
|
|
231
|
-
function
|
|
235
|
+
function fe(u, e = 0) {
|
|
236
|
+
let t = e, n = "";
|
|
237
|
+
for (let r of u) if (r === " ") {
|
|
238
|
+
let i = 4 - t % 4;
|
|
239
|
+
n += " ".repeat(i), t += i;
|
|
240
|
+
} else n += r, t++;
|
|
241
|
+
return n;
|
|
242
|
+
}
|
|
243
|
+
function me(u, e, t, n, r) {
|
|
232
244
|
let i = e.href, s = e.title || null, a = u[1].replace(r.other.outputLinkReplace, "$1");
|
|
233
245
|
n.state.inLink = !0;
|
|
234
246
|
let o = {
|
|
@@ -241,7 +253,7 @@ function ge(u, e, t, n, r) {
|
|
|
241
253
|
};
|
|
242
254
|
return n.state.inLink = !1, o;
|
|
243
255
|
}
|
|
244
|
-
function
|
|
256
|
+
function it(u, e, t) {
|
|
245
257
|
let n = u.match(t.other.indentCodeCompensation);
|
|
246
258
|
if (n === null) return e;
|
|
247
259
|
let r = n[1];
|
|
@@ -254,7 +266,7 @@ function Je(u, e, t) {
|
|
|
254
266
|
}).join(`
|
|
255
267
|
`);
|
|
256
268
|
}
|
|
257
|
-
var
|
|
269
|
+
var w = class {
|
|
258
270
|
options;
|
|
259
271
|
rules;
|
|
260
272
|
lexer;
|
|
@@ -276,7 +288,7 @@ var y = class {
|
|
|
276
288
|
type: "code",
|
|
277
289
|
raw: t[0],
|
|
278
290
|
codeBlockStyle: "indented",
|
|
279
|
-
text: this.options.pedantic ? n :
|
|
291
|
+
text: this.options.pedantic ? n : C(n, `
|
|
280
292
|
`)
|
|
281
293
|
};
|
|
282
294
|
}
|
|
@@ -284,7 +296,7 @@ var y = class {
|
|
|
284
296
|
fences(e) {
|
|
285
297
|
let t = this.rules.block.fences.exec(e);
|
|
286
298
|
if (t) {
|
|
287
|
-
let n = t[0], r =
|
|
299
|
+
let n = t[0], r = it(n, t[3] || "", this.rules);
|
|
288
300
|
return {
|
|
289
301
|
type: "code",
|
|
290
302
|
raw: n,
|
|
@@ -298,7 +310,7 @@ var y = class {
|
|
|
298
310
|
if (t) {
|
|
299
311
|
let n = t[2].trim();
|
|
300
312
|
if (this.rules.other.endingHash.test(n)) {
|
|
301
|
-
let r =
|
|
313
|
+
let r = C(n, "#");
|
|
302
314
|
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
303
315
|
}
|
|
304
316
|
return {
|
|
@@ -314,14 +326,14 @@ var y = class {
|
|
|
314
326
|
let t = this.rules.block.hr.exec(e);
|
|
315
327
|
if (t) return {
|
|
316
328
|
type: "hr",
|
|
317
|
-
raw:
|
|
329
|
+
raw: C(t[0], `
|
|
318
330
|
`)
|
|
319
331
|
};
|
|
320
332
|
}
|
|
321
333
|
blockquote(e) {
|
|
322
334
|
let t = this.rules.block.blockquote.exec(e);
|
|
323
335
|
if (t) {
|
|
324
|
-
let n =
|
|
336
|
+
let n = C(t[0], `
|
|
325
337
|
`).split(`
|
|
326
338
|
`), r = "", i = "", s = [];
|
|
327
339
|
for (; n.length > 0;) {
|
|
@@ -336,21 +348,21 @@ var y = class {
|
|
|
336
348
|
r = r ? `${r}
|
|
337
349
|
${p}` : p, i = i ? `${i}
|
|
338
350
|
${c}` : c;
|
|
339
|
-
let
|
|
340
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, s, !0), this.lexer.state.top =
|
|
351
|
+
let d = this.lexer.state.top;
|
|
352
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, s, !0), this.lexer.state.top = d, n.length === 0) break;
|
|
341
353
|
let h = s.at(-1);
|
|
342
354
|
if (h?.type === "code") break;
|
|
343
355
|
if (h?.type === "blockquote") {
|
|
344
356
|
let R = h, f = R.raw + `
|
|
345
357
|
` + n.join(`
|
|
346
|
-
`),
|
|
347
|
-
s[s.length - 1] =
|
|
358
|
+
`), S = this.blockquote(f);
|
|
359
|
+
s[s.length - 1] = S, r = r.substring(0, r.length - R.raw.length) + S.raw, i = i.substring(0, i.length - R.text.length) + S.text;
|
|
348
360
|
break;
|
|
349
361
|
} else if (h?.type === "list") {
|
|
350
362
|
let R = h, f = R.raw + `
|
|
351
363
|
` + n.join(`
|
|
352
|
-
`),
|
|
353
|
-
s[s.length - 1] =
|
|
364
|
+
`), S = this.list(f);
|
|
365
|
+
s[s.length - 1] = S, r = r.substring(0, r.length - h.raw.length) + S.raw, i = i.substring(0, i.length - R.raw.length) + S.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
354
366
|
`);
|
|
355
367
|
continue;
|
|
356
368
|
}
|
|
@@ -380,25 +392,25 @@ ${c}` : c;
|
|
|
380
392
|
let l = !1, p = "", c = "";
|
|
381
393
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
382
394
|
p = t[0], e = e.substring(p.length);
|
|
383
|
-
let
|
|
384
|
-
`, 1)[0]
|
|
385
|
-
`, 1)[0], R = !
|
|
386
|
-
if (this.options.pedantic ? (f = 2, c =
|
|
395
|
+
let d = fe(t[2].split(`
|
|
396
|
+
`, 1)[0], t[1].length), h = e.split(`
|
|
397
|
+
`, 1)[0], R = !d.trim(), f = 0;
|
|
398
|
+
if (this.options.pedantic ? (f = 2, c = d.trimStart()) : R ? f = t[1].length + 1 : (f = d.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = d.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
|
|
387
399
|
`, e = e.substring(h.length + 1), l = !0), !l) {
|
|
388
|
-
let
|
|
400
|
+
let S = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f), be = this.rules.other.blockquoteBeginRegex(f);
|
|
389
401
|
for (; e;) {
|
|
390
|
-
let
|
|
402
|
+
let G = e.split(`
|
|
391
403
|
`, 1)[0], A;
|
|
392
|
-
if (h =
|
|
404
|
+
if (h = G, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), Y.test(h) || ee.test(h) || xe.test(h) || be.test(h) || S.test(h) || V.test(h)) break;
|
|
393
405
|
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
|
|
394
406
|
` + A.slice(f);
|
|
395
407
|
else {
|
|
396
|
-
if (R ||
|
|
408
|
+
if (R || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(d) || ee.test(d) || V.test(d)) break;
|
|
397
409
|
c += `
|
|
398
410
|
` + h;
|
|
399
411
|
}
|
|
400
|
-
|
|
401
|
-
`, e = e.substring(
|
|
412
|
+
R = !h.trim(), p += G + `
|
|
413
|
+
`, e = e.substring(G.length + 1), d = A.slice(f);
|
|
402
414
|
}
|
|
403
415
|
}
|
|
404
416
|
i.loose || (a ? i.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (a = !0)), i.items.push({
|
|
@@ -439,8 +451,8 @@ ${c}` : c;
|
|
|
439
451
|
}
|
|
440
452
|
}
|
|
441
453
|
if (!i.loose) {
|
|
442
|
-
let p = l.tokens.filter((
|
|
443
|
-
i.loose = p.length > 0 && p.some((
|
|
454
|
+
let p = l.tokens.filter((d) => d.type === "space");
|
|
455
|
+
i.loose = p.length > 0 && p.some((d) => this.rules.other.anyLine.test(d.raw));
|
|
444
456
|
}
|
|
445
457
|
}
|
|
446
458
|
if (i.loose) for (let l of i.items) {
|
|
@@ -558,10 +570,10 @@ ${c}` : c;
|
|
|
558
570
|
let n = t[2].trim();
|
|
559
571
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
560
572
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
561
|
-
let s =
|
|
573
|
+
let s = C(n.slice(0, -1), "\\");
|
|
562
574
|
if ((n.length - s.length) % 2 === 0) return;
|
|
563
575
|
} else {
|
|
564
|
-
let s =
|
|
576
|
+
let s = ge(t[2], "()");
|
|
565
577
|
if (s === -2) return;
|
|
566
578
|
if (s > -1) {
|
|
567
579
|
let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
@@ -573,7 +585,7 @@ ${c}` : c;
|
|
|
573
585
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
574
586
|
s && (r = s[1], i = s[3]);
|
|
575
587
|
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
576
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
588
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), me(t, {
|
|
577
589
|
href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
578
590
|
title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
|
|
579
591
|
}, t[0], this.lexer, this.rules);
|
|
@@ -591,7 +603,7 @@ ${c}` : c;
|
|
|
591
603
|
text: s
|
|
592
604
|
};
|
|
593
605
|
}
|
|
594
|
-
return
|
|
606
|
+
return me(n, i, n[0], this.lexer, this.rules);
|
|
595
607
|
}
|
|
596
608
|
}
|
|
597
609
|
emStrong(e, t, n = "") {
|
|
@@ -610,7 +622,7 @@ ${c}` : c;
|
|
|
610
622
|
}
|
|
611
623
|
if (l -= o, l > 0) continue;
|
|
612
624
|
o = Math.min(o, o + l + p);
|
|
613
|
-
let
|
|
625
|
+
let d = [...r[0]][0].length, h = e.slice(0, s + r.index + d + o);
|
|
614
626
|
if (Math.min(s, o) % 2) {
|
|
615
627
|
let f = h.slice(1, -1);
|
|
616
628
|
return {
|
|
@@ -648,14 +660,28 @@ ${c}` : c;
|
|
|
648
660
|
raw: t[0]
|
|
649
661
|
};
|
|
650
662
|
}
|
|
651
|
-
del(e) {
|
|
652
|
-
let
|
|
653
|
-
if (
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
663
|
+
del(e, t, n = "") {
|
|
664
|
+
let r = this.rules.inline.delLDelim.exec(e);
|
|
665
|
+
if (!r) return;
|
|
666
|
+
if (!(r[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
667
|
+
let s = [...r[0]].length - 1, a, o, l = s, p = this.rules.inline.delRDelim;
|
|
668
|
+
for (p.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = p.exec(t)) != null;) {
|
|
669
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a || (o = [...a].length, o !== s)) continue;
|
|
670
|
+
if (r[3] || r[4]) {
|
|
671
|
+
l += o;
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
if (l -= o, l > 0) continue;
|
|
675
|
+
o = Math.min(o, o + l);
|
|
676
|
+
let c = [...r[0]][0].length, d = e.slice(0, s + r.index + c + o), h = d.slice(s, -s);
|
|
677
|
+
return {
|
|
678
|
+
type: "del",
|
|
679
|
+
raw: d,
|
|
680
|
+
text: h,
|
|
681
|
+
tokens: this.lexer.inlineTokens(h)
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
}
|
|
659
685
|
}
|
|
660
686
|
autolink(e) {
|
|
661
687
|
let t = this.rules.inline.autolink.exec(e);
|
|
@@ -719,7 +745,7 @@ var x = class u {
|
|
|
719
745
|
inlineQueue;
|
|
720
746
|
tokenizer;
|
|
721
747
|
constructor(e) {
|
|
722
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new
|
|
748
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
723
749
|
inLink: !1,
|
|
724
750
|
inRawBlock: !1,
|
|
725
751
|
top: !0
|
|
@@ -727,14 +753,14 @@ var x = class u {
|
|
|
727
753
|
let t = {
|
|
728
754
|
other: m,
|
|
729
755
|
block: E.normal,
|
|
730
|
-
inline:
|
|
756
|
+
inline: z.normal
|
|
731
757
|
};
|
|
732
|
-
this.options.pedantic ? (t.block = E.pedantic, t.inline =
|
|
758
|
+
this.options.pedantic ? (t.block = E.pedantic, t.inline = z.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = z.breaks : t.inline = z.gfm), this.tokenizer.rules = t;
|
|
733
759
|
}
|
|
734
760
|
static get rules() {
|
|
735
761
|
return {
|
|
736
762
|
block: E,
|
|
737
|
-
inline:
|
|
763
|
+
inline: z
|
|
738
764
|
};
|
|
739
765
|
}
|
|
740
766
|
static lex(e, t) {
|
|
@@ -901,7 +927,7 @@ var x = class u {
|
|
|
901
927
|
e = e.substring(o.raw.length), t.push(o);
|
|
902
928
|
continue;
|
|
903
929
|
}
|
|
904
|
-
if (o = this.tokenizer.del(e)) {
|
|
930
|
+
if (o = this.tokenizer.del(e, n, a)) {
|
|
905
931
|
e = e.substring(o.raw.length), t.push(o);
|
|
906
932
|
continue;
|
|
907
933
|
}
|
|
@@ -915,9 +941,9 @@ var x = class u {
|
|
|
915
941
|
}
|
|
916
942
|
let l = e;
|
|
917
943
|
if (this.options.extensions?.startInline) {
|
|
918
|
-
let p = Infinity, c = e.slice(1),
|
|
944
|
+
let p = Infinity, c = e.slice(1), d;
|
|
919
945
|
this.options.extensions.startInline.forEach((h) => {
|
|
920
|
-
|
|
946
|
+
d = h.call({ lexer: this }, c), typeof d == "number" && d >= 0 && (p = Math.min(p, d));
|
|
921
947
|
}), p < Infinity && p >= 0 && (l = e.substring(0, p + 1));
|
|
922
948
|
}
|
|
923
949
|
if (o = this.tokenizer.inlineText(l)) {
|
|
@@ -937,7 +963,7 @@ var x = class u {
|
|
|
937
963
|
return t;
|
|
938
964
|
}
|
|
939
965
|
};
|
|
940
|
-
var
|
|
966
|
+
var y = class {
|
|
941
967
|
options;
|
|
942
968
|
parser;
|
|
943
969
|
constructor(e) {
|
|
@@ -949,8 +975,8 @@ var P = class {
|
|
|
949
975
|
code({ text: e, lang: t, escaped: n }) {
|
|
950
976
|
let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
|
|
951
977
|
`;
|
|
952
|
-
return r ? "<pre><code class=\"language-" +
|
|
953
|
-
` : "<pre><code>" + (n ? i :
|
|
978
|
+
return r ? "<pre><code class=\"language-" + O(r) + "\">" + (n ? i : O(i, !0)) + `</code></pre>
|
|
979
|
+
` : "<pre><code>" + (n ? i : O(i, !0)) + `</code></pre>
|
|
954
980
|
`;
|
|
955
981
|
}
|
|
956
982
|
blockquote({ tokens: e }) {
|
|
@@ -1028,7 +1054,7 @@ ${e}</tr>
|
|
|
1028
1054
|
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
1029
1055
|
}
|
|
1030
1056
|
codespan({ text: e }) {
|
|
1031
|
-
return `<code>${
|
|
1057
|
+
return `<code>${O(e, !0)}</code>`;
|
|
1032
1058
|
}
|
|
1033
1059
|
br(e) {
|
|
1034
1060
|
return "<br>";
|
|
@@ -1041,18 +1067,18 @@ ${e}</tr>
|
|
|
1041
1067
|
if (i === null) return r;
|
|
1042
1068
|
e = i;
|
|
1043
1069
|
let s = "<a href=\"" + e + "\"";
|
|
1044
|
-
return t && (s += " title=\"" +
|
|
1070
|
+
return t && (s += " title=\"" + O(t) + "\""), s += ">" + r + "</a>", s;
|
|
1045
1071
|
}
|
|
1046
1072
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1047
1073
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1048
1074
|
let i = X(e);
|
|
1049
|
-
if (i === null) return
|
|
1075
|
+
if (i === null) return O(n);
|
|
1050
1076
|
e = i;
|
|
1051
1077
|
let s = `<img src="${e}" alt="${n}"`;
|
|
1052
|
-
return t && (s += ` title="${
|
|
1078
|
+
return t && (s += ` title="${O(t)}"`), s += ">", s;
|
|
1053
1079
|
}
|
|
1054
1080
|
text(e) {
|
|
1055
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text :
|
|
1081
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : O(e.text);
|
|
1056
1082
|
}
|
|
1057
1083
|
};
|
|
1058
1084
|
var $ = class {
|
|
@@ -1092,7 +1118,7 @@ var b = class u {
|
|
|
1092
1118
|
renderer;
|
|
1093
1119
|
textRenderer;
|
|
1094
1120
|
constructor(e) {
|
|
1095
|
-
this.options = e || T, this.options.renderer = this.options.renderer || new
|
|
1121
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
|
|
1096
1122
|
}
|
|
1097
1123
|
static parse(e, t) {
|
|
1098
1124
|
return new u(t).parse(e);
|
|
@@ -1237,7 +1263,7 @@ var b = class u {
|
|
|
1237
1263
|
return n;
|
|
1238
1264
|
}
|
|
1239
1265
|
};
|
|
1240
|
-
var
|
|
1266
|
+
var P = class {
|
|
1241
1267
|
options;
|
|
1242
1268
|
block;
|
|
1243
1269
|
constructor(e) {
|
|
@@ -1274,16 +1300,16 @@ var S = class {
|
|
|
1274
1300
|
}
|
|
1275
1301
|
};
|
|
1276
1302
|
var B = class {
|
|
1277
|
-
defaults =
|
|
1303
|
+
defaults = M();
|
|
1278
1304
|
options = this.setOptions;
|
|
1279
1305
|
parse = this.parseMarkdown(!0);
|
|
1280
1306
|
parseInline = this.parseMarkdown(!1);
|
|
1281
1307
|
Parser = b;
|
|
1282
|
-
Renderer =
|
|
1308
|
+
Renderer = y;
|
|
1283
1309
|
TextRenderer = $;
|
|
1284
1310
|
Lexer = x;
|
|
1285
|
-
Tokenizer =
|
|
1286
|
-
Hooks =
|
|
1311
|
+
Tokenizer = w;
|
|
1312
|
+
Hooks = P;
|
|
1287
1313
|
constructor(...e) {
|
|
1288
1314
|
this.use(...e);
|
|
1289
1315
|
}
|
|
@@ -1334,7 +1360,7 @@ var B = class {
|
|
|
1334
1360
|
}
|
|
1335
1361
|
"childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
|
|
1336
1362
|
}), r.extensions = t), n.renderer) {
|
|
1337
|
-
let i = this.defaults.renderer || new
|
|
1363
|
+
let i = this.defaults.renderer || new y(this.defaults);
|
|
1338
1364
|
for (let s in n.renderer) {
|
|
1339
1365
|
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
1340
1366
|
if (["options", "parser"].includes(s)) continue;
|
|
@@ -1347,7 +1373,7 @@ var B = class {
|
|
|
1347
1373
|
r.renderer = i;
|
|
1348
1374
|
}
|
|
1349
1375
|
if (n.tokenizer) {
|
|
1350
|
-
let i = this.defaults.tokenizer || new
|
|
1376
|
+
let i = this.defaults.tokenizer || new w(this.defaults);
|
|
1351
1377
|
for (let s in n.tokenizer) {
|
|
1352
1378
|
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
1353
1379
|
if ([
|
|
@@ -1364,22 +1390,22 @@ var B = class {
|
|
|
1364
1390
|
r.tokenizer = i;
|
|
1365
1391
|
}
|
|
1366
1392
|
if (n.hooks) {
|
|
1367
|
-
let i = this.defaults.hooks || new
|
|
1393
|
+
let i = this.defaults.hooks || new P();
|
|
1368
1394
|
for (let s in n.hooks) {
|
|
1369
1395
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
1370
1396
|
if (["options", "block"].includes(s)) continue;
|
|
1371
1397
|
let a = s, o = n.hooks[a], l = i[a];
|
|
1372
|
-
|
|
1373
|
-
if (this.defaults.async &&
|
|
1374
|
-
let
|
|
1375
|
-
return l.call(i,
|
|
1398
|
+
P.passThroughHooks.has(s) ? i[a] = (p) => {
|
|
1399
|
+
if (this.defaults.async && P.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
1400
|
+
let d = await o.call(i, p);
|
|
1401
|
+
return l.call(i, d);
|
|
1376
1402
|
})();
|
|
1377
1403
|
let c = o.call(i, p);
|
|
1378
1404
|
return l.call(i, c);
|
|
1379
1405
|
} : i[a] = (...p) => {
|
|
1380
1406
|
if (this.defaults.async) return (async () => {
|
|
1381
|
-
let
|
|
1382
|
-
return
|
|
1407
|
+
let d = await o.apply(i, p);
|
|
1408
|
+
return d === !1 && (d = await l.apply(i, p)), d;
|
|
1383
1409
|
})();
|
|
1384
1410
|
let c = o.apply(i, p);
|
|
1385
1411
|
return c === !1 && (c = l.apply(i, p)), c;
|
|
@@ -1442,7 +1468,7 @@ var B = class {
|
|
|
1442
1468
|
return (n) => {
|
|
1443
1469
|
if (n.message += `
|
|
1444
1470
|
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
1445
|
-
let r = "<p>An error occurred:</p><pre>" +
|
|
1471
|
+
let r = "<p>An error occurred:</p><pre>" + O(n.message + "", !0) + "</pre>";
|
|
1446
1472
|
return t ? Promise.resolve(r) : r;
|
|
1447
1473
|
}
|
|
1448
1474
|
if (t) return Promise.reject(n);
|
|
@@ -1450,33 +1476,33 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
1450
1476
|
};
|
|
1451
1477
|
}
|
|
1452
1478
|
};
|
|
1453
|
-
var
|
|
1454
|
-
function
|
|
1455
|
-
return
|
|
1479
|
+
var L = new B();
|
|
1480
|
+
function g(u, e) {
|
|
1481
|
+
return L.parse(u, e);
|
|
1456
1482
|
}
|
|
1457
|
-
|
|
1458
|
-
return
|
|
1483
|
+
g.options = g.setOptions = function(u) {
|
|
1484
|
+
return L.setOptions(u), g.defaults = L.defaults, H(g.defaults), g;
|
|
1459
1485
|
};
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
return
|
|
1486
|
+
g.getDefaults = M;
|
|
1487
|
+
g.defaults = T;
|
|
1488
|
+
g.use = function(...u) {
|
|
1489
|
+
return L.use(...u), g.defaults = L.defaults, H(g.defaults), g;
|
|
1464
1490
|
};
|
|
1465
|
-
|
|
1466
|
-
return
|
|
1491
|
+
g.walkTokens = function(u, e) {
|
|
1492
|
+
return L.walkTokens(u, e);
|
|
1467
1493
|
};
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
var
|
|
1494
|
+
g.parseInline = L.parseInline;
|
|
1495
|
+
g.Parser = b;
|
|
1496
|
+
g.parser = b.parse;
|
|
1497
|
+
g.Renderer = y;
|
|
1498
|
+
g.TextRenderer = $;
|
|
1499
|
+
g.Lexer = x;
|
|
1500
|
+
g.lexer = x.lex;
|
|
1501
|
+
g.Tokenizer = w;
|
|
1502
|
+
g.Hooks = P;
|
|
1503
|
+
g.parse = g;
|
|
1504
|
+
var Ut = g.options, Kt = g.setOptions, Wt = g.use, Xt = g.walkTokens, Jt = g.parseInline, Vt = g, Yt = b.parse, en = x.lex;
|
|
1479
1505
|
|
|
1480
1506
|
//#endregion
|
|
1481
|
-
export {
|
|
1507
|
+
export { g };
|
|
1482
1508
|
//# sourceMappingURL=marked.esm.mjs.map
|