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