@wwwfz/dsh-agent-bridge 0.8.3 → 0.9.0
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 +198 -194
- package/THIRD_PARTY_NOTICES.md +67 -0
- package/cordis.patch.yml +4 -4
- package/package.json +40 -40
- package/src/assets.js +405 -348
- package/src/catalog.js +906 -605
- package/src/client.js +623 -310
- package/src/config.js +88 -88
- package/src/export.js +241 -12
- package/src/index.js +160 -136
- package/src/project-archive.js +145 -145
- package/src/projects.js +1189 -980
- package/src/session-import.js +107 -93
- package/src/session-trace.js +121 -0
- package/src/skill-handoff.js +1327 -0
- package/src/skill-package.js +417 -0
- package/src/skill-provider.js +249 -0
- package/src/watch.js +309 -309
- package/web/Geist-OFL.txt +93 -93
- package/web/agent-icons/NOTICE.md +19 -19
- package/web/agent-icons/antigravity.svg +76 -76
- package/web/agent-icons/claude.svg +3 -3
- package/web/agent-icons/dsh.svg +58 -58
- package/web/agent-icons/licenses/copilot.txt +21 -21
- package/web/agent-icons/licenses/dsh.txt +21 -21
- package/web/agent-icons/licenses/gemini.txt +201 -201
- package/web/agent-icons/licenses/opencode.txt +21 -21
- package/web/agent-icons/licenses/qoder-notice.txt +18 -18
- package/web/agent-icons/licenses/qoder.txt +22 -22
- package/web/agent-icons/licenses/qwen.txt +202 -202
- package/web/agent-icons/qoder.svg +4 -4
- package/web/agent-icons/qwen.svg +5 -5
- package/web/agent-icons/workbuddy.svg +29 -29
- package/web/markdown.js +225 -0
- package/web/panel.css +607 -502
- package/web/panel.html +277 -246
- package/web/panel.js +2334 -1559
- package/web/project-context.js +25 -25
- package/web/vendor/markdown-it-LICENSE.txt +156 -0
- package/web/vendor/markdown-it.mjs +3064 -0
|
@@ -0,0 +1,3064 @@
|
|
|
1
|
+
/*! markdown-it 15.0.3 https://github.com/markdown-it/markdown-it @license MIT */
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
4
|
+
let r = {};
|
|
5
|
+
for (var i in t) e(r, i, {
|
|
6
|
+
get: t[i],
|
|
7
|
+
enumerable: !0
|
|
8
|
+
});
|
|
9
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
10
|
+
}, n = {};
|
|
11
|
+
function r(e) {
|
|
12
|
+
let t = n[e];
|
|
13
|
+
if (t) return t;
|
|
14
|
+
t = n[e] = [];
|
|
15
|
+
for (let e = 0; e < 128; e++) {
|
|
16
|
+
let n = String.fromCharCode(e);
|
|
17
|
+
t.push(n);
|
|
18
|
+
}
|
|
19
|
+
for (let n = 0; n < e.length; n++) {
|
|
20
|
+
let r = e.charCodeAt(n);
|
|
21
|
+
t[r] = "%" + ("0" + r.toString(16).toUpperCase()).slice(-2);
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
}
|
|
25
|
+
function i(e, t) {
|
|
26
|
+
typeof t != "string" && (t = i.defaultChars);
|
|
27
|
+
let n = r(t);
|
|
28
|
+
return e.replace(/(%[a-f0-9]{2})+/gi, function(e) {
|
|
29
|
+
let t = "";
|
|
30
|
+
for (let r = 0, i = e.length; r < i; r += 3) {
|
|
31
|
+
let a = parseInt(e.slice(r + 1, r + 3), 16);
|
|
32
|
+
if (a < 128) t += n[a];
|
|
33
|
+
else {
|
|
34
|
+
if ((a & 224) == 192 && r + 3 < i) {
|
|
35
|
+
let n = parseInt(e.slice(r + 4, r + 6), 16);
|
|
36
|
+
if ((n & 192) == 128) {
|
|
37
|
+
let e = a << 6 & 1984 | n & 63;
|
|
38
|
+
t += e < 128 ? "��" : String.fromCharCode(e), r += 3;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if ((a & 240) == 224 && r + 6 < i) {
|
|
43
|
+
let n = parseInt(e.slice(r + 4, r + 6), 16), i = parseInt(e.slice(r + 7, r + 9), 16);
|
|
44
|
+
if ((n & 192) == 128 && (i & 192) == 128) {
|
|
45
|
+
let e = a << 12 & 61440 | n << 6 & 4032 | i & 63;
|
|
46
|
+
t += e < 2048 || e >= 55296 && e <= 57343 ? "���" : String.fromCharCode(e), r += 6;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if ((a & 248) == 240 && r + 9 < i) {
|
|
51
|
+
let n = parseInt(e.slice(r + 4, r + 6), 16), i = parseInt(e.slice(r + 7, r + 9), 16), o = parseInt(e.slice(r + 10, r + 12), 16);
|
|
52
|
+
if ((n & 192) == 128 && (i & 192) == 128 && (o & 192) == 128) {
|
|
53
|
+
let e = a << 18 & 1835008 | n << 12 & 258048 | i << 6 & 4032 | o & 63;
|
|
54
|
+
e < 65536 || e > 1114111 ? t += "����" : (e -= 65536, t += String.fromCharCode(55296 + (e >> 10), 56320 + (e & 1023))), r += 9;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
t += "�";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return t;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
i.defaultChars = ";/?:@&=+$,#", i.componentChars = "";
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region node_modules/mdurl/lib/encode.mjs
|
|
67
|
+
var a = {};
|
|
68
|
+
function o(e) {
|
|
69
|
+
let t = a[e];
|
|
70
|
+
if (t) return t;
|
|
71
|
+
t = a[e] = [];
|
|
72
|
+
for (let e = 0; e < 128; e++) {
|
|
73
|
+
let n = String.fromCharCode(e);
|
|
74
|
+
/^[0-9a-z]$/i.test(n) ? t.push(n) : t.push("%" + ("0" + e.toString(16).toUpperCase()).slice(-2));
|
|
75
|
+
}
|
|
76
|
+
for (let n = 0; n < e.length; n++) t[e.charCodeAt(n)] = e[n];
|
|
77
|
+
return t;
|
|
78
|
+
}
|
|
79
|
+
function s(e, t, n) {
|
|
80
|
+
typeof t != "string" && (n = t, t = s.defaultChars), n === void 0 && (n = !0);
|
|
81
|
+
let r = o(t), i = "";
|
|
82
|
+
for (let t = 0, a = e.length; t < a; t++) {
|
|
83
|
+
let o = e.charCodeAt(t);
|
|
84
|
+
if (n && o === 37 && t + 2 < a && /^[0-9a-f]{2}$/i.test(e.slice(t + 1, t + 3))) i += e.slice(t, t + 3), t += 2;
|
|
85
|
+
else if (o < 128) i += r[o];
|
|
86
|
+
else if (o >= 55296 && o <= 57343) {
|
|
87
|
+
if (o >= 55296 && o <= 56319 && t + 1 < a) {
|
|
88
|
+
let n = e.charCodeAt(t + 1);
|
|
89
|
+
if (n >= 56320 && n <= 57343) {
|
|
90
|
+
i += encodeURIComponent(e[t] + e[t + 1]), t++;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
i += "%EF%BF%BD";
|
|
95
|
+
} else i += encodeURIComponent(e[t]);
|
|
96
|
+
}
|
|
97
|
+
return i;
|
|
98
|
+
}
|
|
99
|
+
s.defaultChars = ";/?:@&=+$,-_.!~*'()#", s.componentChars = "-_.!~*'()";
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region node_modules/mdurl/lib/format.mjs
|
|
102
|
+
function c(e) {
|
|
103
|
+
let t = "";
|
|
104
|
+
return t += e.protocol || "", t += e.slashes ? "//" : "", t += e.auth ? e.auth + "@" : "", e.hostname && e.hostname.indexOf(":") !== -1 ? t += "[" + e.hostname + "]" : t += e.hostname || "", t += e.port ? ":" + e.port : "", t += e.pathname || "", t += e.search || "", t += e.hash || "", t;
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region node_modules/mdurl/lib/parse.mjs
|
|
108
|
+
function l() {
|
|
109
|
+
this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
|
|
110
|
+
}
|
|
111
|
+
var u = /^([a-z0-9.+-]+:)/i, d = /:[0-9]*$/, f = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, p = [
|
|
112
|
+
"%",
|
|
113
|
+
"/",
|
|
114
|
+
"?",
|
|
115
|
+
";",
|
|
116
|
+
"#",
|
|
117
|
+
"'",
|
|
118
|
+
"{",
|
|
119
|
+
"}",
|
|
120
|
+
"|",
|
|
121
|
+
"\\",
|
|
122
|
+
"^",
|
|
123
|
+
"`",
|
|
124
|
+
"<",
|
|
125
|
+
">",
|
|
126
|
+
"\"",
|
|
127
|
+
"`",
|
|
128
|
+
" ",
|
|
129
|
+
"\r",
|
|
130
|
+
"\n",
|
|
131
|
+
" "
|
|
132
|
+
], m = [
|
|
133
|
+
"/",
|
|
134
|
+
"?",
|
|
135
|
+
"#"
|
|
136
|
+
], h = 255, g = /^[+a-z0-9A-Z_-]{0,63}$/, _ = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, v = {
|
|
137
|
+
javascript: !0,
|
|
138
|
+
"javascript:": !0
|
|
139
|
+
}, y = {
|
|
140
|
+
http: !0,
|
|
141
|
+
https: !0,
|
|
142
|
+
ftp: !0,
|
|
143
|
+
gopher: !0,
|
|
144
|
+
file: !0,
|
|
145
|
+
"http:": !0,
|
|
146
|
+
"https:": !0,
|
|
147
|
+
"ftp:": !0,
|
|
148
|
+
"gopher:": !0,
|
|
149
|
+
"file:": !0
|
|
150
|
+
};
|
|
151
|
+
function b(e, t) {
|
|
152
|
+
if (e && e instanceof l) return e;
|
|
153
|
+
let n = new l();
|
|
154
|
+
return n.parse(e, t), n;
|
|
155
|
+
}
|
|
156
|
+
l.prototype.parse = function(e, t) {
|
|
157
|
+
let n, r, i, a = e;
|
|
158
|
+
if (a = a.trim(), !t && e.split("#").length === 1) {
|
|
159
|
+
let e = f.exec(a);
|
|
160
|
+
if (e) return this.pathname = e[1], e[2] && (this.search = e[2]), this;
|
|
161
|
+
}
|
|
162
|
+
let o = u.exec(a);
|
|
163
|
+
if (o && (o = o[0], n = o.toLowerCase(), this.protocol = o, a = a.substr(o.length)), (t || o || a.match(/^\/\/[^@\/]+@[^@\/]+/)) && (i = a.substr(0, 2) === "//", i && !(o && v[o]) && (a = a.substr(2), this.slashes = !0)), !v[o] && (i || o && !y[o])) {
|
|
164
|
+
let e = -1;
|
|
165
|
+
for (let t = 0; t < m.length; t++) r = a.indexOf(m[t]), r !== -1 && (e === -1 || r < e) && (e = r);
|
|
166
|
+
let t, n;
|
|
167
|
+
n = e === -1 ? a.lastIndexOf("@") : a.lastIndexOf("@", e), n !== -1 && (t = a.slice(0, n), a = a.slice(n + 1), this.auth = t), e = -1;
|
|
168
|
+
for (let t = 0; t < p.length; t++) r = a.indexOf(p[t]), r !== -1 && (e === -1 || r < e) && (e = r);
|
|
169
|
+
e === -1 && (e = a.length), a[e - 1] === ":" && e--;
|
|
170
|
+
let i = a.slice(0, e);
|
|
171
|
+
a = a.slice(e), this.parseHost(i), this.hostname = this.hostname || "";
|
|
172
|
+
let o = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
173
|
+
if (!o) {
|
|
174
|
+
let e = this.hostname.split(/\./);
|
|
175
|
+
for (let t = 0, n = e.length; t < n; t++) {
|
|
176
|
+
let n = e[t];
|
|
177
|
+
if (n && !n.match(g)) {
|
|
178
|
+
let r = "";
|
|
179
|
+
for (let e = 0, t = n.length; e < t; e++) n.charCodeAt(e) > 127 ? r += "x" : r += n[e];
|
|
180
|
+
if (!r.match(g)) {
|
|
181
|
+
let r = e.slice(0, t), i = e.slice(t + 1), o = n.match(_);
|
|
182
|
+
o && (r.push(o[1]), i.unshift(o[2])), i.length && (a = i.join(".") + a), this.hostname = r.join(".");
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
this.hostname.length > h && (this.hostname = ""), o && (this.hostname = this.hostname.substr(1, this.hostname.length - 2));
|
|
189
|
+
}
|
|
190
|
+
let s = a.indexOf("#");
|
|
191
|
+
s !== -1 && (this.hash = a.substr(s), a = a.slice(0, s));
|
|
192
|
+
let c = a.indexOf("?");
|
|
193
|
+
return c !== -1 && (this.search = a.substr(c), a = a.slice(0, c)), a && (this.pathname = a), y[n] && this.hostname && !this.pathname && (this.pathname = ""), this;
|
|
194
|
+
}, l.prototype.parseHost = function(e) {
|
|
195
|
+
let t = d.exec(e);
|
|
196
|
+
t && (t = t[0], t !== ":" && (this.port = t.substr(1)), e = e.substr(0, e.length - t.length)), e && (this.hostname = e);
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region node_modules/mdurl/index.mjs
|
|
200
|
+
var x = /* @__PURE__ */ t({
|
|
201
|
+
decode: () => i,
|
|
202
|
+
encode: () => s,
|
|
203
|
+
format: () => c,
|
|
204
|
+
parse: () => b
|
|
205
|
+
}), S = /* @__PURE__ */ t({
|
|
206
|
+
Any: () => C,
|
|
207
|
+
Cc: () => ee,
|
|
208
|
+
Cf: () => te,
|
|
209
|
+
P: () => ne,
|
|
210
|
+
S: () => re,
|
|
211
|
+
Z: () => ie
|
|
212
|
+
}), C = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, ee = /[\0-\x1F\x7F-\x9F]/, te = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, ne = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/, re = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD803[\uDD8E\uDD8F\uDED1-\uDED8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/, ie = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, ae = [
|
|
213
|
+
8364,
|
|
214
|
+
0,
|
|
215
|
+
8218,
|
|
216
|
+
402,
|
|
217
|
+
8222,
|
|
218
|
+
8230,
|
|
219
|
+
8224,
|
|
220
|
+
8225,
|
|
221
|
+
710,
|
|
222
|
+
8240,
|
|
223
|
+
352,
|
|
224
|
+
8249,
|
|
225
|
+
338,
|
|
226
|
+
0,
|
|
227
|
+
381,
|
|
228
|
+
0,
|
|
229
|
+
0,
|
|
230
|
+
8216,
|
|
231
|
+
8217,
|
|
232
|
+
8220,
|
|
233
|
+
8221,
|
|
234
|
+
8226,
|
|
235
|
+
8211,
|
|
236
|
+
8212,
|
|
237
|
+
732,
|
|
238
|
+
8482,
|
|
239
|
+
353,
|
|
240
|
+
8250,
|
|
241
|
+
339,
|
|
242
|
+
0,
|
|
243
|
+
382,
|
|
244
|
+
376
|
|
245
|
+
];
|
|
246
|
+
function oe(e) {
|
|
247
|
+
return e === 0 || e >= 55296 && e <= 57343 || e > 1114111;
|
|
248
|
+
}
|
|
249
|
+
function se(e) {
|
|
250
|
+
return oe(e) ? 65533 : e >= 128 && e <= 159 && ae[e - 128] || e;
|
|
251
|
+
}
|
|
252
|
+
function ce(e) {
|
|
253
|
+
return e - 1 >>> 0 < 127 || e - 160 >>> 0 < 55136 ? String.fromCharCode(e) : String.fromCodePoint(se(e));
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region node_modules/entities/dist/internal/decode-shared.js
|
|
257
|
+
var w = /* #__PURE__ */ (() => {
|
|
258
|
+
let e = /* @__PURE__ */ new Uint8Array(127), t = 0;
|
|
259
|
+
for (let n = 33; n <= 126; n++) n !== 34 && n !== 36 && n !== 92 && (e[n] = t++);
|
|
260
|
+
return e;
|
|
261
|
+
})();
|
|
262
|
+
function le(e, t, n, r, i, a) {
|
|
263
|
+
let o = e.length, s = a * 90, c = 0, l = () => {
|
|
264
|
+
let t = w[e.charCodeAt(c++)];
|
|
265
|
+
return t < a ? t : t * 91 - s + w[e.charCodeAt(c++)];
|
|
266
|
+
}, u = n - r, d = n + i, f = new Int32Array(d);
|
|
267
|
+
f.fill(-1, r, a), f.fill(-1, a + u, d);
|
|
268
|
+
let p = new Int32Array(d), m = new Int32Array(d);
|
|
269
|
+
function h(t, n) {
|
|
270
|
+
let r = 0, i = n, a = n + t;
|
|
271
|
+
for (; i < a;) {
|
|
272
|
+
let t = w[e.charCodeAt(c++)];
|
|
273
|
+
if (t < 89) r += t, f[i++] = r;
|
|
274
|
+
else if (t === 89) {
|
|
275
|
+
let t = w[e.charCodeAt(c++)] + 2;
|
|
276
|
+
for (; t--;) f[i++] = ++r;
|
|
277
|
+
} else {
|
|
278
|
+
let t = w[e.charCodeAt(c++)];
|
|
279
|
+
r += 89 + (t < 90 ? t * 91 + w[e.charCodeAt(c++)] : w[e.charCodeAt(c++)] * 8281 + w[e.charCodeAt(c++)] * 91 + w[e.charCodeAt(c++)]), f[i++] = r;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
h(r, 0), h(u, a);
|
|
284
|
+
let g = new Int32Array(i * 2), _ = 0, v = 0;
|
|
285
|
+
function y(e, t) {
|
|
286
|
+
for (let n = 0; n < e; n++) {
|
|
287
|
+
let e = t + n, r = l(), i = l();
|
|
288
|
+
g[v * 2] = r, g[v * 2 + 1] = i, v += 1, p[e] = _;
|
|
289
|
+
let a = (f[r] < 0 ? m[r] : 1) + (f[i] < 0 ? m[i] : 1);
|
|
290
|
+
m[e] = a, _ += a;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
y(i - a + r, a + u), y(a - r, r);
|
|
294
|
+
let b = new Uint16Array(_), x = 0;
|
|
295
|
+
for (let e = 0; e < v; e++) for (let t = 0; t < 2; t++) {
|
|
296
|
+
let n = g[e * 2 + t], r = f[n];
|
|
297
|
+
if (r < 0) {
|
|
298
|
+
let e = p[n], t = e + m[n];
|
|
299
|
+
for (; e < t;) b[x++] = b[e++];
|
|
300
|
+
} else b[x++] = r;
|
|
301
|
+
}
|
|
302
|
+
let S = new Uint16Array(t), C = 0;
|
|
303
|
+
for (; c < o;) {
|
|
304
|
+
let t = w[e.charCodeAt(c++)];
|
|
305
|
+
t >= a && (t = t * 91 - s + w[e.charCodeAt(c++)]);
|
|
306
|
+
let n = f[t];
|
|
307
|
+
if (n < 0) {
|
|
308
|
+
let e = p[t], n = e + m[t];
|
|
309
|
+
for (; e < n;) S[C++] = b[e++];
|
|
310
|
+
} else S[C++] = n;
|
|
311
|
+
}
|
|
312
|
+
return S;
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region node_modules/entities/dist/generated/decode-data-html.js
|
|
316
|
+
var ue = /* #__PURE__ */ le("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})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}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P", 13494, 2713, 49, 25, 61), T;
|
|
317
|
+
(function(e) {
|
|
318
|
+
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.FLAG13 = 8192] = "FLAG13", e[e.BRANCH_LENGTH = 8064] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE", e[e.VALUE_MASK = 8191] = "VALUE_MASK";
|
|
319
|
+
})(T || (T = {}));
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
|
|
322
|
+
function E(e) {
|
|
323
|
+
"@babel/helpers - typeof";
|
|
324
|
+
return E = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
325
|
+
return typeof e;
|
|
326
|
+
} : function(e) {
|
|
327
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
328
|
+
}, E(e);
|
|
329
|
+
}
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
|
|
332
|
+
function de(e, t) {
|
|
333
|
+
if (E(e) != "object" || !e) return e;
|
|
334
|
+
var n = e[Symbol.toPrimitive];
|
|
335
|
+
if (n !== void 0) {
|
|
336
|
+
var r = n.call(e, t || "default");
|
|
337
|
+
if (E(r) != "object") return r;
|
|
338
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
339
|
+
}
|
|
340
|
+
return (t === "string" ? String : Number)(e);
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
|
|
344
|
+
function fe(e) {
|
|
345
|
+
var t = de(e, "string");
|
|
346
|
+
return E(t) == "symbol" ? t : t + "";
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
|
|
350
|
+
function D(e, t, n) {
|
|
351
|
+
return (t = fe(t)) in e ? Object.defineProperty(e, t, {
|
|
352
|
+
value: n,
|
|
353
|
+
enumerable: !0,
|
|
354
|
+
configurable: !0,
|
|
355
|
+
writable: !0
|
|
356
|
+
}) : e[t] = n, e;
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region node_modules/entities/dist/decode.js
|
|
360
|
+
var O;
|
|
361
|
+
(function(e) {
|
|
362
|
+
e[e.AMP = 38] = "AMP", e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_X = 120] = "LOWER_X";
|
|
363
|
+
})(O || (O = {}));
|
|
364
|
+
var k = 32, pe = 21, me = 2097151, he = 2047, ge = 0;
|
|
365
|
+
function _e(e) {
|
|
366
|
+
let t = e >>> pe;
|
|
367
|
+
return t === he ? ge : t;
|
|
368
|
+
}
|
|
369
|
+
function ve(e) {
|
|
370
|
+
return e - O.ZERO >>> 0 <= 9;
|
|
371
|
+
}
|
|
372
|
+
function ye(e) {
|
|
373
|
+
return (e | k) - O.LOWER_A >>> 0 <= 5;
|
|
374
|
+
}
|
|
375
|
+
function be(e) {
|
|
376
|
+
return (e | k) - O.LOWER_A >>> 0 <= 25;
|
|
377
|
+
}
|
|
378
|
+
function xe(e) {
|
|
379
|
+
return e === O.EQUALS || be(e) || ve(e);
|
|
380
|
+
}
|
|
381
|
+
var Se;
|
|
382
|
+
(function(e) {
|
|
383
|
+
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
|
|
384
|
+
})(Se || (Se = {}));
|
|
385
|
+
var Ce;
|
|
386
|
+
(function(e) {
|
|
387
|
+
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
|
|
388
|
+
})(Ce || (Ce = {}));
|
|
389
|
+
function we(e, t, n, r) {
|
|
390
|
+
let i = (t & T.BRANCH_LENGTH) >> 7, a = t & T.JUMP_TABLE;
|
|
391
|
+
if (a) {
|
|
392
|
+
if (i === 0) return r === a ? n : -1;
|
|
393
|
+
let t = r - a;
|
|
394
|
+
if (t >>> 0 >= i) return -1;
|
|
395
|
+
let o = e[n + t];
|
|
396
|
+
return o === 0 ? -1 : n + i + o - 1 & 65535;
|
|
397
|
+
}
|
|
398
|
+
if (i === 0) return -1;
|
|
399
|
+
let o = i + 1 >> 1, s = n + o + i;
|
|
400
|
+
for (let t = 0; t < i; t++) {
|
|
401
|
+
let i = e[n + (t >> 1)] >> ((t & 1) << 3) & 255;
|
|
402
|
+
if (i === r) return s + e[n + o + t] & 65535;
|
|
403
|
+
if (i > r) return -1;
|
|
404
|
+
}
|
|
405
|
+
return -1;
|
|
406
|
+
}
|
|
407
|
+
function Te(e, t, n) {
|
|
408
|
+
return n === 1 ? String.fromCharCode(e[t] & T.VALUE_MASK) : n === 2 ? String.fromCharCode(e[t + 1]) : String.fromCharCode(e[t + 1], e[t + 2]);
|
|
409
|
+
}
|
|
410
|
+
function Ee(e, t, n) {
|
|
411
|
+
let r = t + 1, i = 0, a = r;
|
|
412
|
+
if (r < n && (e.charCodeAt(r) | k) === O.LOWER_X) for (r += 1, a = r; r < n;) {
|
|
413
|
+
let t = e.charCodeAt(r);
|
|
414
|
+
if (ve(t)) i = i * 16 + (t - O.ZERO);
|
|
415
|
+
else if (ye(t)) i = i * 16 + ((t | k) - O.LOWER_A + 10);
|
|
416
|
+
else break;
|
|
417
|
+
r += 1;
|
|
418
|
+
}
|
|
419
|
+
else for (; r < n;) {
|
|
420
|
+
let t = e.charCodeAt(r) - O.ZERO;
|
|
421
|
+
if (t >>> 0 > 9) break;
|
|
422
|
+
i = i * 10 + t, r += 1;
|
|
423
|
+
}
|
|
424
|
+
if (r === a) return 0;
|
|
425
|
+
r < n && e.charCodeAt(r) === O.SEMI && (r += 1), i > 1114111 && (i = 1114112);
|
|
426
|
+
let o = r - t;
|
|
427
|
+
return o >= he && (ge = o, o = he), o << pe | i;
|
|
428
|
+
}
|
|
429
|
+
function De(e, t, n) {
|
|
430
|
+
let r = ue, i = e.indexOf("&");
|
|
431
|
+
if (i < 0) return e;
|
|
432
|
+
let a = e.length, o = 0, s = "", c = r[0], l = c & T.JUMP_TABLE, u = (c & T.BRANCH_LENGTH) >> 7;
|
|
433
|
+
do {
|
|
434
|
+
let c = i + 1, d = e.charCodeAt(c), f, p;
|
|
435
|
+
if (d === O.NUM) {
|
|
436
|
+
let n = Ee(e, c, a);
|
|
437
|
+
f = _e(n), t && f > 0 && e.charCodeAt(c + f - 1) !== O.SEMI && (f = 0), p = f === 0 ? "" : ce(n & me);
|
|
438
|
+
} else if (be(d)) {
|
|
439
|
+
f = 0, p = "";
|
|
440
|
+
let n = d - l, i;
|
|
441
|
+
if (n >>> 0 < u) {
|
|
442
|
+
let e = r[1 + n];
|
|
443
|
+
i = e === 0 ? -1 : u + e & 65535;
|
|
444
|
+
} else i = -1;
|
|
445
|
+
let o = 0, s = 0, m = i < 0 ? 0 : r[i], h = c + 1;
|
|
446
|
+
trie: for (; h < a;) {
|
|
447
|
+
for (; (m & (T.VALUE_LENGTH | T.FLAG13)) === 0 && (m & T.JUMP_TABLE) !== 0;) {
|
|
448
|
+
let t = m & T.JUMP_TABLE, n = (m & T.BRANCH_LENGTH) >> 7;
|
|
449
|
+
if (n === 0) {
|
|
450
|
+
if (e.charCodeAt(h) !== t) break trie;
|
|
451
|
+
i += 1;
|
|
452
|
+
} else {
|
|
453
|
+
let a = e.charCodeAt(h) - t;
|
|
454
|
+
if (a >>> 0 >= n) break trie;
|
|
455
|
+
let o = r[i + 1 + a];
|
|
456
|
+
if (o === 0) break trie;
|
|
457
|
+
i = i + n + o & 65535;
|
|
458
|
+
}
|
|
459
|
+
if (m = r[i], h += 1, h >= a) break trie;
|
|
460
|
+
}
|
|
461
|
+
if ((m & (T.VALUE_LENGTH | T.FLAG13)) === T.FLAG13) {
|
|
462
|
+
let t = (m & T.BRANCH_LENGTH) >> 7;
|
|
463
|
+
if (e.charCodeAt(h) !== (m & T.JUMP_TABLE)) break;
|
|
464
|
+
h += 1;
|
|
465
|
+
let n = t - 1, a = i + 1, o = 0;
|
|
466
|
+
for (; o + 1 < n; o += 2) {
|
|
467
|
+
let t = r[a];
|
|
468
|
+
if (e.charCodeAt(h) !== (t & 255) || (h += 1, e.charCodeAt(h) !== (t >> 8 & 255))) break trie;
|
|
469
|
+
h += 1, a += 1;
|
|
470
|
+
}
|
|
471
|
+
if (o < n) {
|
|
472
|
+
if (e.charCodeAt(h) !== (r[a] & 255)) break;
|
|
473
|
+
h += 1;
|
|
474
|
+
}
|
|
475
|
+
i += 1 + (t >> 1), m = r[i];
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
let n = m >>> 14, l = e.charCodeAt(h);
|
|
479
|
+
if (n !== 0) {
|
|
480
|
+
if (l === O.SEMI) {
|
|
481
|
+
f = h - c + 1, p = n === 1 ? String.fromCharCode(m & T.VALUE_MASK) : Te(r, i, n);
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
if (!t && (m & T.FLAG13) === 0 && (f = h - c, o = i, s = n), n === 1) break;
|
|
485
|
+
}
|
|
486
|
+
let u = we(r, m, i + (n || 1), l);
|
|
487
|
+
if (u < 0) break;
|
|
488
|
+
i = u, m = r[i], h += 1;
|
|
489
|
+
}
|
|
490
|
+
if (p === "") {
|
|
491
|
+
let e = m >>> 14;
|
|
492
|
+
e !== 0 && !t && (m & T.FLAG13) === 0 && (f = h - c, o = i, s = e), f > 0 && (p = Te(r, o, s));
|
|
493
|
+
}
|
|
494
|
+
} else f = 0, p = "";
|
|
495
|
+
f === 0 || n && d !== O.NUM && e.charCodeAt(c + f - 1) !== O.SEMI && c + f < a && xe(e.charCodeAt(c + f)) ? i = c : (o < i && (s += e.slice(o, i)), s += p, i = o = c + f), e.charCodeAt(i) !== O.AMP && (i = e.indexOf("&", i));
|
|
496
|
+
} while (i >= 0);
|
|
497
|
+
return s + e.slice(o);
|
|
498
|
+
}
|
|
499
|
+
function Oe(e) {
|
|
500
|
+
return De(e, !0, !1);
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/common/utils.ts
|
|
504
|
+
var ke = /* @__PURE__ */ t({
|
|
505
|
+
arrayReplaceAt: () => je,
|
|
506
|
+
asciiTrim: () => R,
|
|
507
|
+
callable: () => Ae,
|
|
508
|
+
escapeHtml: () => M,
|
|
509
|
+
escapeRE: () => Ue,
|
|
510
|
+
fromCodePoint: () => A,
|
|
511
|
+
isMdAsciiPunct: () => I,
|
|
512
|
+
isPunctChar: () => We,
|
|
513
|
+
isPunctCharCode: () => F,
|
|
514
|
+
isSpace: () => N,
|
|
515
|
+
isValidEntityCode: () => Me,
|
|
516
|
+
isWhiteSpace: () => P,
|
|
517
|
+
lib: () => Ke,
|
|
518
|
+
normalizeReference: () => L,
|
|
519
|
+
unescapeAll: () => j,
|
|
520
|
+
unescapeMd: () => Le
|
|
521
|
+
});
|
|
522
|
+
function Ae(e) {
|
|
523
|
+
let t = function(...n) {
|
|
524
|
+
return Reflect.construct(e, n, new.target && new.target !== t ? new.target : e);
|
|
525
|
+
};
|
|
526
|
+
return Object.defineProperty(t, "name", { value: e.name }), Object.setPrototypeOf(t, e), t.prototype = e.prototype, t;
|
|
527
|
+
}
|
|
528
|
+
function je(e, t, n) {
|
|
529
|
+
return [].concat(e.slice(0, t), n, e.slice(t + 1));
|
|
530
|
+
}
|
|
531
|
+
function Me(e) {
|
|
532
|
+
return !(e >= 55296 && e <= 57343 || e >= 64976 && e <= 65007 || (e & 65535) == 65535 || (e & 65535) == 65534 || e >= 0 && e <= 8 || e === 11 || e >= 14 && e <= 31 || e >= 127 && e <= 159 || e > 1114111);
|
|
533
|
+
}
|
|
534
|
+
function A(e) {
|
|
535
|
+
if (e > 65535) {
|
|
536
|
+
e -= 65536;
|
|
537
|
+
let t = 55296 + (e >> 10), n = 56320 + (e & 1023);
|
|
538
|
+
return String.fromCharCode(t, n);
|
|
539
|
+
}
|
|
540
|
+
return String.fromCharCode(e);
|
|
541
|
+
}
|
|
542
|
+
var Ne = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, Pe = RegExp(`${Ne.source}|&([a-z#][a-z0-9]{1,31});`, "gi"), Fe = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
|
|
543
|
+
function Ie(e, t) {
|
|
544
|
+
if (t.charCodeAt(0) === 35 && Fe.test(t)) {
|
|
545
|
+
let n = t[1].toLowerCase() === "x" ? parseInt(t.slice(2), 16) : parseInt(t.slice(1), 10);
|
|
546
|
+
return Me(n) ? A(n) : e;
|
|
547
|
+
}
|
|
548
|
+
let n = Oe(e);
|
|
549
|
+
return n === e ? e : n;
|
|
550
|
+
}
|
|
551
|
+
function Le(e) {
|
|
552
|
+
return e.indexOf("\\") < 0 ? e : e.replace(Ne, "$1");
|
|
553
|
+
}
|
|
554
|
+
function j(e) {
|
|
555
|
+
return e.indexOf("\\") < 0 && e.indexOf("&") < 0 ? e : e.replace(Pe, function(e, t, n) {
|
|
556
|
+
return t || Ie(e, n);
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
var Re = /[&<>"]/, ze = /[&<>"]/g, Be = {
|
|
560
|
+
"&": "&",
|
|
561
|
+
"<": "<",
|
|
562
|
+
">": ">",
|
|
563
|
+
"\"": """
|
|
564
|
+
};
|
|
565
|
+
function Ve(e) {
|
|
566
|
+
return Be[e];
|
|
567
|
+
}
|
|
568
|
+
function M(e) {
|
|
569
|
+
return Re.test(e) ? e.replace(ze, Ve) : e;
|
|
570
|
+
}
|
|
571
|
+
var He = /[.?*+^$[\]\\(){}|-]/g;
|
|
572
|
+
function Ue(e) {
|
|
573
|
+
return e.replace(He, "\\$&");
|
|
574
|
+
}
|
|
575
|
+
function N(e) {
|
|
576
|
+
switch (e) {
|
|
577
|
+
case 9:
|
|
578
|
+
case 32: return !0;
|
|
579
|
+
}
|
|
580
|
+
return !1;
|
|
581
|
+
}
|
|
582
|
+
function P(e) {
|
|
583
|
+
if (e >= 8192 && e <= 8202) return !0;
|
|
584
|
+
switch (e) {
|
|
585
|
+
case 9:
|
|
586
|
+
case 10:
|
|
587
|
+
case 11:
|
|
588
|
+
case 12:
|
|
589
|
+
case 13:
|
|
590
|
+
case 32:
|
|
591
|
+
case 160:
|
|
592
|
+
case 5760:
|
|
593
|
+
case 8239:
|
|
594
|
+
case 8287:
|
|
595
|
+
case 12288: return !0;
|
|
596
|
+
}
|
|
597
|
+
return !1;
|
|
598
|
+
}
|
|
599
|
+
function We(e) {
|
|
600
|
+
return ne.test(e) || re.test(e);
|
|
601
|
+
}
|
|
602
|
+
function F(e) {
|
|
603
|
+
return We(A(e));
|
|
604
|
+
}
|
|
605
|
+
function I(e) {
|
|
606
|
+
switch (e) {
|
|
607
|
+
case 33:
|
|
608
|
+
case 34:
|
|
609
|
+
case 35:
|
|
610
|
+
case 36:
|
|
611
|
+
case 37:
|
|
612
|
+
case 38:
|
|
613
|
+
case 39:
|
|
614
|
+
case 40:
|
|
615
|
+
case 41:
|
|
616
|
+
case 42:
|
|
617
|
+
case 43:
|
|
618
|
+
case 44:
|
|
619
|
+
case 45:
|
|
620
|
+
case 46:
|
|
621
|
+
case 47:
|
|
622
|
+
case 58:
|
|
623
|
+
case 59:
|
|
624
|
+
case 60:
|
|
625
|
+
case 61:
|
|
626
|
+
case 62:
|
|
627
|
+
case 63:
|
|
628
|
+
case 64:
|
|
629
|
+
case 91:
|
|
630
|
+
case 92:
|
|
631
|
+
case 93:
|
|
632
|
+
case 94:
|
|
633
|
+
case 95:
|
|
634
|
+
case 96:
|
|
635
|
+
case 123:
|
|
636
|
+
case 124:
|
|
637
|
+
case 125:
|
|
638
|
+
case 126: return !0;
|
|
639
|
+
default: return !1;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function L(e) {
|
|
643
|
+
return e = e.trim().replace(/\s+/g, " "), e.toLowerCase().toUpperCase();
|
|
644
|
+
}
|
|
645
|
+
function Ge(e) {
|
|
646
|
+
return e === 32 || e === 9 || e === 10 || e === 13;
|
|
647
|
+
}
|
|
648
|
+
function R(e) {
|
|
649
|
+
let t = 0;
|
|
650
|
+
for (; t < e.length && Ge(e.charCodeAt(t)); t++);
|
|
651
|
+
let n = e.length - 1;
|
|
652
|
+
for (; n >= t && Ge(e.charCodeAt(n)); n--);
|
|
653
|
+
return e.slice(t, n + 1);
|
|
654
|
+
}
|
|
655
|
+
var Ke = {
|
|
656
|
+
mdurl: x,
|
|
657
|
+
ucmicro: S
|
|
658
|
+
};
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region src/helpers/parse_link_label.ts
|
|
661
|
+
function qe(e, t, n) {
|
|
662
|
+
let r, i, a, o, s = e.posMax, c = e.pos;
|
|
663
|
+
for (e.pos = t + 1, r = 1; e.pos < s;) {
|
|
664
|
+
if (a = e.src.charCodeAt(e.pos), a === 93 && (r--, r === 0)) {
|
|
665
|
+
i = !0;
|
|
666
|
+
break;
|
|
667
|
+
}
|
|
668
|
+
if (o = e.pos, e.md.inline.skipToken(e), a === 91) {
|
|
669
|
+
if (o === e.pos - 1) r++;
|
|
670
|
+
else if (n) return e.pos = c, -1;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
let l = -1;
|
|
674
|
+
return i && (l = e.pos), e.pos = c, l;
|
|
675
|
+
}
|
|
676
|
+
//#endregion
|
|
677
|
+
//#region src/helpers/parse_link_destination.ts
|
|
678
|
+
function Je(e, t, n) {
|
|
679
|
+
let r, i = t, a = {
|
|
680
|
+
ok: !1,
|
|
681
|
+
pos: 0,
|
|
682
|
+
str: ""
|
|
683
|
+
};
|
|
684
|
+
if (e.charCodeAt(i) === 60) {
|
|
685
|
+
for (i++; i < n;) {
|
|
686
|
+
if (r = e.charCodeAt(i), r === 10 || r === 60) return a;
|
|
687
|
+
if (r === 62) return a.pos = i + 1, a.str = j(e.slice(t + 1, i)), a.ok = !0, a;
|
|
688
|
+
r === 92 && i + 1 < n ? i += 2 : i++;
|
|
689
|
+
}
|
|
690
|
+
return a;
|
|
691
|
+
}
|
|
692
|
+
let o = 0;
|
|
693
|
+
for (; i < n && (r = e.charCodeAt(i), !(r === 32 || r < 32 || r === 127));) if (r === 92 && i + 1 < n) {
|
|
694
|
+
if (e.charCodeAt(i + 1) === 32) {
|
|
695
|
+
i++;
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
i += 2;
|
|
699
|
+
} else {
|
|
700
|
+
if (r === 40 && (o++, o > 32)) return a;
|
|
701
|
+
if (r === 41) {
|
|
702
|
+
if (o === 0) break;
|
|
703
|
+
o--;
|
|
704
|
+
}
|
|
705
|
+
i++;
|
|
706
|
+
}
|
|
707
|
+
return t === i || o !== 0 || (a.str = j(e.slice(t, i)), a.pos = i, a.ok = !0), a;
|
|
708
|
+
}
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region src/helpers/parse_link_title.ts
|
|
711
|
+
function Ye(e, t, n, r) {
|
|
712
|
+
let i, a = t, o = {
|
|
713
|
+
ok: !1,
|
|
714
|
+
can_continue: !1,
|
|
715
|
+
pos: 0,
|
|
716
|
+
str: "",
|
|
717
|
+
marker: 0
|
|
718
|
+
};
|
|
719
|
+
if (r) o.str = r.str, o.marker = r.marker;
|
|
720
|
+
else {
|
|
721
|
+
if (a >= n) return o;
|
|
722
|
+
let r = e.charCodeAt(a);
|
|
723
|
+
if (r !== 34 && r !== 39 && r !== 40) return o;
|
|
724
|
+
t++, a++, r === 40 && (r = 41), o.marker = r;
|
|
725
|
+
}
|
|
726
|
+
for (; a < n;) {
|
|
727
|
+
if (i = e.charCodeAt(a), i === o.marker) return o.pos = a + 1, o.str += j(e.slice(t, a)), o.ok = !0, o;
|
|
728
|
+
if (i === 40 && o.marker === 41) return o;
|
|
729
|
+
i === 92 && a + 1 < n && a++, a++;
|
|
730
|
+
}
|
|
731
|
+
return o.can_continue = !0, o.str += j(e.slice(t, a)), o;
|
|
732
|
+
}
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/helpers/index.ts
|
|
735
|
+
var Xe = /* @__PURE__ */ t({
|
|
736
|
+
parseLinkDestination: () => Je,
|
|
737
|
+
parseLinkLabel: () => qe,
|
|
738
|
+
parseLinkTitle: () => Ye
|
|
739
|
+
}), z = class {
|
|
740
|
+
constructor(e, t, n) {
|
|
741
|
+
D(this, "map", null), D(this, "level", 0), D(this, "children", null), D(this, "content", ""), D(this, "markup", ""), D(this, "info", ""), D(this, "block", !1), D(this, "hidden", !1), this.type = e, this.tag = t, this.attrs = null, this.nesting = n, this.meta = null;
|
|
742
|
+
}
|
|
743
|
+
attrIndex(e) {
|
|
744
|
+
if (!this.attrs) return -1;
|
|
745
|
+
let t = this.attrs;
|
|
746
|
+
for (let n = 0, r = t.length; n < r; n++) if (t[n][0] === e) return n;
|
|
747
|
+
return -1;
|
|
748
|
+
}
|
|
749
|
+
attrPush(e) {
|
|
750
|
+
this.attrs ? this.attrs.push(e) : this.attrs = [e];
|
|
751
|
+
}
|
|
752
|
+
attrSet(e, t) {
|
|
753
|
+
let n = this.attrIndex(e), r = [e, t];
|
|
754
|
+
n < 0 ? this.attrPush(r) : this.attrs[n] = r;
|
|
755
|
+
}
|
|
756
|
+
attrGet(e) {
|
|
757
|
+
let t = this.attrIndex(e), n = null;
|
|
758
|
+
return t >= 0 && (n = this.attrs[t][1]), n;
|
|
759
|
+
}
|
|
760
|
+
attrJoin(e, t) {
|
|
761
|
+
let n = this.attrIndex(e);
|
|
762
|
+
n < 0 ? this.attrPush([e, t]) : this.attrs[n][1] = `${this.attrs[n][1]} ${t}`;
|
|
763
|
+
}
|
|
764
|
+
}, B = class {
|
|
765
|
+
constructor() {
|
|
766
|
+
D(this, "__rules__", []), D(this, "__cache__", null);
|
|
767
|
+
}
|
|
768
|
+
__find__(e) {
|
|
769
|
+
for (let t = 0; t < this.__rules__.length; t++) if (this.__rules__[t].name === e) return t;
|
|
770
|
+
return -1;
|
|
771
|
+
}
|
|
772
|
+
__compile__() {
|
|
773
|
+
let e = /* @__PURE__ */ new Set();
|
|
774
|
+
this.__rules__.forEach((t) => {
|
|
775
|
+
t.enabled && t.alt.forEach((t) => {
|
|
776
|
+
t && e.add(t);
|
|
777
|
+
});
|
|
778
|
+
}), this.__cache__ = Object.create(null), this.__cache__[""] = [], this.__rules__.forEach((e) => {
|
|
779
|
+
e.enabled && this.__cache__[""].push(e.fn);
|
|
780
|
+
}), e.forEach((e) => {
|
|
781
|
+
this.__cache__[e] = [], this.__rules__.forEach((t) => {
|
|
782
|
+
t.enabled && t.alt.indexOf(e) >= 0 && this.__cache__[e].push(t.fn);
|
|
783
|
+
});
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
at(e, t, n = {}) {
|
|
787
|
+
let r = this.__find__(e);
|
|
788
|
+
if (r === -1) throw Error(`Parser rule not found: ${e}`);
|
|
789
|
+
this.__rules__[r].fn = t, this.__rules__[r].alt = n.alt || [], this.__cache__ = null;
|
|
790
|
+
}
|
|
791
|
+
before(e, t, n, r = {}) {
|
|
792
|
+
let i = this.__find__(e);
|
|
793
|
+
if (i === -1) throw Error(`Parser rule not found: ${e}`);
|
|
794
|
+
this.__rules__.splice(i, 0, {
|
|
795
|
+
name: t,
|
|
796
|
+
enabled: !0,
|
|
797
|
+
fn: n,
|
|
798
|
+
alt: r.alt || []
|
|
799
|
+
}), this.__cache__ = null;
|
|
800
|
+
}
|
|
801
|
+
after(e, t, n, r = {}) {
|
|
802
|
+
let i = this.__find__(e);
|
|
803
|
+
if (i === -1) throw Error(`Parser rule not found: ${e}`);
|
|
804
|
+
this.__rules__.splice(i + 1, 0, {
|
|
805
|
+
name: t,
|
|
806
|
+
enabled: !0,
|
|
807
|
+
fn: n,
|
|
808
|
+
alt: r.alt || []
|
|
809
|
+
}), this.__cache__ = null;
|
|
810
|
+
}
|
|
811
|
+
push(e, t, n = {}) {
|
|
812
|
+
this.__rules__.push({
|
|
813
|
+
name: e,
|
|
814
|
+
enabled: !0,
|
|
815
|
+
fn: t,
|
|
816
|
+
alt: n.alt || []
|
|
817
|
+
}), this.__cache__ = null;
|
|
818
|
+
}
|
|
819
|
+
enable(e, t = !1) {
|
|
820
|
+
Array.isArray(e) || (e = [e]);
|
|
821
|
+
let n = [];
|
|
822
|
+
return e.forEach((e) => {
|
|
823
|
+
let r = this.__find__(e);
|
|
824
|
+
if (r < 0) {
|
|
825
|
+
if (t) return;
|
|
826
|
+
throw Error(`Rules manager: invalid rule name ${e}`);
|
|
827
|
+
}
|
|
828
|
+
this.__rules__[r].enabled = !0, n.push(e);
|
|
829
|
+
}), this.__cache__ = null, n;
|
|
830
|
+
}
|
|
831
|
+
enableOnly(e, t = !1) {
|
|
832
|
+
Array.isArray(e) || (e = [e]), this.__rules__.forEach((e) => {
|
|
833
|
+
e.enabled = !1;
|
|
834
|
+
}), this.enable(e, t);
|
|
835
|
+
}
|
|
836
|
+
disable(e, t = !1) {
|
|
837
|
+
Array.isArray(e) || (e = [e]);
|
|
838
|
+
let n = [];
|
|
839
|
+
return e.forEach((e) => {
|
|
840
|
+
let r = this.__find__(e);
|
|
841
|
+
if (r < 0) {
|
|
842
|
+
if (t) return;
|
|
843
|
+
throw Error(`Rules manager: invalid rule name ${e}`);
|
|
844
|
+
}
|
|
845
|
+
this.__rules__[r].enabled = !1, n.push(e);
|
|
846
|
+
}), this.__cache__ = null, n;
|
|
847
|
+
}
|
|
848
|
+
getRules(e) {
|
|
849
|
+
return this.__cache__ || this.__compile__(), this.__cache__[e] || [];
|
|
850
|
+
}
|
|
851
|
+
}, V = {};
|
|
852
|
+
V.code_inline = function(e, t, n, r, i) {
|
|
853
|
+
let a = e[t];
|
|
854
|
+
return `<code${i.renderAttrs(a)}>${M(a.content)}</code>`;
|
|
855
|
+
}, V.code_block = function(e, t, n, r, i) {
|
|
856
|
+
let a = e[t];
|
|
857
|
+
return `<pre${i.renderAttrs(a)}><code>${M(e[t].content)}</code></pre>\n`;
|
|
858
|
+
}, V.fence = function(e, t, n, r, i) {
|
|
859
|
+
let a = e[t], o = a.info ? j(a.info).trim() : "", s = "", c = "";
|
|
860
|
+
if (o) {
|
|
861
|
+
let e = o.split(/(\s+)/g);
|
|
862
|
+
s = e[0], c = e.slice(2).join("");
|
|
863
|
+
}
|
|
864
|
+
let l;
|
|
865
|
+
if (l = n.highlight && n.highlight(a.content, s, c) || M(a.content), l.indexOf("<pre") === 0) return l + "\n";
|
|
866
|
+
if (o) {
|
|
867
|
+
let e = a.attrIndex("class"), t = a.attrs ? a.attrs.slice() : [];
|
|
868
|
+
e < 0 ? t.push(["class", `${n.langPrefix}${s}`]) : (t[e] = [t[e][0], t[e][1]], t[e][1] += ` ${n.langPrefix}${s}`);
|
|
869
|
+
let r = { attrs: t };
|
|
870
|
+
return `<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`;
|
|
871
|
+
}
|
|
872
|
+
return `<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`;
|
|
873
|
+
}, V.image = function(e, t, n, r, i) {
|
|
874
|
+
let a = e[t];
|
|
875
|
+
return a.attrs[a.attrIndex("alt")][1] = i.renderInlineAsText(a.children, n, r), i.renderToken(e, t, n);
|
|
876
|
+
}, V.hardbreak = function(e, t, n) {
|
|
877
|
+
return n.xhtmlOut ? "<br />\n" : "<br>\n";
|
|
878
|
+
}, V.softbreak = function(e, t, n) {
|
|
879
|
+
return n.breaks ? n.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
|
|
880
|
+
}, V.text = function(e, t) {
|
|
881
|
+
return M(e[t].content);
|
|
882
|
+
}, V.html_block = function(e, t) {
|
|
883
|
+
return e[t].content;
|
|
884
|
+
}, V.html_inline = function(e, t) {
|
|
885
|
+
return e[t].content;
|
|
886
|
+
};
|
|
887
|
+
var Ze = class {
|
|
888
|
+
constructor() {
|
|
889
|
+
D(this, "rules", Object.assign({}, V));
|
|
890
|
+
}
|
|
891
|
+
renderAttrs(e) {
|
|
892
|
+
let t, n, r;
|
|
893
|
+
if (!e.attrs) return "";
|
|
894
|
+
for (r = "", t = 0, n = e.attrs.length; t < n; t++) r += ` ${M(e.attrs[t][0])}="${M(String(e.attrs[t][1]))}"`;
|
|
895
|
+
return r;
|
|
896
|
+
}
|
|
897
|
+
renderToken(e, t, n) {
|
|
898
|
+
let r = e[t], i = "";
|
|
899
|
+
if (r.hidden) return "";
|
|
900
|
+
let a = t - 1;
|
|
901
|
+
for (; a >= 0 && e[a].hidden && e[a].nesting === 0;) a--;
|
|
902
|
+
r.block && r.nesting !== -1 && a >= 0 && e[a].hidden && e[a].nesting === -1 && (i += "\n"), i += (r.nesting === -1 ? "</" : "<") + r.tag, i += this.renderAttrs(r), r.nesting === 0 && n.xhtmlOut && (i += " /");
|
|
903
|
+
let o = !1;
|
|
904
|
+
if (r.block && (o = !0, r.nesting === 1)) {
|
|
905
|
+
let n = t + 1;
|
|
906
|
+
for (; n < e.length && e[n].hidden && e[n].nesting === 0;) n++;
|
|
907
|
+
if (n < e.length) {
|
|
908
|
+
let t = e[n];
|
|
909
|
+
(t.type === "inline" || t.hidden || t.nesting === -1 && t.tag === r.tag) && (o = !1);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
return i += o ? ">\n" : ">", i;
|
|
913
|
+
}
|
|
914
|
+
renderInline(e, t, n) {
|
|
915
|
+
let r = "", i = this.rules;
|
|
916
|
+
for (let a = 0, o = e.length; a < o; a++) {
|
|
917
|
+
let o = e[a].type;
|
|
918
|
+
i[o] === void 0 ? r += this.renderToken(e, a, t) : r += i[o](e, a, t, n, this);
|
|
919
|
+
}
|
|
920
|
+
return r;
|
|
921
|
+
}
|
|
922
|
+
renderInlineAsText(e, t, n) {
|
|
923
|
+
let r = "";
|
|
924
|
+
for (let i = 0, a = e.length; i < a; i++) switch (e[i].type) {
|
|
925
|
+
case "text":
|
|
926
|
+
case "code_inline":
|
|
927
|
+
r += e[i].content;
|
|
928
|
+
break;
|
|
929
|
+
case "image":
|
|
930
|
+
r += this.renderInlineAsText(e[i].children, t, n);
|
|
931
|
+
break;
|
|
932
|
+
case "html_inline":
|
|
933
|
+
case "html_block":
|
|
934
|
+
r += e[i].content;
|
|
935
|
+
break;
|
|
936
|
+
case "softbreak":
|
|
937
|
+
case "hardbreak": r += "\n";
|
|
938
|
+
}
|
|
939
|
+
return r;
|
|
940
|
+
}
|
|
941
|
+
render(e, t, n) {
|
|
942
|
+
let r = "", i = this.rules;
|
|
943
|
+
for (let a = 0, o = e.length; a < o; a++) {
|
|
944
|
+
let o = e[a].type;
|
|
945
|
+
o === "inline" ? r += this.renderInline(e[a].children, t, n) : i[o] === void 0 ? r += this.renderToken(e, a, t) : r += i[o](e, a, t, n, this);
|
|
946
|
+
}
|
|
947
|
+
return r;
|
|
948
|
+
}
|
|
949
|
+
}, Qe = class {
|
|
950
|
+
constructor(e, t, n) {
|
|
951
|
+
D(this, "tokens", []), D(this, "inlineMode", !1), D(this, "Token", z), this.src = e, this.env = n, this.md = t;
|
|
952
|
+
}
|
|
953
|
+
}, $e = /\r\n?/g, et = /\0/g;
|
|
954
|
+
function tt(e) {
|
|
955
|
+
let t;
|
|
956
|
+
t = e.src.replace($e, "\n"), t = t.replace(et, "�"), e.src = t;
|
|
957
|
+
}
|
|
958
|
+
//#endregion
|
|
959
|
+
//#region src/rules_core/block.ts
|
|
960
|
+
function nt(e) {
|
|
961
|
+
let t;
|
|
962
|
+
e.inlineMode ? (t = new e.Token("inline", "", 0), t.content = e.src, t.map = [0, 1], t.children = [], e.tokens.push(t)) : e.md.block.parse(e.src, e.md, e.env, e.tokens);
|
|
963
|
+
}
|
|
964
|
+
//#endregion
|
|
965
|
+
//#region src/rules_core/strip_references.ts
|
|
966
|
+
function rt(e) {
|
|
967
|
+
let t = e.tokens, n = 0;
|
|
968
|
+
for (let e = 0; e < t.length; e++) t[e].type !== "reference_definition" && (e !== n && (t[n] = t[e]), n++);
|
|
969
|
+
t.length !== n && (t.length = n);
|
|
970
|
+
}
|
|
971
|
+
//#endregion
|
|
972
|
+
//#region src/rules_core/inline.ts
|
|
973
|
+
function it(e) {
|
|
974
|
+
let t = e.tokens;
|
|
975
|
+
for (let n = 0, r = t.length; n < r; n++) {
|
|
976
|
+
let r = t[n];
|
|
977
|
+
r.type === "inline" && e.md.inline.parse(r.content, e.md, e.env, r.children);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
//#endregion
|
|
981
|
+
//#region src/rules_core/linkify.ts
|
|
982
|
+
function at(e) {
|
|
983
|
+
return /^<a[>\s]/i.test(e);
|
|
984
|
+
}
|
|
985
|
+
function ot(e) {
|
|
986
|
+
return /^<\/a\s*>/i.test(e);
|
|
987
|
+
}
|
|
988
|
+
function st(e) {
|
|
989
|
+
let t = e.tokens;
|
|
990
|
+
if (e.md.options.linkify) for (let n = 0, r = t.length; n < r; n++) {
|
|
991
|
+
if (t[n].type !== "inline" || !e.md.linkify.test(t[n].content)) continue;
|
|
992
|
+
let r = t[n].children, i = [], a = 0;
|
|
993
|
+
for (let t = r.length - 1; t >= 0; t--) {
|
|
994
|
+
let n = r[t];
|
|
995
|
+
if (n.type === "link_close") for (t--; r[t].level !== n.level && r[t].type !== "link_open";) t--;
|
|
996
|
+
else if (n.type === "html_inline" && (at(n.content) && a > 0 && a--, ot(n.content) && a++), !(a > 0) && n.type === "text" && e.md.linkify.test(n.content)) {
|
|
997
|
+
let a = n.content, o = e.md.linkify.match(a), s = [], c = n.level, l = 0;
|
|
998
|
+
o.length > 0 && o[0].index === 0 && t > 0 && r[t - 1].type === "text_special" && (o = o.slice(1));
|
|
999
|
+
for (let t = 0; t < o.length; t++) {
|
|
1000
|
+
let n = o[t].url, r = e.md.normalizeLink(n);
|
|
1001
|
+
if (!e.md.validateLink(r)) continue;
|
|
1002
|
+
let i = o[t].text;
|
|
1003
|
+
i = o[t].schema ? o[t].schema === "mailto:" && !/^mailto:/i.test(i) ? e.md.normalizeLinkText(`mailto:${i}`).replace(/^mailto:/, "") : e.md.normalizeLinkText(i) : e.md.normalizeLinkText(`http://${i}`).replace(/^http:\/\//, "");
|
|
1004
|
+
let u = o[t].index;
|
|
1005
|
+
if (u > l) {
|
|
1006
|
+
let t = new e.Token("text", "", 0);
|
|
1007
|
+
t.content = a.slice(l, u), t.level = c, s.push(t);
|
|
1008
|
+
}
|
|
1009
|
+
let d = new e.Token("link_open", "a", 1);
|
|
1010
|
+
d.attrs = [["href", r]], d.level = c++, d.markup = "linkify", d.info = "auto", s.push(d);
|
|
1011
|
+
let f = new e.Token("text", "", 0);
|
|
1012
|
+
f.content = i, f.level = c, s.push(f);
|
|
1013
|
+
let p = new e.Token("link_close", "a", -1);
|
|
1014
|
+
p.level = --c, p.markup = "linkify", p.info = "auto", s.push(p), l = o[t].lastIndex;
|
|
1015
|
+
}
|
|
1016
|
+
if (l < a.length) {
|
|
1017
|
+
let t = new e.Token("text", "", 0);
|
|
1018
|
+
t.content = a.slice(l), t.level = c, s.push(t);
|
|
1019
|
+
}
|
|
1020
|
+
i.push({
|
|
1021
|
+
index: t,
|
|
1022
|
+
nodes: s
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
if (i.length > 0) {
|
|
1027
|
+
let e = r.length;
|
|
1028
|
+
for (let t of i) e += t.nodes.length - 1;
|
|
1029
|
+
let a = Array(e), o = 0, s = 0;
|
|
1030
|
+
i.reverse();
|
|
1031
|
+
for (let e = 0; e < r.length; e++) {
|
|
1032
|
+
let t = i[o];
|
|
1033
|
+
if ((t == null ? void 0 : t.index) === e) {
|
|
1034
|
+
for (let e of t.nodes) a[s++] = e;
|
|
1035
|
+
o++;
|
|
1036
|
+
} else a[s++] = r[e];
|
|
1037
|
+
}
|
|
1038
|
+
t[n].children = a;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
//#endregion
|
|
1043
|
+
//#region src/rules_core/replacements.ts
|
|
1044
|
+
var ct = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/, lt = /\((c|tm|r)\)/i, ut = /\((c|tm|r)\)/gi, dt = {
|
|
1045
|
+
c: "©",
|
|
1046
|
+
r: "®",
|
|
1047
|
+
tm: "™"
|
|
1048
|
+
};
|
|
1049
|
+
function ft(e, t) {
|
|
1050
|
+
return dt[t.toLowerCase()];
|
|
1051
|
+
}
|
|
1052
|
+
function pt(e) {
|
|
1053
|
+
let t = 0;
|
|
1054
|
+
for (let n = e.length - 1; n >= 0; n--) {
|
|
1055
|
+
let r = e[n];
|
|
1056
|
+
r.type === "text" && !t && (r.content = r.content.replace(ut, ft)), r.type === "link_open" && r.info === "auto" && t--, r.type === "link_close" && r.info === "auto" && t++;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
function mt(e) {
|
|
1060
|
+
let t = 0;
|
|
1061
|
+
for (let n = e.length - 1; n >= 0; n--) {
|
|
1062
|
+
let r = e[n];
|
|
1063
|
+
r.type === "text" && !t && ct.test(r.content) && (r.content = r.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/gm, "$1—").replace(/(^|\s)--(?=\s|$)/gm, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm, "$1–")), r.type === "link_open" && r.info === "auto" && t--, r.type === "link_close" && r.info === "auto" && t++;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
function ht(e) {
|
|
1067
|
+
let t;
|
|
1068
|
+
if (e.md.options.typographer) for (t = e.tokens.length - 1; t >= 0; t--) e.tokens[t].type === "inline" && (lt.test(e.tokens[t].content) && pt(e.tokens[t].children), ct.test(e.tokens[t].content) && mt(e.tokens[t].children));
|
|
1069
|
+
}
|
|
1070
|
+
//#endregion
|
|
1071
|
+
//#region src/rules_core/smartquotes.ts
|
|
1072
|
+
var gt = /['"]/, _t = /['"]/g, vt = "’", yt = 1e3;
|
|
1073
|
+
function bt(e, t, n) {
|
|
1074
|
+
for (; e.length > n;) {
|
|
1075
|
+
let n = e.pop();
|
|
1076
|
+
n.isSingleQuote ? t.single = n.prevSameQuoteIdx : t.double = n.prevSameQuoteIdx;
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
function H(e, t, n, r) {
|
|
1080
|
+
e[t] || (e[t] = []), e[t].push({
|
|
1081
|
+
pos: n,
|
|
1082
|
+
ch: r
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
function xt(e, t) {
|
|
1086
|
+
let n = "", r = 0;
|
|
1087
|
+
t.sort((e, t) => e.pos - t.pos);
|
|
1088
|
+
for (let i = 0; i < t.length; i++) {
|
|
1089
|
+
let a = t[i];
|
|
1090
|
+
n += e.slice(r, a.pos) + a.ch, r = a.pos + 1;
|
|
1091
|
+
}
|
|
1092
|
+
return n + e.slice(r);
|
|
1093
|
+
}
|
|
1094
|
+
function St(e, t) {
|
|
1095
|
+
let n, r = [], i = {
|
|
1096
|
+
single: -1,
|
|
1097
|
+
double: -1
|
|
1098
|
+
}, a = {};
|
|
1099
|
+
for (let o = 0; o < e.length; o++) {
|
|
1100
|
+
let s = e[o], c = e[o].level;
|
|
1101
|
+
for (n = r.length - 1; n >= 0 && !(r[n].level <= c); n--);
|
|
1102
|
+
if (bt(r, i, n + 1), s.type !== "text") continue;
|
|
1103
|
+
let l = s.content, u = 0, d = l.length;
|
|
1104
|
+
OUTER: for (; u < d;) {
|
|
1105
|
+
_t.lastIndex = u;
|
|
1106
|
+
let s = _t.exec(l);
|
|
1107
|
+
if (!s) break;
|
|
1108
|
+
let f = !0, p = !0;
|
|
1109
|
+
u = s.index + 1;
|
|
1110
|
+
let m = s[0] === "'", h = 32;
|
|
1111
|
+
if (s.index - 1 >= 0) h = l.charCodeAt(s.index - 1);
|
|
1112
|
+
else for (n = o - 1; n >= 0 && e[n].type !== "softbreak" && e[n].type !== "hardbreak"; n--) if (e[n].content) {
|
|
1113
|
+
h = e[n].content.charCodeAt(e[n].content.length - 1);
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
1116
|
+
let g = 32;
|
|
1117
|
+
if (u < d) g = l.charCodeAt(u);
|
|
1118
|
+
else for (n = o + 1; n < e.length && e[n].type !== "softbreak" && e[n].type !== "hardbreak"; n++) if (e[n].content) {
|
|
1119
|
+
g = e[n].content.charCodeAt(0);
|
|
1120
|
+
break;
|
|
1121
|
+
}
|
|
1122
|
+
let _ = I(h) || F(h), v = I(g) || F(g), y = P(h), b = P(g);
|
|
1123
|
+
if (b ? f = !1 : v && (y || _ || (f = !1)), y ? p = !1 : _ && (b || v || (p = !1)), g === 34 && s[0] === "\"" && h >= 48 && h <= 57 && (p = f = !1), f && p && (f = _, p = v), !f && !p) m && H(a, o, s.index, vt);
|
|
1124
|
+
else {
|
|
1125
|
+
if (p && (n = m ? i.single : i.double, n >= 0 && r[n].level === c)) {
|
|
1126
|
+
let e = r[n], c, l;
|
|
1127
|
+
m ? (c = t.md.options.quotes[2], l = t.md.options.quotes[3]) : (c = t.md.options.quotes[0], l = t.md.options.quotes[1]), H(a, o, s.index, l), H(a, e.tokenIdx, e.contentPos, c), bt(r, i, n);
|
|
1128
|
+
continue OUTER;
|
|
1129
|
+
}
|
|
1130
|
+
if (f) {
|
|
1131
|
+
if (r.length >= yt) return;
|
|
1132
|
+
r.push({
|
|
1133
|
+
tokenIdx: o,
|
|
1134
|
+
contentPos: s.index,
|
|
1135
|
+
isSingleQuote: m,
|
|
1136
|
+
level: c,
|
|
1137
|
+
prevSameQuoteIdx: m ? i.single : i.double
|
|
1138
|
+
}), m ? i.single = r.length - 1 : i.double = r.length - 1;
|
|
1139
|
+
} else p && m && H(a, o, s.index, vt);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
Object.keys(a).forEach(function(t) {
|
|
1144
|
+
let n = Number(t);
|
|
1145
|
+
e[n].content = xt(e[n].content, a[t]);
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
function Ct(e) {
|
|
1149
|
+
if (e.md.options.typographer) for (let t = e.tokens.length - 1; t >= 0; t--) e.tokens[t].type === "inline" && gt.test(e.tokens[t].content) && St(e.tokens[t].children, e);
|
|
1150
|
+
}
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region src/rules_core/text_join.ts
|
|
1153
|
+
function wt(e) {
|
|
1154
|
+
let t, n, r = e.length;
|
|
1155
|
+
for (t = 0; t < r; t++) e[t].type === "text_special" && (e[t].type = "text");
|
|
1156
|
+
for (t = n = 0; t < r; t++) e[t].type === "text" && t + 1 < r && e[t + 1].type === "text" ? e[t + 1].content = e[t].content + e[t + 1].content : (t !== n && (e[n] = e[t]), n++);
|
|
1157
|
+
t !== n && (e.length = n);
|
|
1158
|
+
}
|
|
1159
|
+
function Tt(e) {
|
|
1160
|
+
let t, n, r = e.tokens, i = r.length;
|
|
1161
|
+
for (let e = 0; e < i; e++) {
|
|
1162
|
+
if (r[e].type !== "inline") continue;
|
|
1163
|
+
let i = r[e].children, a = i.length;
|
|
1164
|
+
for (t = 0; t < a; t++) i[t].type === "text_special" && (i[t].type = "text"), i[t].children && wt(i[t].children);
|
|
1165
|
+
for (t = n = 0; t < a; t++) i[t].type === "text" && t + 1 < a && i[t + 1].type === "text" ? i[t + 1].content = i[t].content + i[t + 1].content : (t !== n && (i[n] = i[t]), n++);
|
|
1166
|
+
t !== n && (i.length = n);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
//#endregion
|
|
1170
|
+
//#region src/parser_core.ts
|
|
1171
|
+
var U = [
|
|
1172
|
+
["normalize", tt],
|
|
1173
|
+
["block", nt],
|
|
1174
|
+
["strip_references", rt],
|
|
1175
|
+
["inline", it],
|
|
1176
|
+
["linkify", st],
|
|
1177
|
+
["replacements", ht],
|
|
1178
|
+
["smartquotes", Ct],
|
|
1179
|
+
["text_join", Tt]
|
|
1180
|
+
], Et = class {
|
|
1181
|
+
constructor() {
|
|
1182
|
+
D(this, "ruler", new B()), D(this, "State", Qe);
|
|
1183
|
+
for (let e = 0; e < U.length; e++) this.ruler.push(U[e][0], U[e][1]);
|
|
1184
|
+
}
|
|
1185
|
+
process(e) {
|
|
1186
|
+
let t = this.ruler.getRules("");
|
|
1187
|
+
for (let n = 0, r = t.length; n < r; n++) t[n](e);
|
|
1188
|
+
}
|
|
1189
|
+
}, Dt = class {
|
|
1190
|
+
constructor(e, t, n, r) {
|
|
1191
|
+
D(this, "bMarks", []), D(this, "eMarks", []), D(this, "tShift", []), D(this, "sCount", []), D(this, "bsCount", []), D(this, "blkIndent", 0), D(this, "line", 0), D(this, "lineMax", 0), D(this, "tight", !1), D(this, "listIndent", -1), D(this, "parentType", "root"), D(this, "level", 0), D(this, "Token", z), this.src = e, this.md = t, this.env = n, this.tokens = r;
|
|
1192
|
+
let i = this.src;
|
|
1193
|
+
for (let e = 0, t = 0, n = 0, r = 0, a = i.length, o = !1; t < a; t++) {
|
|
1194
|
+
let s = i.charCodeAt(t);
|
|
1195
|
+
if (!o) {
|
|
1196
|
+
if (N(s)) {
|
|
1197
|
+
n++, s === 9 ? r += 4 - r % 4 : r++;
|
|
1198
|
+
continue;
|
|
1199
|
+
}
|
|
1200
|
+
o = !0;
|
|
1201
|
+
}
|
|
1202
|
+
(s === 10 || t === a - 1) && (s !== 10 && t++, this.bMarks.push(e), this.eMarks.push(t), this.tShift.push(n), this.sCount.push(r), this.bsCount.push(0), o = !1, n = 0, r = 0, e = t + 1);
|
|
1203
|
+
}
|
|
1204
|
+
this.bMarks.push(i.length), this.eMarks.push(i.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
|
|
1205
|
+
}
|
|
1206
|
+
push(e, t, n) {
|
|
1207
|
+
let r = new z(e, t, n);
|
|
1208
|
+
return r.block = !0, n < 0 && this.level--, r.level = this.level, n > 0 && this.level++, this.tokens.push(r), r;
|
|
1209
|
+
}
|
|
1210
|
+
isEmpty(e) {
|
|
1211
|
+
return this.bMarks[e] + this.tShift[e] >= this.eMarks[e];
|
|
1212
|
+
}
|
|
1213
|
+
skipEmptyLines(e) {
|
|
1214
|
+
for (let t = this.lineMax; e < t && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); e++);
|
|
1215
|
+
return e;
|
|
1216
|
+
}
|
|
1217
|
+
skipSpaces(e) {
|
|
1218
|
+
for (let t = this.src.length; e < t && N(this.src.charCodeAt(e)); e++);
|
|
1219
|
+
return e;
|
|
1220
|
+
}
|
|
1221
|
+
skipSpacesBack(e, t) {
|
|
1222
|
+
if (e <= t) return e;
|
|
1223
|
+
for (; e > t;) if (!N(this.src.charCodeAt(--e))) return e + 1;
|
|
1224
|
+
return e;
|
|
1225
|
+
}
|
|
1226
|
+
skipChars(e, t) {
|
|
1227
|
+
for (let n = this.src.length; e < n && this.src.charCodeAt(e) === t; e++);
|
|
1228
|
+
return e;
|
|
1229
|
+
}
|
|
1230
|
+
skipCharsBack(e, t, n) {
|
|
1231
|
+
if (e <= n) return e;
|
|
1232
|
+
for (; e > n;) if (t !== this.src.charCodeAt(--e)) return e + 1;
|
|
1233
|
+
return e;
|
|
1234
|
+
}
|
|
1235
|
+
getLines(e, t, n, r) {
|
|
1236
|
+
if (e >= t) return "";
|
|
1237
|
+
let i = Array(t - e);
|
|
1238
|
+
for (let a = 0, o = e; o < t; o++, a++) {
|
|
1239
|
+
let e = 0, s = this.bMarks[o], c = s, l;
|
|
1240
|
+
for (l = o + 1 < t || r ? this.eMarks[o] + 1 : this.eMarks[o]; c < l && e < n;) {
|
|
1241
|
+
let t = this.src.charCodeAt(c);
|
|
1242
|
+
if (N(t)) t === 9 ? e += 4 - (e + this.bsCount[o]) % 4 : e++;
|
|
1243
|
+
else if (c - s < this.tShift[o]) e++;
|
|
1244
|
+
else break;
|
|
1245
|
+
c++;
|
|
1246
|
+
}
|
|
1247
|
+
e > n ? i[a] = Array(e - n + 1).join(" ") + this.src.slice(c, l) : i[a] = this.src.slice(c, l);
|
|
1248
|
+
}
|
|
1249
|
+
return i.join("");
|
|
1250
|
+
}
|
|
1251
|
+
}, Ot = 65536;
|
|
1252
|
+
function kt(e, t) {
|
|
1253
|
+
let n = e.bMarks[t] + e.tShift[t], r = e.eMarks[t];
|
|
1254
|
+
return e.src.slice(n, r);
|
|
1255
|
+
}
|
|
1256
|
+
function At(e) {
|
|
1257
|
+
let t = [], n = e.length, r = 0, i = e.charCodeAt(r), a = !1, o = 0, s = "";
|
|
1258
|
+
for (; r < n;) i === 124 && (a ? (s += e.substring(o, r - 1), o = r) : (t.push(s + e.substring(o, r)), s = "", o = r + 1)), a = i === 92, r++, i = e.charCodeAt(r);
|
|
1259
|
+
return t.push(s + e.substring(o)), t;
|
|
1260
|
+
}
|
|
1261
|
+
function jt(e, t, n, r) {
|
|
1262
|
+
if (t + 2 > n) return !1;
|
|
1263
|
+
let i = t + 1;
|
|
1264
|
+
if (e.sCount[i] < e.blkIndent || e.sCount[i] - e.blkIndent >= 4) return !1;
|
|
1265
|
+
let a = e.bMarks[i] + e.tShift[i];
|
|
1266
|
+
if (a >= e.eMarks[i]) return !1;
|
|
1267
|
+
let o = e.src.charCodeAt(a++);
|
|
1268
|
+
if (o !== 124 && o !== 45 && o !== 58 || a >= e.eMarks[i]) return !1;
|
|
1269
|
+
let s = e.src.charCodeAt(a++);
|
|
1270
|
+
if (s !== 124 && s !== 45 && s !== 58 && !N(s) || o === 45 && N(s)) return !1;
|
|
1271
|
+
for (; a < e.eMarks[i];) {
|
|
1272
|
+
let t = e.src.charCodeAt(a);
|
|
1273
|
+
if (t !== 124 && t !== 45 && t !== 58 && !N(t)) return !1;
|
|
1274
|
+
a++;
|
|
1275
|
+
}
|
|
1276
|
+
let c = kt(e, t + 1), l = c.split("|"), u = [];
|
|
1277
|
+
for (let e = 0; e < l.length; e++) {
|
|
1278
|
+
let t = l[e].trim();
|
|
1279
|
+
if (!t) {
|
|
1280
|
+
if (e === 0 || e === l.length - 1) continue;
|
|
1281
|
+
return !1;
|
|
1282
|
+
}
|
|
1283
|
+
if (!/^:?-+:?$/.test(t)) return !1;
|
|
1284
|
+
t.charCodeAt(t.length - 1) === 58 ? u.push(t.charCodeAt(0) === 58 ? "center" : "right") : t.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
|
1285
|
+
}
|
|
1286
|
+
if (c = kt(e, t).trim(), c.indexOf("|") === -1 || e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1287
|
+
l = At(c), l.length && l[0] === "" && l.shift(), l.length && l[l.length - 1] === "" && l.pop();
|
|
1288
|
+
let d = l.length;
|
|
1289
|
+
if (d === 0 || d !== u.length) return !1;
|
|
1290
|
+
if (r) return !0;
|
|
1291
|
+
let f = e.parentType;
|
|
1292
|
+
e.parentType = "table";
|
|
1293
|
+
let p = e.md.block.ruler.getRules("blockquote"), m = e.push("table_open", "table", 1), h = [t, 0];
|
|
1294
|
+
m.map = h;
|
|
1295
|
+
let g = e.push("thead_open", "thead", 1);
|
|
1296
|
+
g.map = [t, t + 1];
|
|
1297
|
+
let _ = e.push("tr_open", "tr", 1);
|
|
1298
|
+
_.map = [t, t + 1];
|
|
1299
|
+
for (let t = 0; t < l.length; t++) {
|
|
1300
|
+
let n = e.push("th_open", "th", 1);
|
|
1301
|
+
u[t] && (n.attrs = [["style", `text-align:${u[t]}`]]);
|
|
1302
|
+
let r = e.push("inline", "", 0);
|
|
1303
|
+
r.content = l[t].trim(), r.children = [], e.push("th_close", "th", -1);
|
|
1304
|
+
}
|
|
1305
|
+
e.push("tr_close", "tr", -1), e.push("thead_close", "thead", -1);
|
|
1306
|
+
let v, y = 0;
|
|
1307
|
+
for (i = t + 2; i < n && !(e.sCount[i] < e.blkIndent); i++) {
|
|
1308
|
+
let r = !1;
|
|
1309
|
+
for (let t = 0, a = p.length; t < a; t++) if (p[t](e, i, n, !0)) {
|
|
1310
|
+
r = !0;
|
|
1311
|
+
break;
|
|
1312
|
+
}
|
|
1313
|
+
if (r || (c = kt(e, i).trim(), !c) || e.sCount[i] - e.blkIndent >= 4 || (l = At(c), l.length && l[0] === "" && l.shift(), l.length && l[l.length - 1] === "" && l.pop(), y += d - l.length, y > Ot)) break;
|
|
1314
|
+
if (i === t + 2) {
|
|
1315
|
+
let n = e.push("tbody_open", "tbody", 1);
|
|
1316
|
+
n.map = v = [t + 2, 0];
|
|
1317
|
+
}
|
|
1318
|
+
let a = e.push("tr_open", "tr", 1);
|
|
1319
|
+
a.map = [i, i + 1];
|
|
1320
|
+
for (let t = 0; t < d; t++) {
|
|
1321
|
+
let n = e.push("td_open", "td", 1);
|
|
1322
|
+
u[t] && (n.attrs = [["style", `text-align:${u[t]}`]]);
|
|
1323
|
+
let r = e.push("inline", "", 0);
|
|
1324
|
+
r.content = l[t] ? l[t].trim() : "", r.children = [], e.push("td_close", "td", -1);
|
|
1325
|
+
}
|
|
1326
|
+
e.push("tr_close", "tr", -1);
|
|
1327
|
+
}
|
|
1328
|
+
return v && (e.push("tbody_close", "tbody", -1), v[1] = i), e.push("table_close", "table", -1), h[1] = i, e.parentType = f, e.line = i, !0;
|
|
1329
|
+
}
|
|
1330
|
+
//#endregion
|
|
1331
|
+
//#region src/rules_block/code.ts
|
|
1332
|
+
function Mt(e, t, n) {
|
|
1333
|
+
if (e.sCount[t] - e.blkIndent < 4) return !1;
|
|
1334
|
+
let r = t + 1, i = r;
|
|
1335
|
+
for (; r < n;) if (e.isEmpty(r)) r++;
|
|
1336
|
+
else if (e.sCount[r] - e.blkIndent >= 4) r++, i = r;
|
|
1337
|
+
else break;
|
|
1338
|
+
e.line = i;
|
|
1339
|
+
let a = e.push("code_block", "code", 0);
|
|
1340
|
+
return a.content = e.getLines(t, i, 4 + e.blkIndent, !1) + "\n", a.map = [t, e.line], !0;
|
|
1341
|
+
}
|
|
1342
|
+
//#endregion
|
|
1343
|
+
//#region src/rules_block/fence.ts
|
|
1344
|
+
function Nt(e, t, n, r) {
|
|
1345
|
+
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t];
|
|
1346
|
+
if (e.sCount[t] - e.blkIndent >= 4 || i + 3 > a) return !1;
|
|
1347
|
+
let o = e.src.charCodeAt(i);
|
|
1348
|
+
if (o !== 126 && o !== 96) return !1;
|
|
1349
|
+
let s = i;
|
|
1350
|
+
i = e.skipChars(i, o);
|
|
1351
|
+
let c = i - s;
|
|
1352
|
+
if (c < 3) return !1;
|
|
1353
|
+
let l = e.src.slice(s, i), u = e.src.slice(i, a);
|
|
1354
|
+
if (o === 96 && u.indexOf(String.fromCharCode(o)) >= 0) return !1;
|
|
1355
|
+
if (r) return !0;
|
|
1356
|
+
let d = t, f = !1;
|
|
1357
|
+
for (; d++, !(d >= n || (i = s = e.bMarks[d] + e.tShift[d], a = e.eMarks[d], i < a && e.sCount[d] < e.blkIndent));) if (e.src.charCodeAt(i) === o && !(e.sCount[d] - e.blkIndent >= 4) && (i = e.skipChars(i, o), !(i - s < c) && (i = e.skipSpaces(i), !(i < a)))) {
|
|
1358
|
+
f = !0;
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
c = e.sCount[t], e.line = d + +!!f;
|
|
1362
|
+
let p = e.push("fence", "code", 0);
|
|
1363
|
+
return p.info = u, p.content = e.getLines(t + 1, d, c, !0), p.markup = l, p.map = [t, e.line], !0;
|
|
1364
|
+
}
|
|
1365
|
+
//#endregion
|
|
1366
|
+
//#region src/rules_block/blockquote.ts
|
|
1367
|
+
function Pt(e, t, n, r) {
|
|
1368
|
+
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t], o = e.lineMax;
|
|
1369
|
+
if (e.sCount[t] - e.blkIndent >= 4 || e.src.charCodeAt(i) !== 62) return !1;
|
|
1370
|
+
if (r) return !0;
|
|
1371
|
+
let s = [], c = [], l = [], u = [], d = e.md.block.ruler.getRules("blockquote"), f = e.parentType;
|
|
1372
|
+
e.parentType = "blockquote";
|
|
1373
|
+
let p = !1, m;
|
|
1374
|
+
for (m = t; m < n; m++) {
|
|
1375
|
+
let t = e.sCount[m] < e.blkIndent;
|
|
1376
|
+
if (i = e.bMarks[m] + e.tShift[m], a = e.eMarks[m], i >= a) break;
|
|
1377
|
+
if (e.src.charCodeAt(i++) === 62 && !t) {
|
|
1378
|
+
let t = e.sCount[m] + 1, n, r;
|
|
1379
|
+
e.src.charCodeAt(i) === 32 ? (i++, t++, r = !1, n = !0) : e.src.charCodeAt(i) === 9 ? (n = !0, (e.bsCount[m] + t) % 4 == 3 ? (i++, t++, r = !1) : r = !0) : n = !1;
|
|
1380
|
+
let o = t;
|
|
1381
|
+
for (s.push(e.bMarks[m]), e.bMarks[m] = i; i < a;) {
|
|
1382
|
+
let t = e.src.charCodeAt(i);
|
|
1383
|
+
if (N(t)) t === 9 ? o += 4 - (o + e.bsCount[m] + +!!r) % 4 : o++;
|
|
1384
|
+
else break;
|
|
1385
|
+
i++;
|
|
1386
|
+
}
|
|
1387
|
+
p = i >= a, c.push(e.bsCount[m]), e.bsCount[m] = e.sCount[m] + 1 + +!!n, l.push(e.sCount[m]), e.sCount[m] = o - t, u.push(e.tShift[m]), e.tShift[m] = i - e.bMarks[m];
|
|
1388
|
+
continue;
|
|
1389
|
+
}
|
|
1390
|
+
if (p) break;
|
|
1391
|
+
let r = !1;
|
|
1392
|
+
for (let t = 0, i = d.length; t < i; t++) if (d[t](e, m, n, !0)) {
|
|
1393
|
+
r = !0;
|
|
1394
|
+
break;
|
|
1395
|
+
}
|
|
1396
|
+
if (r) {
|
|
1397
|
+
e.lineMax = m, e.blkIndent !== 0 && (s.push(e.bMarks[m]), c.push(e.bsCount[m]), u.push(e.tShift[m]), l.push(e.sCount[m]), e.sCount[m] -= e.blkIndent);
|
|
1398
|
+
break;
|
|
1399
|
+
}
|
|
1400
|
+
s.push(e.bMarks[m]), c.push(e.bsCount[m]), u.push(e.tShift[m]), l.push(e.sCount[m]), e.sCount[m] = -1;
|
|
1401
|
+
}
|
|
1402
|
+
let h = e.blkIndent;
|
|
1403
|
+
e.blkIndent = 0;
|
|
1404
|
+
let g = e.push("blockquote_open", "blockquote", 1);
|
|
1405
|
+
g.markup = ">";
|
|
1406
|
+
let _ = [t, 0];
|
|
1407
|
+
g.map = _, e.md.block.tokenize(e, t, m);
|
|
1408
|
+
let v = e.push("blockquote_close", "blockquote", -1);
|
|
1409
|
+
v.markup = ">", e.lineMax = o, e.parentType = f, _[1] = e.line;
|
|
1410
|
+
for (let n = 0; n < u.length; n++) e.bMarks[n + t] = s[n], e.tShift[n + t] = u[n], e.sCount[n + t] = l[n], e.bsCount[n + t] = c[n];
|
|
1411
|
+
return e.blkIndent = h, !0;
|
|
1412
|
+
}
|
|
1413
|
+
//#endregion
|
|
1414
|
+
//#region src/rules_block/hr.ts
|
|
1415
|
+
function Ft(e, t, n, r) {
|
|
1416
|
+
let i = e.eMarks[t];
|
|
1417
|
+
if (e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1418
|
+
let a = e.bMarks[t] + e.tShift[t], o = e.src.charCodeAt(a++);
|
|
1419
|
+
if (o !== 42 && o !== 45 && o !== 95) return !1;
|
|
1420
|
+
let s = 1;
|
|
1421
|
+
for (; a < i;) {
|
|
1422
|
+
let t = e.src.charCodeAt(a++);
|
|
1423
|
+
if (t !== o && !N(t)) return !1;
|
|
1424
|
+
t === o && s++;
|
|
1425
|
+
}
|
|
1426
|
+
if (s < 3) return !1;
|
|
1427
|
+
if (r) return !0;
|
|
1428
|
+
e.line = t + 1;
|
|
1429
|
+
let c = e.push("hr", "hr", 0);
|
|
1430
|
+
return c.map = [t, e.line], c.markup = Array(s + 1).join(String.fromCharCode(o)), !0;
|
|
1431
|
+
}
|
|
1432
|
+
//#endregion
|
|
1433
|
+
//#region src/rules_block/list.ts
|
|
1434
|
+
function It(e, t) {
|
|
1435
|
+
let n = e.eMarks[t], r = e.bMarks[t] + e.tShift[t], i = e.src.charCodeAt(r++);
|
|
1436
|
+
return i !== 42 && i !== 45 && i !== 43 || r < n && !N(e.src.charCodeAt(r)) ? -1 : r;
|
|
1437
|
+
}
|
|
1438
|
+
function Lt(e, t) {
|
|
1439
|
+
let n = e.bMarks[t] + e.tShift[t], r = e.eMarks[t], i = n;
|
|
1440
|
+
if (i + 1 >= r) return -1;
|
|
1441
|
+
let a = e.src.charCodeAt(i++);
|
|
1442
|
+
if (a < 48 || a > 57) return -1;
|
|
1443
|
+
for (;;) {
|
|
1444
|
+
if (i >= r) return -1;
|
|
1445
|
+
if (a = e.src.charCodeAt(i++), a >= 48 && a <= 57) {
|
|
1446
|
+
if (i - n >= 10) return -1;
|
|
1447
|
+
} else {
|
|
1448
|
+
if (a === 41 || a === 46) break;
|
|
1449
|
+
return -1;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
return i < r && (a = e.src.charCodeAt(i), !N(a)) ? -1 : i;
|
|
1453
|
+
}
|
|
1454
|
+
function Rt(e, t) {
|
|
1455
|
+
let n = e.level + 2;
|
|
1456
|
+
for (let r = t + 2, i = e.tokens.length - 2; r < i; r++) e.tokens[r].level === n && e.tokens[r].type === "paragraph_open" && (e.tokens[r + 2].hidden = !0, e.tokens[r].hidden = !0, r += 2);
|
|
1457
|
+
}
|
|
1458
|
+
function zt(e, t, n, r) {
|
|
1459
|
+
let i, a, o, s, c = t, l = !0;
|
|
1460
|
+
if (e.sCount[c] - e.blkIndent >= 4 || e.listIndent >= 0 && e.sCount[c] - e.listIndent >= 4 && e.sCount[c] < e.blkIndent) return !1;
|
|
1461
|
+
let u = !1;
|
|
1462
|
+
r && e.parentType === "paragraph" && e.sCount[c] >= e.blkIndent && (u = !0);
|
|
1463
|
+
let d, f, p;
|
|
1464
|
+
if ((p = Lt(e, c)) >= 0) {
|
|
1465
|
+
if (d = !0, o = e.bMarks[c] + e.tShift[c], f = Number(e.src.slice(o, p - 1)), u && f !== 1) return !1;
|
|
1466
|
+
} else if ((p = It(e, c)) >= 0) d = !1;
|
|
1467
|
+
else return !1;
|
|
1468
|
+
if (u && e.skipSpaces(p) >= e.eMarks[c]) return !1;
|
|
1469
|
+
if (r) return !0;
|
|
1470
|
+
let m = e.src.charCodeAt(p - 1), h = e.tokens.length;
|
|
1471
|
+
d ? (s = e.push("ordered_list_open", "ol", 1), f !== 1 && (s.attrs = [["start", f]])) : s = e.push("bullet_list_open", "ul", 1);
|
|
1472
|
+
let g = [c, 0];
|
|
1473
|
+
s.map = g, s.markup = String.fromCharCode(m);
|
|
1474
|
+
let _ = !1, v = e.md.block.ruler.getRules("list"), y = e.parentType;
|
|
1475
|
+
for (e.parentType = "list"; c < n;) {
|
|
1476
|
+
a = p, i = e.eMarks[c];
|
|
1477
|
+
let t = e.sCount[c] + p - (e.bMarks[c] + e.tShift[c]), r = t;
|
|
1478
|
+
for (; a < i;) {
|
|
1479
|
+
let t = e.src.charCodeAt(a);
|
|
1480
|
+
if (t === 9) r += 4 - (r + e.bsCount[c]) % 4;
|
|
1481
|
+
else if (t === 32) r++;
|
|
1482
|
+
else break;
|
|
1483
|
+
a++;
|
|
1484
|
+
}
|
|
1485
|
+
let u = a, f;
|
|
1486
|
+
f = u >= i ? 1 : r - t, f > 4 && (f = 1);
|
|
1487
|
+
let h = t + f;
|
|
1488
|
+
s = e.push("list_item_open", "li", 1), s.markup = String.fromCharCode(m);
|
|
1489
|
+
let g = [c, 0];
|
|
1490
|
+
s.map = g, d && (s.info = e.src.slice(o, p - 1));
|
|
1491
|
+
let y = e.tight, b = e.tShift[c], x = e.sCount[c], S = e.listIndent;
|
|
1492
|
+
if (e.listIndent = e.blkIndent, e.blkIndent = h, e.tight = !0, e.tShift[c] = u - e.bMarks[c], e.sCount[c] = r, u >= i && e.isEmpty(c + 1) ? e.line = Math.min(e.line + 2, n) : e.md.block.tokenize(e, c, n), (!e.tight || _) && (l = !1), _ = e.line - c > 1 && e.isEmpty(e.line - 1), e.blkIndent = e.listIndent, e.listIndent = S, e.tShift[c] = b, e.sCount[c] = x, e.tight = y, s = e.push("list_item_close", "li", -1), s.markup = String.fromCharCode(m), c = e.line, g[1] = c, c >= n || e.sCount[c] < e.blkIndent || e.sCount[c] - e.blkIndent >= 4) break;
|
|
1493
|
+
let C = !1;
|
|
1494
|
+
for (let t = 0, r = v.length; t < r; t++) if (v[t](e, c, n, !0)) {
|
|
1495
|
+
C = !0;
|
|
1496
|
+
break;
|
|
1497
|
+
}
|
|
1498
|
+
if (C) break;
|
|
1499
|
+
if (d) {
|
|
1500
|
+
if (p = Lt(e, c), p < 0) break;
|
|
1501
|
+
o = e.bMarks[c] + e.tShift[c];
|
|
1502
|
+
} else if (p = It(e, c), p < 0) break;
|
|
1503
|
+
if (m !== e.src.charCodeAt(p - 1)) break;
|
|
1504
|
+
}
|
|
1505
|
+
return s = d ? e.push("ordered_list_close", "ol", -1) : e.push("bullet_list_close", "ul", -1), s.markup = String.fromCharCode(m), g[1] = c, e.line = c, e.parentType = y, l && Rt(e, h), !0;
|
|
1506
|
+
}
|
|
1507
|
+
//#endregion
|
|
1508
|
+
//#region src/rules_block/reference.ts
|
|
1509
|
+
var Bt = 999;
|
|
1510
|
+
function Vt(e) {
|
|
1511
|
+
let t = e.length;
|
|
1512
|
+
for (let n = 0; n < e.length - 1; n++) {
|
|
1513
|
+
let r = e.charCodeAt(n);
|
|
1514
|
+
if (r < 55296 || r > 56319) continue;
|
|
1515
|
+
let i = e.charCodeAt(n + 1);
|
|
1516
|
+
i >= 56320 && i <= 57343 && (t--, n++);
|
|
1517
|
+
}
|
|
1518
|
+
return t;
|
|
1519
|
+
}
|
|
1520
|
+
function W(e, t) {
|
|
1521
|
+
return Math.min(e.eMarks[t] + 1, e.src.length);
|
|
1522
|
+
}
|
|
1523
|
+
function G(e, t) {
|
|
1524
|
+
let n = e.lineMax;
|
|
1525
|
+
if (t >= n || e.isEmpty(t)) return -1;
|
|
1526
|
+
let r = !1;
|
|
1527
|
+
if (e.sCount[t] - e.blkIndent > 3 && (r = !0), e.sCount[t] < 0 && (r = !0), !r) {
|
|
1528
|
+
let r = e.md.block.ruler.getRules("reference"), i = e.parentType;
|
|
1529
|
+
e.parentType = "reference";
|
|
1530
|
+
let a = !1;
|
|
1531
|
+
for (let i = 0, o = r.length; i < o; i++) if (r[i](e, t, n, !0)) {
|
|
1532
|
+
a = !0;
|
|
1533
|
+
break;
|
|
1534
|
+
}
|
|
1535
|
+
if (e.parentType = i, a) return -1;
|
|
1536
|
+
}
|
|
1537
|
+
return e.bMarks[t] + e.tShift[t];
|
|
1538
|
+
}
|
|
1539
|
+
function Ht(e, t, n, r) {
|
|
1540
|
+
let i = e.src, a = e.bMarks[t] + e.tShift[t], o = t + 1;
|
|
1541
|
+
if (e.sCount[t] - e.blkIndent >= 4 || i.charCodeAt(a) !== 91) return !1;
|
|
1542
|
+
let s = W(e, t), c = "", l = -1, u = ++a;
|
|
1543
|
+
for (; a < s;) {
|
|
1544
|
+
if (c.length + a - u > Bt * 2) return !1;
|
|
1545
|
+
let t = i.charCodeAt(a);
|
|
1546
|
+
if (t === 91) return !1;
|
|
1547
|
+
if (t === 93) {
|
|
1548
|
+
l = a;
|
|
1549
|
+
break;
|
|
1550
|
+
}
|
|
1551
|
+
if (t === 92 && (t = i.charCodeAt(++a)), t === 10 && a < s) {
|
|
1552
|
+
let t = G(e, o);
|
|
1553
|
+
if (t < 0) return !1;
|
|
1554
|
+
c += i.slice(u, s), a = u = t, s = W(e, o++);
|
|
1555
|
+
} else a++;
|
|
1556
|
+
}
|
|
1557
|
+
if (l < 0 || i.charCodeAt(l + 1) !== 58 || (c += i.slice(u, l), c.length > Bt && Vt(c) > Bt)) return !1;
|
|
1558
|
+
for (a = l + 2; a < s;) {
|
|
1559
|
+
let t = i.charCodeAt(a);
|
|
1560
|
+
if (t === 10) {
|
|
1561
|
+
let t = G(e, o);
|
|
1562
|
+
if (t < 0) break;
|
|
1563
|
+
a = t, s = W(e, o++);
|
|
1564
|
+
} else if (N(t)) a++;
|
|
1565
|
+
else break;
|
|
1566
|
+
}
|
|
1567
|
+
let d = e.md.helpers.parseLinkDestination(i, a, s);
|
|
1568
|
+
if (!d.ok) return !1;
|
|
1569
|
+
let f = e.md.normalizeLink(d.str);
|
|
1570
|
+
if (!e.md.validateLink(f)) return !1;
|
|
1571
|
+
a = d.pos;
|
|
1572
|
+
let p = a, m = s, h = o;
|
|
1573
|
+
for (; a < s;) {
|
|
1574
|
+
let t = i.charCodeAt(a);
|
|
1575
|
+
if (t === 10) {
|
|
1576
|
+
let t = G(e, o);
|
|
1577
|
+
if (t < 0) break;
|
|
1578
|
+
a = t, s = W(e, o++);
|
|
1579
|
+
} else if (N(t)) a++;
|
|
1580
|
+
else break;
|
|
1581
|
+
}
|
|
1582
|
+
let g = a, _ = e.md.helpers.parseLinkTitle(i, a, s);
|
|
1583
|
+
for (; _.can_continue;) {
|
|
1584
|
+
let t = G(e, o);
|
|
1585
|
+
if (t < 0) break;
|
|
1586
|
+
a = t, s = W(e, o++), _ = e.md.helpers.parseLinkTitle(i, a, s, _);
|
|
1587
|
+
}
|
|
1588
|
+
let v;
|
|
1589
|
+
for (g !== p && _.ok ? (v = _.str, a = _.pos) : (v = "", a = p, s = m, o = h); a < s && N(i.charCodeAt(a));) a++;
|
|
1590
|
+
if (a < s && i.charCodeAt(a) !== 10 && v) for (v = "", a = p, s = m, o = h; a < s && N(i.charCodeAt(a));) a++;
|
|
1591
|
+
if (a < s && i.charCodeAt(a) !== 10) return !1;
|
|
1592
|
+
let y = L(c);
|
|
1593
|
+
if (!y) return !1;
|
|
1594
|
+
/* istanbul ignore if */
|
|
1595
|
+
if (r) return !0;
|
|
1596
|
+
e.env.references === void 0 && (e.env.references = {}), e.env.references[y] === void 0 && (e.env.references[y] = {
|
|
1597
|
+
title: v,
|
|
1598
|
+
href: f
|
|
1599
|
+
});
|
|
1600
|
+
let b = e.push("reference_definition", "", 0);
|
|
1601
|
+
b.map = [t, o], b.hidden = !0;
|
|
1602
|
+
let x = Object.create(null);
|
|
1603
|
+
return x.label = y, b.meta = x, e.line = o, !0;
|
|
1604
|
+
}
|
|
1605
|
+
//#endregion
|
|
1606
|
+
//#region src/common/html_blocks.ts
|
|
1607
|
+
var Ut = /* @__PURE__ */ "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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul".split("."), Wt = "<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>", Gt = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
|
|
1608
|
+
RegExp(`^(?:${Wt}|${Gt}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);
|
|
1609
|
+
var Kt = RegExp(`^(?:${Wt}|${Gt})`), K = [
|
|
1610
|
+
[
|
|
1611
|
+
/^<(script|pre|style|textarea)(?=(\s|>|$))/i,
|
|
1612
|
+
/<\/(script|pre|style|textarea)>/i,
|
|
1613
|
+
!0
|
|
1614
|
+
],
|
|
1615
|
+
[
|
|
1616
|
+
/^<!--/,
|
|
1617
|
+
/-->/,
|
|
1618
|
+
!0
|
|
1619
|
+
],
|
|
1620
|
+
[
|
|
1621
|
+
/^<\?/,
|
|
1622
|
+
/\?>/,
|
|
1623
|
+
!0
|
|
1624
|
+
],
|
|
1625
|
+
[
|
|
1626
|
+
/^<![A-Za-z]/,
|
|
1627
|
+
/>/,
|
|
1628
|
+
!0
|
|
1629
|
+
],
|
|
1630
|
+
[
|
|
1631
|
+
/^<!\[CDATA\[/,
|
|
1632
|
+
/\]\]>/,
|
|
1633
|
+
!0
|
|
1634
|
+
],
|
|
1635
|
+
[
|
|
1636
|
+
RegExp(`^</?(${Ut.join("|")})(?=(\\s|/?>|$))`, "i"),
|
|
1637
|
+
/^$/,
|
|
1638
|
+
!0
|
|
1639
|
+
],
|
|
1640
|
+
[
|
|
1641
|
+
RegExp(`${Kt.source}\\s*$`),
|
|
1642
|
+
/^$/,
|
|
1643
|
+
!1
|
|
1644
|
+
]
|
|
1645
|
+
];
|
|
1646
|
+
function qt(e, t, n, r) {
|
|
1647
|
+
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t];
|
|
1648
|
+
if (e.sCount[t] - e.blkIndent >= 4 || !e.md.options.html || e.src.charCodeAt(i) !== 60) return !1;
|
|
1649
|
+
let o = e.src.slice(i, a), s = 0;
|
|
1650
|
+
for (; s < K.length && !K[s][0].test(o); s++);
|
|
1651
|
+
if (s === K.length) return !1;
|
|
1652
|
+
if (r) return K[s][2];
|
|
1653
|
+
let c = t + 1, l = K[s][1].test("");
|
|
1654
|
+
if (!K[s][1].test(o)) {
|
|
1655
|
+
for (; c < n && !(e.sCount[c] < e.blkIndent && (l || !e.isEmpty(c))); c++) if (i = e.bMarks[c] + e.tShift[c], a = e.eMarks[c], o = e.src.slice(i, a), K[s][1].test(o)) {
|
|
1656
|
+
o.length !== 0 && c++;
|
|
1657
|
+
break;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
e.line = c;
|
|
1661
|
+
let u = e.push("html_block", "", 0);
|
|
1662
|
+
return u.map = [t, c], u.content = e.getLines(t, c, e.blkIndent, !0), !0;
|
|
1663
|
+
}
|
|
1664
|
+
//#endregion
|
|
1665
|
+
//#region src/rules_block/heading.ts
|
|
1666
|
+
function Jt(e, t, n, r) {
|
|
1667
|
+
let i = e.bMarks[t] + e.tShift[t], a = e.eMarks[t];
|
|
1668
|
+
if (e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1669
|
+
let o = e.src.charCodeAt(i);
|
|
1670
|
+
if (o !== 35 || i >= a) return !1;
|
|
1671
|
+
let s = 1;
|
|
1672
|
+
for (o = e.src.charCodeAt(++i); o === 35 && i < a && s <= 6;) s++, o = e.src.charCodeAt(++i);
|
|
1673
|
+
if (s > 6 || i < a && !N(o)) return !1;
|
|
1674
|
+
if (r) return !0;
|
|
1675
|
+
a = e.skipSpacesBack(a, i);
|
|
1676
|
+
let c = e.skipCharsBack(a, 35, i);
|
|
1677
|
+
c > i && N(e.src.charCodeAt(c - 1)) && (a = c), e.line = t + 1;
|
|
1678
|
+
let l = e.push("heading_open", `h${s}`, 1);
|
|
1679
|
+
l.markup = "########".slice(0, s), l.map = [t, e.line];
|
|
1680
|
+
let u = e.push("inline", "", 0);
|
|
1681
|
+
u.content = R(e.src.slice(i, a)), u.map = [t, e.line], u.children = [];
|
|
1682
|
+
let d = e.push("heading_close", `h${s}`, -1);
|
|
1683
|
+
return d.markup = "########".slice(0, s), !0;
|
|
1684
|
+
}
|
|
1685
|
+
//#endregion
|
|
1686
|
+
//#region src/rules_block/lheading.ts
|
|
1687
|
+
function Yt(e, t, n) {
|
|
1688
|
+
let r = e.md.block.ruler.getRules("paragraph");
|
|
1689
|
+
if (e.sCount[t] - e.blkIndent >= 4) return !1;
|
|
1690
|
+
let i = e.parentType;
|
|
1691
|
+
e.parentType = "paragraph";
|
|
1692
|
+
let a = 0, o, s = t + 1;
|
|
1693
|
+
for (; s < n && !e.isEmpty(s); s++) {
|
|
1694
|
+
if (e.sCount[s] - e.blkIndent > 3) continue;
|
|
1695
|
+
if (e.sCount[s] >= e.blkIndent) {
|
|
1696
|
+
let t = e.bMarks[s] + e.tShift[s], n = e.eMarks[s];
|
|
1697
|
+
if (t < n && (o = e.src.charCodeAt(t), (o === 45 || o === 61) && (t = e.skipChars(t, o), t = e.skipSpaces(t), t >= n))) {
|
|
1698
|
+
a = o === 61 ? 1 : 2;
|
|
1699
|
+
break;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
if (e.sCount[s] < 0) continue;
|
|
1703
|
+
let t = !1;
|
|
1704
|
+
for (let i = 0, a = r.length; i < a; i++) if (r[i](e, s, n, !0)) {
|
|
1705
|
+
t = !0;
|
|
1706
|
+
break;
|
|
1707
|
+
}
|
|
1708
|
+
if (t) break;
|
|
1709
|
+
}
|
|
1710
|
+
if (!a) return e.parentType = i, !1;
|
|
1711
|
+
let c = R(e.getLines(t, s, e.blkIndent, !1));
|
|
1712
|
+
e.line = s + 1;
|
|
1713
|
+
let l = e.push("heading_open", `h${a}`, 1);
|
|
1714
|
+
l.markup = String.fromCharCode(o), l.map = [t, e.line];
|
|
1715
|
+
let u = e.push("inline", "", 0);
|
|
1716
|
+
u.content = c, u.map = [t, e.line - 1], u.children = [];
|
|
1717
|
+
let d = e.push("heading_close", `h${a}`, -1);
|
|
1718
|
+
return d.markup = String.fromCharCode(o), e.parentType = i, !0;
|
|
1719
|
+
}
|
|
1720
|
+
//#endregion
|
|
1721
|
+
//#region src/rules_block/paragraph.ts
|
|
1722
|
+
function Xt(e, t, n) {
|
|
1723
|
+
let r = e.md.block.ruler.getRules("paragraph"), i = e.parentType, a = t + 1;
|
|
1724
|
+
for (e.parentType = "paragraph"; a < n && !e.isEmpty(a); a++) {
|
|
1725
|
+
if (e.sCount[a] - e.blkIndent > 3 || e.sCount[a] < 0) continue;
|
|
1726
|
+
let t = !1;
|
|
1727
|
+
for (let i = 0, o = r.length; i < o; i++) if (r[i](e, a, n, !0)) {
|
|
1728
|
+
t = !0;
|
|
1729
|
+
break;
|
|
1730
|
+
}
|
|
1731
|
+
if (t) break;
|
|
1732
|
+
}
|
|
1733
|
+
let o = R(e.getLines(t, a, e.blkIndent, !1));
|
|
1734
|
+
e.line = a;
|
|
1735
|
+
let s = e.push("paragraph_open", "p", 1);
|
|
1736
|
+
s.map = [t, e.line];
|
|
1737
|
+
let c = e.push("inline", "", 0);
|
|
1738
|
+
return c.content = o, c.map = [t, e.line], c.children = [], e.push("paragraph_close", "p", -1), e.parentType = i, !0;
|
|
1739
|
+
}
|
|
1740
|
+
//#endregion
|
|
1741
|
+
//#region src/parser_block.ts
|
|
1742
|
+
var q = [
|
|
1743
|
+
[
|
|
1744
|
+
"table",
|
|
1745
|
+
jt,
|
|
1746
|
+
["paragraph", "reference"]
|
|
1747
|
+
],
|
|
1748
|
+
["code", Mt],
|
|
1749
|
+
[
|
|
1750
|
+
"fence",
|
|
1751
|
+
Nt,
|
|
1752
|
+
[
|
|
1753
|
+
"paragraph",
|
|
1754
|
+
"reference",
|
|
1755
|
+
"blockquote",
|
|
1756
|
+
"list"
|
|
1757
|
+
]
|
|
1758
|
+
],
|
|
1759
|
+
[
|
|
1760
|
+
"blockquote",
|
|
1761
|
+
Pt,
|
|
1762
|
+
[
|
|
1763
|
+
"paragraph",
|
|
1764
|
+
"reference",
|
|
1765
|
+
"blockquote",
|
|
1766
|
+
"list"
|
|
1767
|
+
]
|
|
1768
|
+
],
|
|
1769
|
+
[
|
|
1770
|
+
"hr",
|
|
1771
|
+
Ft,
|
|
1772
|
+
[
|
|
1773
|
+
"paragraph",
|
|
1774
|
+
"reference",
|
|
1775
|
+
"blockquote",
|
|
1776
|
+
"list"
|
|
1777
|
+
]
|
|
1778
|
+
],
|
|
1779
|
+
[
|
|
1780
|
+
"list",
|
|
1781
|
+
zt,
|
|
1782
|
+
[
|
|
1783
|
+
"paragraph",
|
|
1784
|
+
"reference",
|
|
1785
|
+
"blockquote"
|
|
1786
|
+
]
|
|
1787
|
+
],
|
|
1788
|
+
["reference", Ht],
|
|
1789
|
+
[
|
|
1790
|
+
"html_block",
|
|
1791
|
+
qt,
|
|
1792
|
+
[
|
|
1793
|
+
"paragraph",
|
|
1794
|
+
"reference",
|
|
1795
|
+
"blockquote"
|
|
1796
|
+
]
|
|
1797
|
+
],
|
|
1798
|
+
[
|
|
1799
|
+
"heading",
|
|
1800
|
+
Jt,
|
|
1801
|
+
[
|
|
1802
|
+
"paragraph",
|
|
1803
|
+
"reference",
|
|
1804
|
+
"blockquote"
|
|
1805
|
+
]
|
|
1806
|
+
],
|
|
1807
|
+
["lheading", Yt],
|
|
1808
|
+
["paragraph", Xt]
|
|
1809
|
+
], Zt = class {
|
|
1810
|
+
constructor() {
|
|
1811
|
+
D(this, "ruler", new B()), D(this, "State", Dt);
|
|
1812
|
+
for (let e = 0; e < q.length; e++) this.ruler.push(q[e][0], q[e][1], { alt: (q[e][2] || []).slice() });
|
|
1813
|
+
}
|
|
1814
|
+
tokenize(e, t, n) {
|
|
1815
|
+
let r = this.ruler.getRules(""), i = r.length, a = e.md.options.maxNesting, o = t, s = !1;
|
|
1816
|
+
for (; o < n && (e.line = o = e.skipEmptyLines(o), !(o >= n || e.sCount[o] < e.blkIndent));) {
|
|
1817
|
+
if (e.level >= a) {
|
|
1818
|
+
e.line = n;
|
|
1819
|
+
break;
|
|
1820
|
+
}
|
|
1821
|
+
let t = e.line, c = !1;
|
|
1822
|
+
for (let a = 0; a < i; a++) if (c = r[a](e, o, n, !1), c) {
|
|
1823
|
+
if (t >= e.line) throw Error("block rule didn't increment state.line");
|
|
1824
|
+
break;
|
|
1825
|
+
}
|
|
1826
|
+
if (!c) throw Error("none of the block rules matched");
|
|
1827
|
+
e.tight = !s, e.isEmpty(e.line - 1) && (s = !0), o = e.line, o < n && e.isEmpty(o) && (s = !0, o++, e.line = o);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
parse(e, t, n, r) {
|
|
1831
|
+
if (!e) return;
|
|
1832
|
+
let i = new this.State(e, t, n, r);
|
|
1833
|
+
this.tokenize(i, i.line, i.lineMax);
|
|
1834
|
+
}
|
|
1835
|
+
}, Qt = class {
|
|
1836
|
+
constructor(e, t, n, r) {
|
|
1837
|
+
D(this, "pos", 0), D(this, "level", 0), D(this, "pending", ""), D(this, "pendingLevel", 0), D(this, "cache", {}), D(this, "backticks", {}), D(this, "backticksScanned", !1), D(this, "skipHtmlSpecial", !1), D(this, "linkLevel", 0), D(this, "delimiters", []), D(this, "_prev_delimiters", []), D(this, "Token", z), this.src = e, this.env = n, this.md = t, this.tokens = r, this.tokens_meta = Array(r.length), this.posMax = this.src.length;
|
|
1838
|
+
}
|
|
1839
|
+
pushPending() {
|
|
1840
|
+
let e = new z("text", "", 0);
|
|
1841
|
+
return e.content = this.pending, e.level = this.pendingLevel, this.tokens.push(e), this.pending = "", e;
|
|
1842
|
+
}
|
|
1843
|
+
push(e, t, n) {
|
|
1844
|
+
this.pending && this.pushPending();
|
|
1845
|
+
let r = new z(e, t, n), i;
|
|
1846
|
+
return n < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()), r.level = this.level, n > 0 && (this.level++, this._prev_delimiters.push(this.delimiters), this.delimiters = [], i = { delimiters: this.delimiters }), this.pendingLevel = this.level, this.tokens.push(r), this.tokens_meta.push(i), r;
|
|
1847
|
+
}
|
|
1848
|
+
scanDelims(e, t) {
|
|
1849
|
+
let n = this.posMax, r = this.src.charCodeAt(e), i;
|
|
1850
|
+
if (e === 0) i = 32;
|
|
1851
|
+
else if (e === 1) i = this.src.charCodeAt(0), (i & 63488) == 55296 && (i = 65533);
|
|
1852
|
+
else if (i = this.src.charCodeAt(e - 1), (i & 64512) == 56320) {
|
|
1853
|
+
let t = this.src.charCodeAt(e - 2);
|
|
1854
|
+
i = (t & 64512) == 55296 ? 65536 + (t - 55296 << 10) + (i - 56320) : 65533;
|
|
1855
|
+
} else (i & 64512) == 55296 && (i = 65533);
|
|
1856
|
+
let a = e;
|
|
1857
|
+
for (; a < n && this.src.charCodeAt(a) === r;) a++;
|
|
1858
|
+
let o = a - e, s = a < n ? this.src.charCodeAt(a) : 32;
|
|
1859
|
+
if ((s & 64512) == 55296) {
|
|
1860
|
+
let e = this.src.charCodeAt(a + 1);
|
|
1861
|
+
s = (e & 64512) == 56320 ? 65536 + (s - 55296 << 10) + (e - 56320) : 65533;
|
|
1862
|
+
} else (s & 64512) == 56320 && (s = 65533);
|
|
1863
|
+
let c = I(i) || F(i), l = I(s) || F(s), u = P(i), d = P(s), f = !d && (!l || u || c), p = !u && (!c || d || l);
|
|
1864
|
+
return {
|
|
1865
|
+
can_open: f && (t || !p || c),
|
|
1866
|
+
can_close: p && (t || !f || l),
|
|
1867
|
+
length: o
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1870
|
+
};
|
|
1871
|
+
//#endregion
|
|
1872
|
+
//#region src/rules_inline/text.ts
|
|
1873
|
+
function $t(e) {
|
|
1874
|
+
switch (e) {
|
|
1875
|
+
case 10:
|
|
1876
|
+
case 33:
|
|
1877
|
+
case 35:
|
|
1878
|
+
case 36:
|
|
1879
|
+
case 37:
|
|
1880
|
+
case 38:
|
|
1881
|
+
case 42:
|
|
1882
|
+
case 43:
|
|
1883
|
+
case 45:
|
|
1884
|
+
case 58:
|
|
1885
|
+
case 60:
|
|
1886
|
+
case 61:
|
|
1887
|
+
case 62:
|
|
1888
|
+
case 64:
|
|
1889
|
+
case 91:
|
|
1890
|
+
case 92:
|
|
1891
|
+
case 93:
|
|
1892
|
+
case 94:
|
|
1893
|
+
case 95:
|
|
1894
|
+
case 96:
|
|
1895
|
+
case 123:
|
|
1896
|
+
case 125:
|
|
1897
|
+
case 126: return !0;
|
|
1898
|
+
default: return !1;
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
function en(e, t) {
|
|
1902
|
+
let n = e.pos;
|
|
1903
|
+
for (; n < e.posMax && !$t(e.src.charCodeAt(n));) n++;
|
|
1904
|
+
return n !== e.pos && (t || (e.pending += e.src.slice(e.pos, n)), e.pos = n, !0);
|
|
1905
|
+
}
|
|
1906
|
+
//#endregion
|
|
1907
|
+
//#region src/rules_inline/linkify.ts
|
|
1908
|
+
function tn(e) {
|
|
1909
|
+
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
1910
|
+
}
|
|
1911
|
+
function nn(e) {
|
|
1912
|
+
return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || e === 43 || e === 45 || e === 46;
|
|
1913
|
+
}
|
|
1914
|
+
function rn(e, t) {
|
|
1915
|
+
if (!e.md.options.linkify || e.linkLevel > 0) return !1;
|
|
1916
|
+
let n = e.pos, r = e.posMax;
|
|
1917
|
+
if (n + 3 > r || e.src.charCodeAt(n) !== 58 || e.src.charCodeAt(n + 1) !== 47 || e.src.charCodeAt(n + 2) !== 47) return !1;
|
|
1918
|
+
let i = n - Math.min(10, e.pending.length, n), a = n;
|
|
1919
|
+
for (; a > i && nn(e.src.charCodeAt(a - 1));) a--;
|
|
1920
|
+
if (a === n || !tn(e.src.charCodeAt(a))) return !1;
|
|
1921
|
+
let o = n - a, s = e.md.linkify.matchAtStart(e.src.slice(a));
|
|
1922
|
+
if (!s) return !1;
|
|
1923
|
+
let c = s.url;
|
|
1924
|
+
if (c.length <= o) return !1;
|
|
1925
|
+
let l = c.length;
|
|
1926
|
+
for (; l > 0 && c.charCodeAt(l - 1) === 42;) l--;
|
|
1927
|
+
l !== c.length && (c = c.slice(0, l));
|
|
1928
|
+
let u = e.md.normalizeLink(c);
|
|
1929
|
+
if (!e.md.validateLink(u)) return !1;
|
|
1930
|
+
if (!t) {
|
|
1931
|
+
e.pending = e.pending.slice(0, -o);
|
|
1932
|
+
let t = e.push("link_open", "a", 1);
|
|
1933
|
+
t.attrs = [["href", u]], t.markup = "linkify", t.info = "auto";
|
|
1934
|
+
let n = e.push("text", "", 0);
|
|
1935
|
+
n.content = e.md.normalizeLinkText(c);
|
|
1936
|
+
let r = e.push("link_close", "a", -1);
|
|
1937
|
+
r.markup = "linkify", r.info = "auto";
|
|
1938
|
+
}
|
|
1939
|
+
return e.pos += c.length - o, !0;
|
|
1940
|
+
}
|
|
1941
|
+
//#endregion
|
|
1942
|
+
//#region src/rules_inline/newline.ts
|
|
1943
|
+
function an(e, t) {
|
|
1944
|
+
let n = e.pos;
|
|
1945
|
+
if (e.src.charCodeAt(n) !== 10) return !1;
|
|
1946
|
+
let r = e.pending.length - 1, i = e.posMax;
|
|
1947
|
+
if (!t) {
|
|
1948
|
+
if (r >= 0 && e.pending.charCodeAt(r) === 32) {
|
|
1949
|
+
if (r >= 1 && e.pending.charCodeAt(r - 1) === 32) {
|
|
1950
|
+
let t = r - 1;
|
|
1951
|
+
for (; t >= 1 && e.pending.charCodeAt(t - 1) === 32;) t--;
|
|
1952
|
+
e.pending = e.pending.slice(0, t), e.push("hardbreak", "br", 0);
|
|
1953
|
+
} else e.pending = e.pending.slice(0, -1), e.push("softbreak", "br", 0);
|
|
1954
|
+
} else e.push("softbreak", "br", 0);
|
|
1955
|
+
}
|
|
1956
|
+
for (n++; n < i && N(e.src.charCodeAt(n));) n++;
|
|
1957
|
+
return e.pos = n, !0;
|
|
1958
|
+
}
|
|
1959
|
+
//#endregion
|
|
1960
|
+
//#region src/rules_inline/escape.ts
|
|
1961
|
+
var on = [];
|
|
1962
|
+
for (let e = 0; e < 256; e++) on.push(0);
|
|
1963
|
+
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e) {
|
|
1964
|
+
on[e.charCodeAt(0)] = 1;
|
|
1965
|
+
});
|
|
1966
|
+
function sn(e, t) {
|
|
1967
|
+
let n = e.pos, r = e.posMax;
|
|
1968
|
+
if (e.src.charCodeAt(n) !== 92 || (n++, n >= r)) return !1;
|
|
1969
|
+
let i = e.src.charCodeAt(n);
|
|
1970
|
+
if (i === 10) {
|
|
1971
|
+
for (t || e.push("hardbreak", "br", 0), n++; n < r && (i = e.src.charCodeAt(n), N(i));) n++;
|
|
1972
|
+
return e.pos = n, !0;
|
|
1973
|
+
}
|
|
1974
|
+
if (i === 32) {
|
|
1975
|
+
if (!t) {
|
|
1976
|
+
let t = e.push("text_special", "", 0);
|
|
1977
|
+
t.content = "\\", t.markup = "\\", t.info = "escape";
|
|
1978
|
+
}
|
|
1979
|
+
return e.pos = n, !0;
|
|
1980
|
+
}
|
|
1981
|
+
let a = e.src[n];
|
|
1982
|
+
if (i >= 55296 && i <= 56319 && n + 1 < r) {
|
|
1983
|
+
let t = e.src.charCodeAt(n + 1);
|
|
1984
|
+
t >= 56320 && t <= 57343 && (a += e.src[n + 1], n++);
|
|
1985
|
+
}
|
|
1986
|
+
let o = "\\" + a;
|
|
1987
|
+
if (!t) {
|
|
1988
|
+
let t = e.push("text_special", "", 0);
|
|
1989
|
+
t.content = i < 256 && on[i] !== 0 ? a : o, t.markup = o, t.info = "escape";
|
|
1990
|
+
}
|
|
1991
|
+
return e.pos = n + 1, !0;
|
|
1992
|
+
}
|
|
1993
|
+
//#endregion
|
|
1994
|
+
//#region src/rules_inline/backticks.ts
|
|
1995
|
+
function cn(e) {
|
|
1996
|
+
let t = {}, n = 0;
|
|
1997
|
+
for (; (n = e.indexOf("`", n)) !== -1;) {
|
|
1998
|
+
let r = n;
|
|
1999
|
+
for (; e.charCodeAt(++n) === 96;);
|
|
2000
|
+
t[n - r] = r;
|
|
2001
|
+
}
|
|
2002
|
+
return t;
|
|
2003
|
+
}
|
|
2004
|
+
function ln(e, t) {
|
|
2005
|
+
var n;
|
|
2006
|
+
let r = e.pos;
|
|
2007
|
+
if (e.src.charCodeAt(r) !== 96) return !1;
|
|
2008
|
+
let i = e.posMax, a = r + 1;
|
|
2009
|
+
for (; a < i && e.src.charCodeAt(a) === 96;) a++;
|
|
2010
|
+
let o = e.src.slice(r, a), s = o.length;
|
|
2011
|
+
if (e.backticksScanned || (e.backticks = cn(e.src), e.backticksScanned = !0), ((n = e.backticks[s]) == null ? -1 : n) >= a) {
|
|
2012
|
+
let n = a, r;
|
|
2013
|
+
for (; (r = e.src.indexOf("`", n)) !== -1 && r < i;) {
|
|
2014
|
+
for (n = r + 1; e.src.charCodeAt(n) === 96;) n++;
|
|
2015
|
+
if (n > i) break;
|
|
2016
|
+
if (n - r === s) {
|
|
2017
|
+
if (!t) {
|
|
2018
|
+
let t = e.push("code_inline", "code", 0);
|
|
2019
|
+
t.markup = o;
|
|
2020
|
+
let n = e.src.slice(a, r).replace(/\n/g, " ");
|
|
2021
|
+
n.startsWith(" ") && n.endsWith(" ") && /[^ ]/.test(n) && (n = n.slice(1, -1)), t.content = n;
|
|
2022
|
+
}
|
|
2023
|
+
return e.pos = n, !0;
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
return t || (e.pending += o), e.pos = a, !0;
|
|
2028
|
+
}
|
|
2029
|
+
//#endregion
|
|
2030
|
+
//#region src/rules_inline/strikethrough.ts
|
|
2031
|
+
function un(e, t) {
|
|
2032
|
+
let n = e.pos, r = e.src.charCodeAt(n);
|
|
2033
|
+
if (t || r !== 126) return !1;
|
|
2034
|
+
let i = e.scanDelims(e.pos, !0), a = i.length, o = String.fromCharCode(r);
|
|
2035
|
+
if (a < 2) return !1;
|
|
2036
|
+
let s;
|
|
2037
|
+
a % 2 && (s = e.push("text", "", 0), s.content = o, a--);
|
|
2038
|
+
for (let t = 0; t < a; t += 2) s = e.push("text", "", 0), s.content = o + o, e.delimiters.push({
|
|
2039
|
+
marker: r,
|
|
2040
|
+
length: 0,
|
|
2041
|
+
token: e.tokens.length - 1,
|
|
2042
|
+
end: -1,
|
|
2043
|
+
open: i.can_open,
|
|
2044
|
+
close: i.can_close
|
|
2045
|
+
});
|
|
2046
|
+
return e.pos += i.length, !0;
|
|
2047
|
+
}
|
|
2048
|
+
function dn(e, t) {
|
|
2049
|
+
let n, r = [], i = t.length;
|
|
2050
|
+
for (let a = 0; a < i; a++) {
|
|
2051
|
+
let i = t[a];
|
|
2052
|
+
if (i.marker !== 126 || i.end === -1) continue;
|
|
2053
|
+
let o = t[i.end];
|
|
2054
|
+
n = e.tokens[i.token], n.type = "s_open", n.tag = "s", n.nesting = 1, n.markup = "~~", n.content = "", n = e.tokens[o.token], n.type = "s_close", n.tag = "s", n.nesting = -1, n.markup = "~~", n.content = "", e.tokens[o.token - 1].type === "text" && e.tokens[o.token - 1].content === "~" && r.push(o.token - 1);
|
|
2055
|
+
}
|
|
2056
|
+
for (; r.length;) {
|
|
2057
|
+
let t = r.pop(), i = t + 1;
|
|
2058
|
+
for (; i < e.tokens.length && e.tokens[i].type === "s_close";) i++;
|
|
2059
|
+
i--, t !== i && (n = e.tokens[i], e.tokens[i] = e.tokens[t], e.tokens[t] = n);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
function fn(e) {
|
|
2063
|
+
let t = e.tokens_meta, n = e.tokens_meta.length;
|
|
2064
|
+
dn(e, e.delimiters);
|
|
2065
|
+
for (let i = 0; i < n; i++) {
|
|
2066
|
+
var r;
|
|
2067
|
+
let n = (r = t[i]) == null ? void 0 : r.delimiters;
|
|
2068
|
+
n && dn(e, n);
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
var pn = {
|
|
2072
|
+
tokenize: un,
|
|
2073
|
+
postProcess: fn
|
|
2074
|
+
};
|
|
2075
|
+
//#endregion
|
|
2076
|
+
//#region src/rules_inline/emphasis.ts
|
|
2077
|
+
function mn(e, t) {
|
|
2078
|
+
let n = e.pos, r = e.src.charCodeAt(n);
|
|
2079
|
+
if (t || r !== 95 && r !== 42) return !1;
|
|
2080
|
+
let i = e.scanDelims(e.pos, r === 42);
|
|
2081
|
+
for (let t = 0; t < i.length; t++) {
|
|
2082
|
+
let t = e.push("text", "", 0);
|
|
2083
|
+
t.content = String.fromCharCode(r), e.delimiters.push({
|
|
2084
|
+
marker: r,
|
|
2085
|
+
length: i.length,
|
|
2086
|
+
token: e.tokens.length - 1,
|
|
2087
|
+
end: -1,
|
|
2088
|
+
open: i.can_open,
|
|
2089
|
+
close: i.can_close
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
return e.pos += i.length, !0;
|
|
2093
|
+
}
|
|
2094
|
+
function hn(e, t) {
|
|
2095
|
+
let n = t.length;
|
|
2096
|
+
for (let r = n - 1; r >= 0; r--) {
|
|
2097
|
+
let n = t[r];
|
|
2098
|
+
if (n.marker !== 95 && n.marker !== 42 || n.end === -1) continue;
|
|
2099
|
+
let i = t[n.end], a = r > 0 && t[r - 1].end === n.end + 1 && t[r - 1].marker === n.marker && t[r - 1].token === n.token - 1 && t[n.end + 1].token === i.token + 1, o = String.fromCharCode(n.marker), s = e.tokens[n.token];
|
|
2100
|
+
s.type = a ? "strong_open" : "em_open", s.tag = a ? "strong" : "em", s.nesting = 1, s.markup = a ? o + o : o, s.content = "";
|
|
2101
|
+
let c = e.tokens[i.token];
|
|
2102
|
+
c.type = a ? "strong_close" : "em_close", c.tag = a ? "strong" : "em", c.nesting = -1, c.markup = a ? o + o : o, c.content = "", a && (e.tokens[t[r - 1].token].content = "", e.tokens[t[n.end + 1].token].content = "", r--);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
function gn(e) {
|
|
2106
|
+
let t = e.tokens_meta, n = e.tokens_meta.length;
|
|
2107
|
+
hn(e, e.delimiters);
|
|
2108
|
+
for (let i = 0; i < n; i++) {
|
|
2109
|
+
var r;
|
|
2110
|
+
let n = (r = t[i]) == null ? void 0 : r.delimiters;
|
|
2111
|
+
n && hn(e, n);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
var _n = {
|
|
2115
|
+
tokenize: mn,
|
|
2116
|
+
postProcess: gn
|
|
2117
|
+
};
|
|
2118
|
+
//#endregion
|
|
2119
|
+
//#region src/rules_inline/link.ts
|
|
2120
|
+
function vn(e, t) {
|
|
2121
|
+
let n, r, i, a, o = "", s = "", c = e.pos, l = !0;
|
|
2122
|
+
if (e.src.charCodeAt(e.pos) !== 91) return !1;
|
|
2123
|
+
let u = e.pos, d = e.posMax, f = e.pos + 1, p = e.md.helpers.parseLinkLabel(e, e.pos, !0);
|
|
2124
|
+
if (p < 0) return !1;
|
|
2125
|
+
let m = p + 1;
|
|
2126
|
+
if (m < d && e.src.charCodeAt(m) === 40) {
|
|
2127
|
+
for (l = !1, m++; m < d && (n = e.src.charCodeAt(m), N(n) || n === 10); m++);
|
|
2128
|
+
if (m >= d) return !1;
|
|
2129
|
+
if (c = m, i = e.md.helpers.parseLinkDestination(e.src, m, e.posMax), i.ok) {
|
|
2130
|
+
for (o = e.md.normalizeLink(i.str), e.md.validateLink(o) ? m = i.pos : o = "", c = m; m < d && (n = e.src.charCodeAt(m), N(n) || n === 10); m++);
|
|
2131
|
+
if (i = e.md.helpers.parseLinkTitle(e.src, m, e.posMax), m < d && c !== m && i.ok) for (s = i.str, m = i.pos; m < d && (n = e.src.charCodeAt(m), N(n) || n === 10); m++);
|
|
2132
|
+
}
|
|
2133
|
+
(m >= d || e.src.charCodeAt(m) !== 41) && (l = !0), m++;
|
|
2134
|
+
}
|
|
2135
|
+
if (l) {
|
|
2136
|
+
if (e.env.references === void 0) return !1;
|
|
2137
|
+
if (m < d && e.src.charCodeAt(m) === 91 ? (c = m + 1, m = e.md.helpers.parseLinkLabel(e, m), m >= 0 ? r = e.src.slice(c, m++) : m = p + 1) : m = p + 1, r || (r = e.src.slice(f, p)), r = L(r), a = e.env.references[r], !a) return e.pos = u, !1;
|
|
2138
|
+
o = a.href, s = a.title;
|
|
2139
|
+
}
|
|
2140
|
+
if (!t) {
|
|
2141
|
+
e.pos = f, e.posMax = p;
|
|
2142
|
+
let t = e.push("link_open", "a", 1), n = [["href", o]];
|
|
2143
|
+
if (t.attrs = n, s && n.push(["title", s]), r) {
|
|
2144
|
+
let e = Object.create(null);
|
|
2145
|
+
e.label = r, t.meta = e;
|
|
2146
|
+
}
|
|
2147
|
+
e.linkLevel++, e.md.inline.tokenize(e), e.linkLevel--, e.push("link_close", "a", -1);
|
|
2148
|
+
}
|
|
2149
|
+
return e.pos = m, e.posMax = d, !0;
|
|
2150
|
+
}
|
|
2151
|
+
//#endregion
|
|
2152
|
+
//#region src/rules_inline/image.ts
|
|
2153
|
+
function yn(e, t) {
|
|
2154
|
+
let n, r, i, a, o, s, c, l, u = "", d = e.pos, f = e.posMax;
|
|
2155
|
+
if (e.src.charCodeAt(e.pos) !== 33 || e.src.charCodeAt(e.pos + 1) !== 91) return !1;
|
|
2156
|
+
let p = e.pos + 2, m = e.md.helpers.parseLinkLabel(e, e.pos + 1, !1);
|
|
2157
|
+
if (m < 0) return !1;
|
|
2158
|
+
if (a = m + 1, a < f && e.src.charCodeAt(a) === 40) {
|
|
2159
|
+
for (a++; a < f && (n = e.src.charCodeAt(a), N(n) || n === 10); a++);
|
|
2160
|
+
if (a >= f) return !1;
|
|
2161
|
+
for (l = a, s = e.md.helpers.parseLinkDestination(e.src, a, e.posMax), s.ok && (u = e.md.normalizeLink(s.str), e.md.validateLink(u) ? a = s.pos : u = ""), l = a; a < f && (n = e.src.charCodeAt(a), N(n) || n === 10); a++);
|
|
2162
|
+
if (s = e.md.helpers.parseLinkTitle(e.src, a, e.posMax), a < f && l !== a && s.ok) for (c = s.str, a = s.pos; a < f && (n = e.src.charCodeAt(a), N(n) || n === 10); a++);
|
|
2163
|
+
else c = "";
|
|
2164
|
+
if (a >= f || e.src.charCodeAt(a) !== 41) return e.pos = d, !1;
|
|
2165
|
+
a++;
|
|
2166
|
+
} else {
|
|
2167
|
+
if (e.env.references === void 0) return !1;
|
|
2168
|
+
if (a < f && e.src.charCodeAt(a) === 91 ? (l = a + 1, a = e.md.helpers.parseLinkLabel(e, a), a >= 0 ? i = e.src.slice(l, a++) : a = m + 1) : a = m + 1, i || (i = e.src.slice(p, m)), i = L(i), o = e.env.references[i], !o) return e.pos = d, !1;
|
|
2169
|
+
u = o.href, c = o.title;
|
|
2170
|
+
}
|
|
2171
|
+
if (!t) {
|
|
2172
|
+
r = e.src.slice(p, m);
|
|
2173
|
+
let t = [];
|
|
2174
|
+
e.md.inline.parse(r, e.md, e.env, t);
|
|
2175
|
+
let n = e.push("image", "img", 0), a = [["src", u], ["alt", ""]];
|
|
2176
|
+
if (n.attrs = a, n.children = t, n.content = r, c && a.push(["title", c]), i) {
|
|
2177
|
+
let e = Object.create(null);
|
|
2178
|
+
e.label = i, n.meta = e;
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
return e.pos = a, e.posMax = f, !0;
|
|
2182
|
+
}
|
|
2183
|
+
//#endregion
|
|
2184
|
+
//#region src/rules_inline/autolink.ts
|
|
2185
|
+
var bn = /^([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])?)*)$/, xn = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
|
|
2186
|
+
function Sn(e, t) {
|
|
2187
|
+
let n = e.pos;
|
|
2188
|
+
if (e.src.charCodeAt(n) !== 60) return !1;
|
|
2189
|
+
let r = e.pos, i = e.posMax;
|
|
2190
|
+
for (;;) {
|
|
2191
|
+
if (++n >= i) return !1;
|
|
2192
|
+
let t = e.src.charCodeAt(n);
|
|
2193
|
+
if (t === 60) return !1;
|
|
2194
|
+
if (t === 62) break;
|
|
2195
|
+
}
|
|
2196
|
+
let a = e.src.slice(r + 1, n);
|
|
2197
|
+
if (xn.test(a)) {
|
|
2198
|
+
let n = e.md.normalizeLink(a);
|
|
2199
|
+
if (!e.md.validateLink(n)) return !1;
|
|
2200
|
+
if (!t) {
|
|
2201
|
+
let t = e.push("link_open", "a", 1);
|
|
2202
|
+
t.attrs = [["href", n]], t.markup = "autolink", t.info = "auto";
|
|
2203
|
+
let r = e.push("text", "", 0);
|
|
2204
|
+
r.content = e.md.normalizeLinkText(a);
|
|
2205
|
+
let i = e.push("link_close", "a", -1);
|
|
2206
|
+
i.markup = "autolink", i.info = "auto";
|
|
2207
|
+
}
|
|
2208
|
+
return e.pos += a.length + 2, !0;
|
|
2209
|
+
}
|
|
2210
|
+
if (bn.test(a)) {
|
|
2211
|
+
let n = e.md.normalizeLink(`mailto:${a}`);
|
|
2212
|
+
if (!e.md.validateLink(n)) return !1;
|
|
2213
|
+
if (!t) {
|
|
2214
|
+
let t = e.push("link_open", "a", 1);
|
|
2215
|
+
t.attrs = [["href", n]], t.markup = "autolink", t.info = "auto";
|
|
2216
|
+
let r = e.push("text", "", 0);
|
|
2217
|
+
r.content = e.md.normalizeLinkText(a);
|
|
2218
|
+
let i = e.push("link_close", "a", -1);
|
|
2219
|
+
i.markup = "autolink", i.info = "auto";
|
|
2220
|
+
}
|
|
2221
|
+
return e.pos += a.length + 2, !0;
|
|
2222
|
+
}
|
|
2223
|
+
return !1;
|
|
2224
|
+
}
|
|
2225
|
+
//#endregion
|
|
2226
|
+
//#region src/rules_inline/html_inline.ts
|
|
2227
|
+
function Cn(e) {
|
|
2228
|
+
return /^<a[>\s]/i.test(e);
|
|
2229
|
+
}
|
|
2230
|
+
function wn(e) {
|
|
2231
|
+
return /^<\/a\s*>/i.test(e);
|
|
2232
|
+
}
|
|
2233
|
+
function Tn(e) {
|
|
2234
|
+
let t = e | 32;
|
|
2235
|
+
return t >= 97 && t <= 122;
|
|
2236
|
+
}
|
|
2237
|
+
function En(e, t) {
|
|
2238
|
+
let n = e.src, r, i;
|
|
2239
|
+
if (n.startsWith("<!--", t)) {
|
|
2240
|
+
if (n.startsWith(">", t + 4)) return t + 5;
|
|
2241
|
+
if (n.startsWith("->", t + 4)) return t + 6;
|
|
2242
|
+
r = t + 4, i = "-->";
|
|
2243
|
+
} else if (n.startsWith("<![CDATA[", t)) r = t + 9, i = "]]>";
|
|
2244
|
+
else if (n.charCodeAt(t + 1) === 63) r = t + 2, i = "?>";
|
|
2245
|
+
else if (Tn(n.charCodeAt(t + 2))) r = t + 3, i = ">";
|
|
2246
|
+
else return -1;
|
|
2247
|
+
if (e.skipHtmlSpecial) return -1;
|
|
2248
|
+
let a = n.indexOf(i, r);
|
|
2249
|
+
return a < 0 ? (e.skipHtmlSpecial = !0, -1) : a + i.length;
|
|
2250
|
+
}
|
|
2251
|
+
function Dn(e, t) {
|
|
2252
|
+
if (!e.md.options.html) return !1;
|
|
2253
|
+
let n = e.posMax, r = e.pos;
|
|
2254
|
+
if (e.src.charCodeAt(r) !== 60 || r + 2 >= n) return !1;
|
|
2255
|
+
let i, a = e.src.charCodeAt(r + 1);
|
|
2256
|
+
if (a === 33 || a === 63) i = En(e, r);
|
|
2257
|
+
else if (a === 47 || Tn(a)) {
|
|
2258
|
+
let t = e.src.slice(r).match(Kt);
|
|
2259
|
+
i = t ? r + t[0].length : -1;
|
|
2260
|
+
} else return !1;
|
|
2261
|
+
if (i < 0) return !1;
|
|
2262
|
+
if (!t) {
|
|
2263
|
+
let t = e.push("html_inline", "", 0);
|
|
2264
|
+
t.content = e.src.slice(r, i), Cn(t.content) && e.linkLevel++, wn(t.content) && e.linkLevel--;
|
|
2265
|
+
}
|
|
2266
|
+
return e.pos = i, !0;
|
|
2267
|
+
}
|
|
2268
|
+
//#endregion
|
|
2269
|
+
//#region src/rules_inline/entity.ts
|
|
2270
|
+
var On = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, kn = /^&([a-z][a-z0-9]{1,31});/i;
|
|
2271
|
+
function An(e, t) {
|
|
2272
|
+
let n = e.pos, r = e.posMax;
|
|
2273
|
+
if (e.src.charCodeAt(n) !== 38 || n + 1 >= r) return !1;
|
|
2274
|
+
if (e.src.charCodeAt(n + 1) === 35) {
|
|
2275
|
+
let r = e.src.slice(n).match(On);
|
|
2276
|
+
if (r) {
|
|
2277
|
+
if (!t) {
|
|
2278
|
+
let t = r[1][0].toLowerCase() === "x" ? parseInt(r[1].slice(1), 16) : parseInt(r[1], 10), n = e.push("text_special", "", 0);
|
|
2279
|
+
n.content = Me(t) ? A(t) : A(65533), n.markup = r[0], n.info = "entity";
|
|
2280
|
+
}
|
|
2281
|
+
return e.pos += r[0].length, !0;
|
|
2282
|
+
}
|
|
2283
|
+
} else {
|
|
2284
|
+
let r = e.src.slice(n).match(kn);
|
|
2285
|
+
if (r) {
|
|
2286
|
+
let n = Oe(r[0]);
|
|
2287
|
+
if (n !== r[0]) {
|
|
2288
|
+
if (!t) {
|
|
2289
|
+
let t = e.push("text_special", "", 0);
|
|
2290
|
+
t.content = n, t.markup = r[0], t.info = "entity";
|
|
2291
|
+
}
|
|
2292
|
+
return e.pos += r[0].length, !0;
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
return !1;
|
|
2297
|
+
}
|
|
2298
|
+
//#endregion
|
|
2299
|
+
//#region src/rules_inline/balance_pairs.ts
|
|
2300
|
+
function jn(e) {
|
|
2301
|
+
let t = {}, n = e.length;
|
|
2302
|
+
if (!n) return;
|
|
2303
|
+
let r = 0, i = -2, a = [];
|
|
2304
|
+
for (let o = 0; o < n; o++) {
|
|
2305
|
+
let n = e[o];
|
|
2306
|
+
if (a.push(0), (e[r].marker !== n.marker || i !== n.token - 1) && (r = o), i = n.token, n.length = n.length || 0, !n.close) continue;
|
|
2307
|
+
t.hasOwnProperty(n.marker) || (t[n.marker] = [
|
|
2308
|
+
-1,
|
|
2309
|
+
-1,
|
|
2310
|
+
-1,
|
|
2311
|
+
-1,
|
|
2312
|
+
-1,
|
|
2313
|
+
-1
|
|
2314
|
+
]);
|
|
2315
|
+
let s = t[n.marker][(n.open ? 3 : 0) + n.length % 3], c = r - a[r] - 1, l = c;
|
|
2316
|
+
for (; c > s; c -= a[c] + 1) {
|
|
2317
|
+
let t = e[c];
|
|
2318
|
+
if (t.marker === n.marker && t.open && t.end < 0) {
|
|
2319
|
+
let r = !1;
|
|
2320
|
+
if ((t.close || n.open) && (t.length + n.length) % 3 == 0 && (t.length % 3 != 0 || n.length % 3 != 0) && (r = !0), !r) {
|
|
2321
|
+
let r = c > 0 && !e[c - 1].open ? a[c - 1] + 1 : 0;
|
|
2322
|
+
a[o] = o - c + r, a[c] = r, n.open = !1, t.end = o, t.close = !1, l = -1, i = -2;
|
|
2323
|
+
break;
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
l !== -1 && (t[n.marker][(n.open ? 3 : 0) + (n.length || 0) % 3] = l);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
function Mn(e) {
|
|
2331
|
+
let t = e.tokens_meta, n = e.tokens_meta.length;
|
|
2332
|
+
jn(e.delimiters);
|
|
2333
|
+
for (let e = 0; e < n; e++) {
|
|
2334
|
+
var r;
|
|
2335
|
+
let n = (r = t[e]) == null ? void 0 : r.delimiters;
|
|
2336
|
+
n && jn(n);
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
//#endregion
|
|
2340
|
+
//#region src/rules_inline/fragments_join.ts
|
|
2341
|
+
function Nn(e) {
|
|
2342
|
+
let t, n, r = 0, i = e.tokens, a = e.tokens.length;
|
|
2343
|
+
for (t = n = 0; t < a; t++) i[t].nesting < 0 && r--, i[t].level = r, i[t].nesting > 0 && r++, i[t].type === "text" && t + 1 < a && i[t + 1].type === "text" ? i[t + 1].content = i[t].content + i[t + 1].content : (t !== n && (i[n] = i[t]), n++);
|
|
2344
|
+
t !== n && (i.length = n);
|
|
2345
|
+
}
|
|
2346
|
+
//#endregion
|
|
2347
|
+
//#region src/parser_inline.ts
|
|
2348
|
+
var Pn = [
|
|
2349
|
+
["text", en],
|
|
2350
|
+
["linkify", rn],
|
|
2351
|
+
["newline", an],
|
|
2352
|
+
["escape", sn],
|
|
2353
|
+
["backticks", ln],
|
|
2354
|
+
["strikethrough", pn.tokenize],
|
|
2355
|
+
["emphasis", _n.tokenize],
|
|
2356
|
+
["link", vn],
|
|
2357
|
+
["image", yn],
|
|
2358
|
+
["autolink", Sn],
|
|
2359
|
+
["html_inline", Dn],
|
|
2360
|
+
["entity", An]
|
|
2361
|
+
], Fn = [
|
|
2362
|
+
["balance_pairs", Mn],
|
|
2363
|
+
["strikethrough", pn.postProcess],
|
|
2364
|
+
["emphasis", _n.postProcess],
|
|
2365
|
+
["fragments_join", Nn]
|
|
2366
|
+
], In = class {
|
|
2367
|
+
constructor() {
|
|
2368
|
+
D(this, "ruler", new B()), D(this, "ruler2", new B()), D(this, "State", Qt);
|
|
2369
|
+
for (let e = 0; e < Pn.length; e++) this.ruler.push(Pn[e][0], Pn[e][1]);
|
|
2370
|
+
for (let e = 0; e < Fn.length; e++) this.ruler2.push(Fn[e][0], Fn[e][1]);
|
|
2371
|
+
}
|
|
2372
|
+
skipToken(e) {
|
|
2373
|
+
let t = e.pos, n = this.ruler.getRules(""), r = n.length, i = e.md.options.maxNesting, a = e.cache;
|
|
2374
|
+
if (a[t] !== void 0) {
|
|
2375
|
+
e.pos = a[t];
|
|
2376
|
+
return;
|
|
2377
|
+
}
|
|
2378
|
+
let o = !1;
|
|
2379
|
+
if (e.level < i) {
|
|
2380
|
+
for (let i = 0; i < r; i++) if (e.level++, o = n[i](e, !0), e.level--, o) {
|
|
2381
|
+
if (t >= e.pos) throw Error("inline rule didn't increment state.pos");
|
|
2382
|
+
break;
|
|
2383
|
+
}
|
|
2384
|
+
} else e.pos = e.posMax;
|
|
2385
|
+
o || e.pos++, a[t] = e.pos;
|
|
2386
|
+
}
|
|
2387
|
+
tokenize(e) {
|
|
2388
|
+
let t = this.ruler.getRules(""), n = t.length, r = e.posMax, i = e.md.options.maxNesting;
|
|
2389
|
+
for (; e.pos < r;) {
|
|
2390
|
+
let a = e.pos, o = !1;
|
|
2391
|
+
if (e.level < i) {
|
|
2392
|
+
for (let r = 0; r < n; r++) if (o = t[r](e, !1), o) {
|
|
2393
|
+
if (a >= e.pos) throw Error("inline rule didn't increment state.pos");
|
|
2394
|
+
break;
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
if (o) {
|
|
2398
|
+
if (e.pos >= r) break;
|
|
2399
|
+
} else e.pending += e.src[e.pos++];
|
|
2400
|
+
}
|
|
2401
|
+
e.pending && e.pushPending();
|
|
2402
|
+
}
|
|
2403
|
+
parse(e, t, n, r) {
|
|
2404
|
+
let i = new this.State(e, t, n, r);
|
|
2405
|
+
this.tokenize(i);
|
|
2406
|
+
let a = this.ruler2.getRules(""), o = a.length;
|
|
2407
|
+
for (let e = 0; e < o; e++) a[e](i);
|
|
2408
|
+
}
|
|
2409
|
+
}, Ln = class {
|
|
2410
|
+
constructor(e = {}) {
|
|
2411
|
+
D(this, "src_Any", C.source), D(this, "src_Cc", ee.source), D(this, "src_Z", ie.source), D(this, "src_P", ne.source), D(this, "src_ZPCc", [
|
|
2412
|
+
this.src_Z,
|
|
2413
|
+
this.src_P,
|
|
2414
|
+
this.src_Cc
|
|
2415
|
+
].join("|")), D(this, "src_ZCc", [this.src_Z, this.src_Cc].join("|")), D(this, "cache", {}), D(this, "opts", {
|
|
2416
|
+
maxLength: 1e4,
|
|
2417
|
+
urlAuth: !1,
|
|
2418
|
+
schema_names: []
|
|
2419
|
+
}), this.opts = {
|
|
2420
|
+
...this.opts,
|
|
2421
|
+
...e
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
set(e = {}) {
|
|
2425
|
+
return this.opts = {
|
|
2426
|
+
...this.opts,
|
|
2427
|
+
...e
|
|
2428
|
+
}, this.cache = {}, this;
|
|
2429
|
+
}
|
|
2430
|
+
escapeRE(e) {
|
|
2431
|
+
return e.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
2432
|
+
}
|
|
2433
|
+
nestedPairRE(e, t, n = 4) {
|
|
2434
|
+
let r = this.escapeRE(e), i = this.escapeRE(t), a = `(?:(?!${this.src_ZCc}|${r}|${i}).)`, o = `${r}${a}{0,1000}${i}`;
|
|
2435
|
+
for (let e = 2; e <= n; e++) o = `${r}(?:${a}|${o}){0,1000}${i}`;
|
|
2436
|
+
return o;
|
|
2437
|
+
}
|
|
2438
|
+
get_text_separators() {
|
|
2439
|
+
var e, t;
|
|
2440
|
+
return (t = (e = this.cache).text_separators) == null ? e.text_separators = /[><\uff5c]/ : t;
|
|
2441
|
+
}
|
|
2442
|
+
get_pseudo_letter() {
|
|
2443
|
+
var e, t;
|
|
2444
|
+
return (t = (e = this.cache).src_pseudo_letter) == null ? e.src_pseudo_letter = RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`) : t;
|
|
2445
|
+
}
|
|
2446
|
+
get_ipv4_addr() {
|
|
2447
|
+
var e, t;
|
|
2448
|
+
return (t = (e = this.cache).src_ip4) == null ? e.src_ip4 = /* @__PURE__ */ RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])") : t;
|
|
2449
|
+
}
|
|
2450
|
+
get_ipv6_addr() {
|
|
2451
|
+
var e, t;
|
|
2452
|
+
let n = "[0-9A-Fa-f]{1,4}", r = `(?:(?:${n}:${n})|${this.get_ipv4_addr().source})`;
|
|
2453
|
+
return (t = (e = this.cache).src_ip6_addr) == null ? e.src_ip6_addr = RegExp(`(?:(?:${n}:){6}${r}|::(?:${n}:){5}${r}|(?:${n})?::(?:${n}:){4}${r}|(?:(?:${n}:){0,1}${n})?::(?:${n}:){3}${r}|(?:(?:${n}:){0,2}${n})?::(?:${n}:){2}${r}|(?:(?:${n}:){0,3}${n})?::${n}:${r}|(?:(?:${n}:){0,4}${n})?::${r}|(?:(?:${n}:){0,5}${n})?::${n}|(?:(?:${n}:){0,6}${n})?::)`) : t;
|
|
2454
|
+
}
|
|
2455
|
+
get_ipv6_url_host() {
|
|
2456
|
+
var e, t;
|
|
2457
|
+
return (t = (e = this.cache).src_ip6_host) == null ? e.src_ip6_host = RegExp(`\\[${this.get_ipv6_addr().source}\\]`) : t;
|
|
2458
|
+
}
|
|
2459
|
+
get_ipv6_mail_host() {
|
|
2460
|
+
var e, t;
|
|
2461
|
+
return (t = (e = this.cache).src_ipv6_mail_host) == null ? e.src_ipv6_mail_host = RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`) : t;
|
|
2462
|
+
}
|
|
2463
|
+
get_auth() {
|
|
2464
|
+
var e, t;
|
|
2465
|
+
return (t = (e = this.cache).src_auth) == null ? e.src_auth = RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`) : t;
|
|
2466
|
+
}
|
|
2467
|
+
get_port() {
|
|
2468
|
+
var e, t;
|
|
2469
|
+
return (t = (e = this.cache).src_port) == null ? e.src_port = /* @__PURE__ */ RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?") : t;
|
|
2470
|
+
}
|
|
2471
|
+
get_host_terminator() {
|
|
2472
|
+
var e, t;
|
|
2473
|
+
return (t = (e = this.cache).src_host_terminator) == null ? e.src_host_terminator = RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"] ? "-(?!--)|" : "-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`) : t;
|
|
2474
|
+
}
|
|
2475
|
+
get_path_terminator() {
|
|
2476
|
+
var e, t;
|
|
2477
|
+
return (t = (e = this.cache).src_path_terminator) == null ? e.src_path_terminator = RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`) : t;
|
|
2478
|
+
}
|
|
2479
|
+
get_path() {
|
|
2480
|
+
var e, t;
|
|
2481
|
+
return (t = (e = this.cache).src_path) == null ? e.src_path = RegExp(`(?:[/?#](?:${this.nestedPairRE("[", "]")}|${this.nestedPairRE("(", ")")}|${this.nestedPairRE("{", "}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|` + (this.opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-{0,19})|" : "\\-{1,20}|") + `,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|` + this.get_path_extra().source + `[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`) : t;
|
|
2482
|
+
}
|
|
2483
|
+
get_mail_name() {
|
|
2484
|
+
var e, t;
|
|
2485
|
+
return (t = (e = this.cache).src_mail_name) == null ? e.src_mail_name = /* @__PURE__ */ RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}") : t;
|
|
2486
|
+
}
|
|
2487
|
+
get_xn() {
|
|
2488
|
+
var e, t;
|
|
2489
|
+
return (t = (e = this.cache).src_xn) == null ? e.src_xn = /* @__PURE__ */ RegExp("xn--[a-z0-9\\-]{1,59}") : t;
|
|
2490
|
+
}
|
|
2491
|
+
get_tld() {
|
|
2492
|
+
if (this.cache.tld) return this.cache.tld;
|
|
2493
|
+
let e = [...new Set(this.opts.tlds || [])].sort().reverse().join("|");
|
|
2494
|
+
return this.cache.tld = RegExp(`${e || "$#none#$"}|${this.get_xn().source}`), this.cache.tld;
|
|
2495
|
+
}
|
|
2496
|
+
get_domain_root() {
|
|
2497
|
+
var e, t;
|
|
2498
|
+
return (t = (e = this.cache).src_domain_root) == null ? e.src_domain_root = RegExp("(?:" + this.get_xn().source + `|${this.get_pseudo_letter().source}{1,63})`) : t;
|
|
2499
|
+
}
|
|
2500
|
+
get_domain() {
|
|
2501
|
+
var e, t;
|
|
2502
|
+
return (t = (e = this.cache).src_domain) == null ? e.src_domain = RegExp("(?:" + this.get_xn().source + `|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`) : t;
|
|
2503
|
+
}
|
|
2504
|
+
get_url_host_port() {
|
|
2505
|
+
var e, t;
|
|
2506
|
+
return (t = (e = this.cache).url_host_port) == null ? e.url_host_port = RegExp("(?:" + this.get_ipv6_url_host().source + `|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))` + this.get_port().source + this.get_host_terminator().source) : t;
|
|
2507
|
+
}
|
|
2508
|
+
get_fuzzy_url_host_port() {
|
|
2509
|
+
var e, t;
|
|
2510
|
+
return (t = (e = this.cache).fuzzy_url_host_port) == null ? e.fuzzy_url_host_port = RegExp("(?:" + (this.opts.fuzzyIP ? this.get_ipv4_addr().source + "|" : "") + `(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))` + this.get_host_terminator().source) : t;
|
|
2511
|
+
}
|
|
2512
|
+
get_mail_host() {
|
|
2513
|
+
var e, t;
|
|
2514
|
+
return (t = (e = this.cache).src_mail_host) == null ? e.src_mail_host = RegExp("(?:" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))` + this.get_host_terminator().source) : t;
|
|
2515
|
+
}
|
|
2516
|
+
get_fuzzy_mail_host() {
|
|
2517
|
+
var e, t;
|
|
2518
|
+
return (t = (e = this.cache).src_fuzzy_mail_host) == null ? e.src_fuzzy_mail_host = RegExp("(?:" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))` + this.get_host_terminator().source) : t;
|
|
2519
|
+
}
|
|
2520
|
+
get_path_extra() {
|
|
2521
|
+
var e, t;
|
|
2522
|
+
return (t = (e = this.cache).src_path_extra) == null ? e.src_path_extra = /* @__PURE__ */ RegExp("") : t;
|
|
2523
|
+
}
|
|
2524
|
+
get_fuzzy_mail_host_search() {
|
|
2525
|
+
var e, t;
|
|
2526
|
+
return (t = (e = this.cache).mail_fuzzy_host_search) == null ? e.mail_fuzzy_host_search = RegExp(`@${this.get_fuzzy_mail_host().source}`, "ig") : t;
|
|
2527
|
+
}
|
|
2528
|
+
get_fuzzy_link_search() {
|
|
2529
|
+
var e, t;
|
|
2530
|
+
return (t = (e = this.cache).link_fuzzy_search) == null ? e.link_fuzzy_search = RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${this.src_ZPCc}))(?:(?![$+<=>^\`|\uff5c])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`, "ig") : t;
|
|
2531
|
+
}
|
|
2532
|
+
get_http_validator() {
|
|
2533
|
+
var e, t;
|
|
2534
|
+
return (t = (e = this.cache).http_validator) == null ? e.http_validator = RegExp("\\/\\/" + (this.opts.urlAuth ? this.get_auth().source : "") + this.get_url_host_port().source + this.get_path().source, "iy") : t;
|
|
2535
|
+
}
|
|
2536
|
+
get_relative_proto_validator() {
|
|
2537
|
+
var e, t;
|
|
2538
|
+
return (t = (e = this.cache).relative_proto_validator) == null ? e.relative_proto_validator = RegExp((this.opts.urlAuth ? this.get_auth().source : "") + `(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})` + this.get_port().source + this.get_host_terminator().source + this.get_path().source, "iy") : t;
|
|
2539
|
+
}
|
|
2540
|
+
get_mail_name_validator() {
|
|
2541
|
+
var e, t;
|
|
2542
|
+
return (t = (e = this.cache).mail_name_validator) == null ? e.mail_name_validator = RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`) : t;
|
|
2543
|
+
}
|
|
2544
|
+
get_mailto_validator() {
|
|
2545
|
+
var e, t;
|
|
2546
|
+
return (t = (e = this.cache).mailto_validator) == null ? e.mailto_validator = RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`, "iy") : t;
|
|
2547
|
+
}
|
|
2548
|
+
get_schema_names() {
|
|
2549
|
+
var e, t;
|
|
2550
|
+
return (t = (e = this.cache).schema_names) == null ? e.schema_names = new RegExp((this.opts.schema_names || []).map((e) => this.escapeRE(e)).join("|")) : t;
|
|
2551
|
+
}
|
|
2552
|
+
get_schema_search() {
|
|
2553
|
+
var e, t;
|
|
2554
|
+
return (t = (e = this.cache).schema_search) == null ? e.schema_search = RegExp(`(^|(?!_)(?:[><\uff5c]|${this.src_ZPCc}))(${this.get_schema_names().source})`, "ig") : t;
|
|
2555
|
+
}
|
|
2556
|
+
get_schema_at_start() {
|
|
2557
|
+
var e, t;
|
|
2558
|
+
return (t = (e = this.cache).schema_at_start) == null ? e.schema_at_start = RegExp(`^${this.get_schema_search().source}`, "i") : t;
|
|
2559
|
+
}
|
|
2560
|
+
}, Rn = {
|
|
2561
|
+
validate: (e, t, n) => {
|
|
2562
|
+
let r = n.re.get_http_validator();
|
|
2563
|
+
r.lastIndex = t;
|
|
2564
|
+
let i = r.exec(e);
|
|
2565
|
+
return i ? i[0].length : 0;
|
|
2566
|
+
},
|
|
2567
|
+
normalize: (e, t) => t.normalize(e)
|
|
2568
|
+
}, zn = {
|
|
2569
|
+
"http:": Rn,
|
|
2570
|
+
"https:": Rn,
|
|
2571
|
+
"ftp:": Rn,
|
|
2572
|
+
"//": {
|
|
2573
|
+
validate: function(e, t, n) {
|
|
2574
|
+
let r = n.re.get_relative_proto_validator();
|
|
2575
|
+
r.lastIndex = t;
|
|
2576
|
+
let i = r.exec(e);
|
|
2577
|
+
return i ? t >= 3 && e[t - 3] === ":" || t >= 3 && e[t - 3] === "/" ? 0 : i[0].length : 0;
|
|
2578
|
+
},
|
|
2579
|
+
normalize: (e, t) => t.normalize(e)
|
|
2580
|
+
},
|
|
2581
|
+
"mailto:": {
|
|
2582
|
+
validate: function(e, t, n) {
|
|
2583
|
+
let r = n.re.get_mailto_validator();
|
|
2584
|
+
r.lastIndex = t;
|
|
2585
|
+
let i = r.exec(e);
|
|
2586
|
+
return i ? i[0].length : 0;
|
|
2587
|
+
},
|
|
2588
|
+
normalize: (e, t) => t.normalize(e)
|
|
2589
|
+
}
|
|
2590
|
+
}, Bn = "a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw", Vn = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";
|
|
2591
|
+
function Hn() {
|
|
2592
|
+
let e = Vn.split("|");
|
|
2593
|
+
return Bn.split("|").forEach((t) => {
|
|
2594
|
+
let n = t.indexOf(":"), r = t.slice(0, n);
|
|
2595
|
+
for (let i of t.slice(n + 1)) e.push(r + i);
|
|
2596
|
+
}), e;
|
|
2597
|
+
}
|
|
2598
|
+
var Un = {
|
|
2599
|
+
fuzzyLink: !1,
|
|
2600
|
+
fuzzyEmail: !0,
|
|
2601
|
+
fuzzyIP: !1,
|
|
2602
|
+
"---": !1,
|
|
2603
|
+
tlds: Hn(),
|
|
2604
|
+
urlAuth: !1,
|
|
2605
|
+
maxLength: 1e4
|
|
2606
|
+
}, Wn = class {
|
|
2607
|
+
constructor(e, t, n, r) {
|
|
2608
|
+
D(this, "schema", void 0), D(this, "index", void 0), D(this, "lastIndex", void 0), D(this, "raw", void 0), D(this, "text", void 0), D(this, "url", void 0);
|
|
2609
|
+
let i = e.slice(n, r);
|
|
2610
|
+
this.schema = t.toLowerCase(), this.index = n, this.lastIndex = r, this.raw = i, this.text = i, this.url = i;
|
|
2611
|
+
}
|
|
2612
|
+
}, Gn = class {
|
|
2613
|
+
constructor(e = {}) {
|
|
2614
|
+
D(this, "__opts__", void 0), D(this, "__schemas__", void 0), D(this, "re", void 0);
|
|
2615
|
+
let { rebuilder: t, ...n } = e;
|
|
2616
|
+
this.__opts__ = {
|
|
2617
|
+
...Un,
|
|
2618
|
+
...n
|
|
2619
|
+
}, this.__schemas__ = { ...zn }, this.re = t || new Ln(), this.re.set({
|
|
2620
|
+
...this.__opts__,
|
|
2621
|
+
schema_names: Object.keys(this.__schemas__)
|
|
2622
|
+
});
|
|
2623
|
+
}
|
|
2624
|
+
add(e, t = null) {
|
|
2625
|
+
if (!t) delete this.__schemas__[e];
|
|
2626
|
+
else {
|
|
2627
|
+
let n = {
|
|
2628
|
+
normalize: (e, t) => t.normalize(e),
|
|
2629
|
+
...t
|
|
2630
|
+
};
|
|
2631
|
+
this.__schemas__[e] = n;
|
|
2632
|
+
}
|
|
2633
|
+
return this.re.set({
|
|
2634
|
+
...this.__opts__,
|
|
2635
|
+
schema_names: Object.keys(this.__schemas__)
|
|
2636
|
+
}), this;
|
|
2637
|
+
}
|
|
2638
|
+
set(e = {}) {
|
|
2639
|
+
return this.__opts__ = {
|
|
2640
|
+
...this.__opts__,
|
|
2641
|
+
...e
|
|
2642
|
+
}, this.re.set({
|
|
2643
|
+
...this.__opts__,
|
|
2644
|
+
schema_names: Object.keys(this.__schemas__)
|
|
2645
|
+
}), this;
|
|
2646
|
+
}
|
|
2647
|
+
test(e) {
|
|
2648
|
+
if (!e.length) return !1;
|
|
2649
|
+
let t, n;
|
|
2650
|
+
for (n = this.re.get_schema_search(), n.lastIndex = 0; (t = n.exec(e)) !== null;) if (this.testSchemaAt(e, t[2], n.lastIndex)) return !0;
|
|
2651
|
+
if (this.__opts__.fuzzyLink && this.__schemas__["http:"] && (n = this.re.get_fuzzy_link_search(), n.lastIndex = 0, n.exec(e) !== null)) return !0;
|
|
2652
|
+
if (this.__opts__.fuzzyEmail && this.__schemas__["mailto:"] && e.indexOf("@") >= 0) {
|
|
2653
|
+
let n = this.re.get_fuzzy_mail_host_search(), r = this.re.get_mail_name_validator();
|
|
2654
|
+
for (n.lastIndex = 0; (t = n.exec(e)) !== null;) {
|
|
2655
|
+
let n = e.slice(Math.max(0, t.index - 65), t.index);
|
|
2656
|
+
if (r.test(n)) return !0;
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
return !1;
|
|
2660
|
+
}
|
|
2661
|
+
testSchemaAt(e, t, n) {
|
|
2662
|
+
return this.__schemas__[t.toLowerCase()] ? this.__schemas__[t.toLowerCase()].validate(e.slice(0, n + this.__opts__.maxLength), n, this) : 0;
|
|
2663
|
+
}
|
|
2664
|
+
match(e) {
|
|
2665
|
+
let t = [], n = this.re.get_schema_search(), r, i, a, o, s, c, l = !1, u = !1, d = !1, f = 0;
|
|
2666
|
+
if (!e.length) return null;
|
|
2667
|
+
for (n.lastIndex = 0, this.__opts__.fuzzyLink && this.__schemas__["http:"] && (r = this.re.get_fuzzy_link_search(), r.lastIndex = 0), this.__opts__.fuzzyEmail && this.__schemas__["mailto:"] && (i = this.re.get_fuzzy_mail_host_search(), i.lastIndex = 0, a = this.re.get_mail_name_validator());;) {
|
|
2668
|
+
let p = Math.max(f - 1, 0);
|
|
2669
|
+
if (i && a && !d && (!s || s.index < f)) for (i.lastIndex < p && (i.lastIndex = p);;) {
|
|
2670
|
+
let t = i.exec(e);
|
|
2671
|
+
if (!t) {
|
|
2672
|
+
d = !0, s = void 0;
|
|
2673
|
+
break;
|
|
2674
|
+
}
|
|
2675
|
+
let n = a.exec(e.slice(Math.max(0, t.index - 65), t.index));
|
|
2676
|
+
if (n) {
|
|
2677
|
+
if (s = {
|
|
2678
|
+
schema: "mailto:",
|
|
2679
|
+
index: t.index - n[1].length,
|
|
2680
|
+
lastIndex: t.index + t[0].length
|
|
2681
|
+
}, s.index >= f) break;
|
|
2682
|
+
i.lastIndex < p && (i.lastIndex = p);
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
if (r && !u && (!o || o.index < f)) for (r.lastIndex < p && (r.lastIndex = p);;) {
|
|
2686
|
+
let t = r.exec(e);
|
|
2687
|
+
if (!t) {
|
|
2688
|
+
u = !0, o = void 0;
|
|
2689
|
+
break;
|
|
2690
|
+
}
|
|
2691
|
+
if (o = {
|
|
2692
|
+
schema: "",
|
|
2693
|
+
index: t.index + t[1].length,
|
|
2694
|
+
lastIndex: t.index + t[0].length
|
|
2695
|
+
}, o.index >= f) break;
|
|
2696
|
+
r.lastIndex < p && (r.lastIndex = p);
|
|
2697
|
+
}
|
|
2698
|
+
let m = s;
|
|
2699
|
+
(!m || o && (o.index < m.index || o.index === m.index && o.lastIndex > m.lastIndex)) && (m = o);
|
|
2700
|
+
let h;
|
|
2701
|
+
if (!l) for (;;) {
|
|
2702
|
+
if (!c) {
|
|
2703
|
+
n.lastIndex < p && (n.lastIndex = p);
|
|
2704
|
+
let t = n.exec(e);
|
|
2705
|
+
if (!t) {
|
|
2706
|
+
l = !0;
|
|
2707
|
+
break;
|
|
2708
|
+
}
|
|
2709
|
+
c = {
|
|
2710
|
+
schema: t[2],
|
|
2711
|
+
index: t.index + t[1].length,
|
|
2712
|
+
lastIndex: t.index + t[0].length
|
|
2713
|
+
};
|
|
2714
|
+
}
|
|
2715
|
+
if (c.index < f) {
|
|
2716
|
+
c = void 0;
|
|
2717
|
+
continue;
|
|
2718
|
+
}
|
|
2719
|
+
if (m && c.index > m.index) break;
|
|
2720
|
+
let t = c;
|
|
2721
|
+
c = void 0;
|
|
2722
|
+
let r = this.testSchemaAt(e, t.schema, t.lastIndex);
|
|
2723
|
+
if (r) {
|
|
2724
|
+
h = {
|
|
2725
|
+
schema: t.schema,
|
|
2726
|
+
index: t.index,
|
|
2727
|
+
lastIndex: t.lastIndex + r
|
|
2728
|
+
};
|
|
2729
|
+
break;
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
let g = h;
|
|
2733
|
+
if ((!g || s && (s.index < g.index || s.index === g.index && s.lastIndex > g.lastIndex)) && (g = s), (!g || o && (o.index < g.index || o.index === g.index && o.lastIndex > g.lastIndex)) && (g = o), !g) break;
|
|
2734
|
+
g === s ? s = void 0 : g === o && (o = void 0);
|
|
2735
|
+
let _ = new Wn(e, g.schema, g.index, g.lastIndex);
|
|
2736
|
+
_.schema ? this.__schemas__[_.schema].normalize(_, this) : this.normalize(_), t.push(_), f = g.lastIndex;
|
|
2737
|
+
}
|
|
2738
|
+
return t.length ? t : null;
|
|
2739
|
+
}
|
|
2740
|
+
matchAtStart(e) {
|
|
2741
|
+
if (!e.length) return null;
|
|
2742
|
+
let t = this.re.get_schema_at_start().exec(e);
|
|
2743
|
+
if (!t) return null;
|
|
2744
|
+
let n = this.testSchemaAt(e, t[2], t[0].length);
|
|
2745
|
+
if (!n) return null;
|
|
2746
|
+
let r = new Wn(e, t[2], t.index + t[1].length, t.index + t[0].length + n);
|
|
2747
|
+
return this.__schemas__[r.schema].normalize(r, this), r;
|
|
2748
|
+
}
|
|
2749
|
+
tlds(e, t = !1) {
|
|
2750
|
+
return e = Array.isArray(e) ? e : [e], t ? this.__opts__.tlds = this.__opts__.tlds.concat(e) : this.__opts__.tlds = e, this.re.set({
|
|
2751
|
+
...this.__opts__,
|
|
2752
|
+
schema_names: Object.keys(this.__schemas__)
|
|
2753
|
+
}), this;
|
|
2754
|
+
}
|
|
2755
|
+
normalize(e) {
|
|
2756
|
+
e.schema || (e.url = `http://${e.url}`), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = `mailto:${e.url}`);
|
|
2757
|
+
}
|
|
2758
|
+
}, J = 2147483647, Y = 36, Kn = 1, X = 26, qn = 38, Jn = 700, Yn = 72, Xn = 128, Zn = "-", Qn = /^xn--/, $n = /[^\0-\x7F]/, er = /[\x2E\u3002\uFF0E\uFF61]/g, tr = {
|
|
2759
|
+
overflow: "Overflow: input needs wider integers to process",
|
|
2760
|
+
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
2761
|
+
"invalid-input": "Invalid input"
|
|
2762
|
+
}, nr = 35, Z = Math.floor, rr = String.fromCharCode;
|
|
2763
|
+
function Q(e) {
|
|
2764
|
+
throw RangeError(tr[e]);
|
|
2765
|
+
}
|
|
2766
|
+
function ir(e, t) {
|
|
2767
|
+
let n = [], r = e.length;
|
|
2768
|
+
for (; r--;) n[r] = t(e[r]);
|
|
2769
|
+
return n;
|
|
2770
|
+
}
|
|
2771
|
+
function ar(e, t) {
|
|
2772
|
+
let n = e.split("@"), r = "";
|
|
2773
|
+
n.length > 1 && (r = n[0] + "@", e = n[1]), e = e.replace(er, ".");
|
|
2774
|
+
let i = ir(e.split("."), t).join(".");
|
|
2775
|
+
return r + i;
|
|
2776
|
+
}
|
|
2777
|
+
function or(e) {
|
|
2778
|
+
let t = [], n = 0, r = e.length;
|
|
2779
|
+
for (; n < r;) {
|
|
2780
|
+
let i = e.charCodeAt(n++);
|
|
2781
|
+
if (i >= 55296 && i <= 56319 && n < r) {
|
|
2782
|
+
let r = e.charCodeAt(n++);
|
|
2783
|
+
(r & 64512) == 56320 ? t.push(((i & 1023) << 10) + (r & 1023) + 65536) : (t.push(i), n--);
|
|
2784
|
+
} else t.push(i);
|
|
2785
|
+
}
|
|
2786
|
+
return t;
|
|
2787
|
+
}
|
|
2788
|
+
var sr = (e) => String.fromCodePoint(...e), cr = function(e) {
|
|
2789
|
+
return e >= 48 && e < 58 ? 26 + (e - 48) : e >= 65 && e < 91 ? e - 65 : e >= 97 && e < 123 ? e - 97 : Y;
|
|
2790
|
+
}, lr = function(e, t) {
|
|
2791
|
+
return e + 22 + 75 * (e < 26) - ((t != 0) << 5);
|
|
2792
|
+
}, ur = function(e, t, n) {
|
|
2793
|
+
let r = 0;
|
|
2794
|
+
for (e = n ? Z(e / Jn) : e >> 1, e += Z(e / t); e > 455; r += Y) e = Z(e / nr);
|
|
2795
|
+
return Z(r + 36 * e / (e + qn));
|
|
2796
|
+
}, dr = function(e) {
|
|
2797
|
+
let t = [], n = e.length, r = 0, i = Xn, a = Yn, o = e.lastIndexOf(Zn);
|
|
2798
|
+
o < 0 && (o = 0);
|
|
2799
|
+
for (let n = 0; n < o; ++n) e.charCodeAt(n) >= 128 && Q("not-basic"), t.push(e.charCodeAt(n));
|
|
2800
|
+
for (let s = o > 0 ? o + 1 : 0; s < n;) {
|
|
2801
|
+
let o = r;
|
|
2802
|
+
for (let t = 1, i = Y;; i += Y) {
|
|
2803
|
+
s >= n && Q("invalid-input");
|
|
2804
|
+
let o = cr(e.charCodeAt(s++));
|
|
2805
|
+
o >= Y && Q("invalid-input"), o > Z((J - r) / t) && Q("overflow"), r += o * t;
|
|
2806
|
+
let c = i <= a ? Kn : i >= a + X ? X : i - a;
|
|
2807
|
+
if (o < c) break;
|
|
2808
|
+
let l = Y - c;
|
|
2809
|
+
t > Z(J / l) && Q("overflow"), t *= l;
|
|
2810
|
+
}
|
|
2811
|
+
let c = t.length + 1;
|
|
2812
|
+
a = ur(r - o, c, o == 0), Z(r / c) > J - i && Q("overflow"), i += Z(r / c), r %= c, t.splice(r++, 0, i);
|
|
2813
|
+
}
|
|
2814
|
+
return String.fromCodePoint(...t);
|
|
2815
|
+
}, fr = function(e) {
|
|
2816
|
+
let t = [];
|
|
2817
|
+
e = or(e);
|
|
2818
|
+
let n = e.length, r = Xn, i = 0, a = Yn;
|
|
2819
|
+
for (let n of e) n < 128 && t.push(rr(n));
|
|
2820
|
+
let o = t.length, s = o;
|
|
2821
|
+
for (o && t.push(Zn); s < n;) {
|
|
2822
|
+
let n = J;
|
|
2823
|
+
for (let t of e) t >= r && t < n && (n = t);
|
|
2824
|
+
let c = s + 1;
|
|
2825
|
+
n - r > Z((J - i) / c) && Q("overflow"), i += (n - r) * c, r = n;
|
|
2826
|
+
for (let n of e) if (n < r && ++i > J && Q("overflow"), n === r) {
|
|
2827
|
+
let e = i;
|
|
2828
|
+
for (let n = Y;; n += Y) {
|
|
2829
|
+
let r = n <= a ? Kn : n >= a + X ? X : n - a;
|
|
2830
|
+
if (e < r) break;
|
|
2831
|
+
let i = e - r, o = Y - r;
|
|
2832
|
+
t.push(rr(lr(r + i % o, 0))), e = Z(i / o);
|
|
2833
|
+
}
|
|
2834
|
+
t.push(rr(lr(e, 0))), a = ur(i, c, s === o), i = 0, ++s;
|
|
2835
|
+
}
|
|
2836
|
+
++i, ++r;
|
|
2837
|
+
}
|
|
2838
|
+
return t.join("");
|
|
2839
|
+
}, pr = {
|
|
2840
|
+
version: "2.3.1",
|
|
2841
|
+
ucs2: {
|
|
2842
|
+
decode: or,
|
|
2843
|
+
encode: sr
|
|
2844
|
+
},
|
|
2845
|
+
decode: dr,
|
|
2846
|
+
encode: fr,
|
|
2847
|
+
toASCII: function(e) {
|
|
2848
|
+
return ar(e, function(e) {
|
|
2849
|
+
return $n.test(e) ? "xn--" + fr(e) : e;
|
|
2850
|
+
});
|
|
2851
|
+
},
|
|
2852
|
+
toUnicode: function(e) {
|
|
2853
|
+
return ar(e, function(e) {
|
|
2854
|
+
return Qn.test(e) ? dr(e.slice(4).toLowerCase()) : e;
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2857
|
+
}, mr = {
|
|
2858
|
+
default: {
|
|
2859
|
+
options: {
|
|
2860
|
+
html: !1,
|
|
2861
|
+
xhtmlOut: !1,
|
|
2862
|
+
breaks: !1,
|
|
2863
|
+
langPrefix: "language-",
|
|
2864
|
+
linkify: !1,
|
|
2865
|
+
typographer: !1,
|
|
2866
|
+
quotes: "“”‘’",
|
|
2867
|
+
highlight: null,
|
|
2868
|
+
maxNesting: 100
|
|
2869
|
+
},
|
|
2870
|
+
components: {
|
|
2871
|
+
core: {},
|
|
2872
|
+
block: {},
|
|
2873
|
+
inline: {}
|
|
2874
|
+
}
|
|
2875
|
+
},
|
|
2876
|
+
zero: {
|
|
2877
|
+
options: {
|
|
2878
|
+
html: !1,
|
|
2879
|
+
xhtmlOut: !1,
|
|
2880
|
+
breaks: !1,
|
|
2881
|
+
langPrefix: "language-",
|
|
2882
|
+
linkify: !1,
|
|
2883
|
+
typographer: !1,
|
|
2884
|
+
quotes: "“”‘’",
|
|
2885
|
+
highlight: null,
|
|
2886
|
+
maxNesting: 20
|
|
2887
|
+
},
|
|
2888
|
+
components: {
|
|
2889
|
+
core: { rules: [
|
|
2890
|
+
"normalize",
|
|
2891
|
+
"block",
|
|
2892
|
+
"strip_references",
|
|
2893
|
+
"inline",
|
|
2894
|
+
"text_join"
|
|
2895
|
+
] },
|
|
2896
|
+
block: { rules: ["paragraph"] },
|
|
2897
|
+
inline: {
|
|
2898
|
+
rules: ["text"],
|
|
2899
|
+
rules2: ["balance_pairs", "fragments_join"]
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
},
|
|
2903
|
+
commonmark: {
|
|
2904
|
+
options: {
|
|
2905
|
+
html: !0,
|
|
2906
|
+
xhtmlOut: !0,
|
|
2907
|
+
breaks: !1,
|
|
2908
|
+
langPrefix: "language-",
|
|
2909
|
+
linkify: !1,
|
|
2910
|
+
typographer: !1,
|
|
2911
|
+
quotes: "“”‘’",
|
|
2912
|
+
highlight: null,
|
|
2913
|
+
maxNesting: 20
|
|
2914
|
+
},
|
|
2915
|
+
components: {
|
|
2916
|
+
core: { rules: [
|
|
2917
|
+
"normalize",
|
|
2918
|
+
"block",
|
|
2919
|
+
"strip_references",
|
|
2920
|
+
"inline",
|
|
2921
|
+
"text_join"
|
|
2922
|
+
] },
|
|
2923
|
+
block: { rules: [
|
|
2924
|
+
"blockquote",
|
|
2925
|
+
"code",
|
|
2926
|
+
"fence",
|
|
2927
|
+
"heading",
|
|
2928
|
+
"hr",
|
|
2929
|
+
"html_block",
|
|
2930
|
+
"lheading",
|
|
2931
|
+
"list",
|
|
2932
|
+
"reference",
|
|
2933
|
+
"paragraph"
|
|
2934
|
+
] },
|
|
2935
|
+
inline: {
|
|
2936
|
+
rules: [
|
|
2937
|
+
"autolink",
|
|
2938
|
+
"backticks",
|
|
2939
|
+
"emphasis",
|
|
2940
|
+
"entity",
|
|
2941
|
+
"escape",
|
|
2942
|
+
"html_inline",
|
|
2943
|
+
"image",
|
|
2944
|
+
"link",
|
|
2945
|
+
"newline",
|
|
2946
|
+
"text"
|
|
2947
|
+
],
|
|
2948
|
+
rules2: [
|
|
2949
|
+
"balance_pairs",
|
|
2950
|
+
"emphasis",
|
|
2951
|
+
"fragments_join"
|
|
2952
|
+
]
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
}, hr = /^(vbscript|javascript|file|data):/, gr = /^data:image\/(gif|png|jpeg|webp);/, _r = [
|
|
2957
|
+
"http:",
|
|
2958
|
+
"https:",
|
|
2959
|
+
"mailto:"
|
|
2960
|
+
], $ = class {
|
|
2961
|
+
validateLink(e) {
|
|
2962
|
+
let t = e.trim().toLowerCase();
|
|
2963
|
+
return !hr.test(t) || gr.test(t);
|
|
2964
|
+
}
|
|
2965
|
+
normalizeLink(e) {
|
|
2966
|
+
let t = b(e, !0);
|
|
2967
|
+
if (t.hostname && (!t.protocol || _r.indexOf(t.protocol) >= 0)) try {
|
|
2968
|
+
t.hostname = pr.toASCII(t.hostname);
|
|
2969
|
+
} catch (e) {}
|
|
2970
|
+
return t.auth && (t.auth = s(t.auth)), t.hostname && (t.hostname = s(t.hostname)), t.pathname && (t.pathname = s(t.pathname)), t.search && (t.search = s(t.search)), t.hash && (t.hash = s(t.hash)), c(t);
|
|
2971
|
+
}
|
|
2972
|
+
normalizeLinkText(e) {
|
|
2973
|
+
let t = b(e, !0);
|
|
2974
|
+
if (t.hostname && (!t.protocol || _r.indexOf(t.protocol) >= 0)) try {
|
|
2975
|
+
t.hostname = pr.toUnicode(t.hostname);
|
|
2976
|
+
} catch (e) {}
|
|
2977
|
+
return i(c(t), i.defaultChars + "%");
|
|
2978
|
+
}
|
|
2979
|
+
constructor(...e) {
|
|
2980
|
+
D(this, "inline", new In()), D(this, "block", new Zt()), D(this, "core", new Et()), D(this, "renderer", new Ze()), D(this, "linkify", new Gn()), D(this, "utils", ke), D(this, "helpers", Object.assign({}, Xe));
|
|
2981
|
+
let [t, n] = e;
|
|
2982
|
+
typeof t == "string" ? (this.configure(t), n && this.set(n)) : (this.configure("default"), this.set(t || {}));
|
|
2983
|
+
}
|
|
2984
|
+
set(e) {
|
|
2985
|
+
return Object.assign(this.options, e), this;
|
|
2986
|
+
}
|
|
2987
|
+
configure(e) {
|
|
2988
|
+
let t;
|
|
2989
|
+
if (typeof e == "string") {
|
|
2990
|
+
let n = e;
|
|
2991
|
+
if (t = mr[n], !t) throw Error(`Wrong 'markdown-it' preset "${n}", check name`);
|
|
2992
|
+
} else t = e;
|
|
2993
|
+
if (!t) throw Error("Wrong `markdown-it` preset, can't be empty");
|
|
2994
|
+
t.options && (this.options = { ...t.options });
|
|
2995
|
+
let n = t.components;
|
|
2996
|
+
if (n) {
|
|
2997
|
+
var r;
|
|
2998
|
+
[
|
|
2999
|
+
"core",
|
|
3000
|
+
"block",
|
|
3001
|
+
"inline"
|
|
3002
|
+
].forEach((e) => {
|
|
3003
|
+
var t;
|
|
3004
|
+
let r = (t = n[e]) == null ? void 0 : t.rules;
|
|
3005
|
+
r && this[e].ruler.enableOnly(r);
|
|
3006
|
+
});
|
|
3007
|
+
let e = (r = n.inline) == null ? void 0 : r.rules2;
|
|
3008
|
+
e && this.inline.ruler2.enableOnly(e);
|
|
3009
|
+
}
|
|
3010
|
+
return this;
|
|
3011
|
+
}
|
|
3012
|
+
enable(e, t = !1) {
|
|
3013
|
+
let n = [];
|
|
3014
|
+
Array.isArray(e) || (e = [e]), [
|
|
3015
|
+
"core",
|
|
3016
|
+
"block",
|
|
3017
|
+
"inline"
|
|
3018
|
+
].forEach((t) => {
|
|
3019
|
+
n = n.concat(this[t].ruler.enable(e, !0));
|
|
3020
|
+
}), n = n.concat(this.inline.ruler2.enable(e, !0));
|
|
3021
|
+
let r = e.filter((e) => n.indexOf(e) < 0);
|
|
3022
|
+
if (r.length && !t) throw Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);
|
|
3023
|
+
return this;
|
|
3024
|
+
}
|
|
3025
|
+
disable(e, t = !1) {
|
|
3026
|
+
let n = [];
|
|
3027
|
+
Array.isArray(e) || (e = [e]), [
|
|
3028
|
+
"core",
|
|
3029
|
+
"block",
|
|
3030
|
+
"inline"
|
|
3031
|
+
].forEach((t) => {
|
|
3032
|
+
n = n.concat(this[t].ruler.disable(e, !0));
|
|
3033
|
+
}), n = n.concat(this.inline.ruler2.disable(e, !0));
|
|
3034
|
+
let r = e.filter((e) => n.indexOf(e) < 0);
|
|
3035
|
+
if (r.length && !t) throw Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);
|
|
3036
|
+
return this;
|
|
3037
|
+
}
|
|
3038
|
+
use(e, ...t) {
|
|
3039
|
+
return e.apply(e, [this, ...t]), this;
|
|
3040
|
+
}
|
|
3041
|
+
parse(e, t) {
|
|
3042
|
+
if (typeof e != "string") throw Error("Input data should be a String");
|
|
3043
|
+
let n = new this.core.State(e, this, t);
|
|
3044
|
+
return this.core.process(n), n.tokens;
|
|
3045
|
+
}
|
|
3046
|
+
render(e, t = {}) {
|
|
3047
|
+
return this.renderer.render(this.parse(e, t), this.options, t);
|
|
3048
|
+
}
|
|
3049
|
+
parseInline(e, t) {
|
|
3050
|
+
let n = new this.core.State(e, this, t);
|
|
3051
|
+
return n.inlineMode = !0, this.core.process(n), n.tokens;
|
|
3052
|
+
}
|
|
3053
|
+
renderInline(e, t = {}) {
|
|
3054
|
+
return this.renderer.render(this.parseInline(e, t), this.options, t);
|
|
3055
|
+
}
|
|
3056
|
+
};
|
|
3057
|
+
D($, "Token", z), D($, "Ruler", B), D($, "Renderer", Ze), D($, "ParserCore", Et), D($, "StateCore", Qe), D($, "ParserBlock", Zt), D($, "StateBlock", Dt), D($, "ParserInline", In), D($, "StateInline", Qt);
|
|
3058
|
+
//#endregion
|
|
3059
|
+
//#region src/index.ts
|
|
3060
|
+
var vr = Ae($);
|
|
3061
|
+
//#endregion
|
|
3062
|
+
export { vr as default };
|
|
3063
|
+
|
|
3064
|
+
//# sourceMappingURL=markdown-it.esm.min.mjs.map
|