mio-previewer 0.1.7 → 0.1.8
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 +12 -2
- package/README.zh-CN.md +26 -1
- package/dist/mio-previewer.cjs.js +7 -7
- package/dist/mio-previewer.es.js +460 -492
- package/package.json +1 -1
package/dist/mio-previewer.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as D0, h as Xu, ref as Yu, watch as bu, onMounted as ae, onUnmounted as ne, createElementBlock as ie, openBlock as se, createVNode as oe } from "vue";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as wr, a as Sr, e as vr, m as Ir } from "./cursorPlugin-CLM_tkck.js";
|
|
3
3
|
import { alertPlugin as qr, katexPlugin as Nr } from "./plugins/markdown-it.es.js";
|
|
4
4
|
const Ku = {};
|
|
5
5
|
function de(u) {
|
|
@@ -39,16 +39,16 @@ function tu(u, e) {
|
|
|
39
39
|
if ((i & 240) === 224 && a + 6 < n) {
|
|
40
40
|
const s = parseInt(r.slice(a + 4, a + 6), 16), o = parseInt(r.slice(a + 7, a + 9), 16);
|
|
41
41
|
if ((s & 192) === 128 && (o & 192) === 128) {
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const l = i << 12 & 61440 | s << 6 & 4032 | o & 63;
|
|
43
|
+
l < 2048 || l >= 55296 && l <= 57343 ? c += "���" : c += String.fromCharCode(l), a += 6;
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
if ((i & 248) === 240 && a + 9 < n) {
|
|
48
|
-
const s = parseInt(r.slice(a + 4, a + 6), 16), o = parseInt(r.slice(a + 7, a + 9), 16),
|
|
49
|
-
if ((s & 192) === 128 && (o & 192) === 128 && (
|
|
50
|
-
let
|
|
51
|
-
|
|
48
|
+
const s = parseInt(r.slice(a + 4, a + 6), 16), o = parseInt(r.slice(a + 7, a + 9), 16), l = parseInt(r.slice(a + 10, a + 12), 16);
|
|
49
|
+
if ((s & 192) === 128 && (o & 192) === 128 && (l & 192) === 128) {
|
|
50
|
+
let d = i << 18 & 1835008 | s << 12 & 258048 | o << 6 & 4032 | l & 63;
|
|
51
|
+
d < 65536 || d > 1114111 ? c += "����" : (d -= 65536, c += String.fromCharCode(55296 + (d >> 10), 56320 + (d & 1023))), a += 9;
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -142,27 +142,27 @@ mu.prototype.parse = function(u, e) {
|
|
|
142
142
|
let n = le.exec(a);
|
|
143
143
|
if (n && (n = n[0], t = n.toLowerCase(), this.protocol = n, a = a.substr(n.length)), (e || n || a.match(/^\/\/[^@\/]+@[^@\/]+/)) && (c = a.substr(0, 2) === "//", c && !(n && c0[n]) && (a = a.substr(2), this.slashes = !0)), !c0[n] && (c || n && !a0[n])) {
|
|
144
144
|
let o = -1;
|
|
145
|
-
for (let
|
|
146
|
-
r = a.indexOf(t0[
|
|
147
|
-
let
|
|
148
|
-
o === -1 ?
|
|
149
|
-
for (let
|
|
150
|
-
r = a.indexOf(e0[
|
|
145
|
+
for (let f = 0; f < t0.length; f++)
|
|
146
|
+
r = a.indexOf(t0[f]), r !== -1 && (o === -1 || r < o) && (o = r);
|
|
147
|
+
let l, d;
|
|
148
|
+
o === -1 ? d = a.lastIndexOf("@") : d = a.lastIndexOf("@", o), d !== -1 && (l = a.slice(0, d), a = a.slice(d + 1), this.auth = l), o = -1;
|
|
149
|
+
for (let f = 0; f < e0.length; f++)
|
|
150
|
+
r = a.indexOf(e0[f]), r !== -1 && (o === -1 || r < o) && (o = r);
|
|
151
151
|
o === -1 && (o = a.length), a[o - 1] === ":" && o--;
|
|
152
152
|
const h = a.slice(0, o);
|
|
153
153
|
a = a.slice(o), this.parseHost(h), this.hostname = this.hostname || "";
|
|
154
154
|
const b = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
155
155
|
if (!b) {
|
|
156
|
-
const
|
|
157
|
-
for (let x = 0,
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
let
|
|
161
|
-
for (let
|
|
162
|
-
|
|
163
|
-
if (!
|
|
164
|
-
const
|
|
165
|
-
|
|
156
|
+
const f = this.hostname.split(/\./);
|
|
157
|
+
for (let x = 0, g = f.length; x < g; x++) {
|
|
158
|
+
const D = f[x];
|
|
159
|
+
if (D && !D.match(r0)) {
|
|
160
|
+
let m = "";
|
|
161
|
+
for (let E = 0, _ = D.length; E < _; E++)
|
|
162
|
+
D.charCodeAt(E) > 127 ? m += "x" : m += D[E];
|
|
163
|
+
if (!m.match(r0)) {
|
|
164
|
+
const E = f.slice(0, x), _ = f.slice(x + 1), A = D.match(_e);
|
|
165
|
+
A && (E.push(A[1]), _.unshift(A[2])), _.length && (a = _.join(".") + a), this.hostname = E.join(".");
|
|
166
166
|
break;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -185,13 +185,13 @@ const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
185
185
|
encode: du,
|
|
186
186
|
format: Ou,
|
|
187
187
|
parse: Uu
|
|
188
|
-
}, Symbol.toStringTag, { value: "Module" })), C0 = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,
|
|
188
|
+
}, Symbol.toStringTag, { value: "Module" })), C0 = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, F0 = /[\0-\x1F\x7F-\x9F]/, Ee = /[\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]/, Vu = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\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\u1B5A-\u1B60\u1B7D\u1B7E\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[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\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]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, w0 = /[\$\+<->\^`\|~\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-\u20C0\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-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\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-\u31E3\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-\uFBC2\uFD40-\uFD4F\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]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\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-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, S0 = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
189
189
|
__proto__: null,
|
|
190
190
|
Any: C0,
|
|
191
|
-
Cc:
|
|
191
|
+
Cc: F0,
|
|
192
192
|
Cf: Ee,
|
|
193
193
|
P: Vu,
|
|
194
|
-
S:
|
|
194
|
+
S: w0,
|
|
195
195
|
Z: S0
|
|
196
196
|
}, Symbol.toStringTag, { value: "Module" })), ye = new Uint16Array(
|
|
197
197
|
// prettier-ignore
|
|
@@ -231,14 +231,14 @@ const Ce = /* @__PURE__ */ new Map([
|
|
|
231
231
|
[156, 339],
|
|
232
232
|
[158, 382],
|
|
233
233
|
[159, 376]
|
|
234
|
-
]),
|
|
234
|
+
]), Fe = (
|
|
235
235
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
236
236
|
(Cu = String.fromCodePoint) !== null && Cu !== void 0 ? Cu : function(u) {
|
|
237
237
|
let e = "";
|
|
238
238
|
return u > 65535 && (u -= 65536, e += String.fromCharCode(u >>> 10 & 1023 | 55296), u = 56320 | u & 1023), e += String.fromCharCode(u), e;
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
|
-
function
|
|
241
|
+
function we(u) {
|
|
242
242
|
var e;
|
|
243
243
|
return u >= 55296 && u <= 57343 || u > 1114111 ? 65533 : (e = Ce.get(u)) !== null && e !== void 0 ? e : u;
|
|
244
244
|
}
|
|
@@ -383,7 +383,7 @@ let qe = class {
|
|
|
383
383
|
this.consumed += 1;
|
|
384
384
|
else if (this.decodeMode === W.Strict)
|
|
385
385
|
return 0;
|
|
386
|
-
return this.emitCodePoint(
|
|
386
|
+
return this.emitCodePoint(we(this.result), this.consumed), this.errors && (e !== T.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
|
|
387
387
|
}
|
|
388
388
|
/**
|
|
389
389
|
* Parses a named entity.
|
|
@@ -461,7 +461,7 @@ let qe = class {
|
|
|
461
461
|
};
|
|
462
462
|
function v0(u) {
|
|
463
463
|
let e = "";
|
|
464
|
-
const t = new qe(u, (r) => e +=
|
|
464
|
+
const t = new qe(u, (r) => e += Fe(r));
|
|
465
465
|
return function(c, a) {
|
|
466
466
|
let n = 0, i = 0;
|
|
467
467
|
for (; (i = c.indexOf("&", i)) >= 0; ) {
|
|
@@ -574,7 +574,7 @@ const Ge = /[.?*+^$[\]\\(){}|-]/g;
|
|
|
574
574
|
function We(u) {
|
|
575
575
|
return u.replace(Ge, "\\$&");
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function w(u) {
|
|
578
578
|
switch (u) {
|
|
579
579
|
case 9:
|
|
580
580
|
case 32:
|
|
@@ -607,7 +607,7 @@ function nu(u) {
|
|
|
607
607
|
return !1;
|
|
608
608
|
}
|
|
609
609
|
function iu(u) {
|
|
610
|
-
return Vu.test(u) ||
|
|
610
|
+
return Vu.test(u) || w0.test(u);
|
|
611
611
|
}
|
|
612
612
|
function su(u) {
|
|
613
613
|
switch (u) {
|
|
@@ -661,7 +661,7 @@ const Qe = { mdurl: ke, ucmicro: Ae }, Je = /* @__PURE__ */ Object.freeze(/* @__
|
|
|
661
661
|
has: Me,
|
|
662
662
|
isMdAsciiPunct: su,
|
|
663
663
|
isPunctChar: iu,
|
|
664
|
-
isSpace:
|
|
664
|
+
isSpace: w,
|
|
665
665
|
isString: $u,
|
|
666
666
|
isValidEntityCode: Hu,
|
|
667
667
|
isWhiteSpace: nu,
|
|
@@ -780,18 +780,18 @@ $.fence = function(u, e, t, r, c) {
|
|
|
780
780
|
const a = u[e], n = a.info ? ru(a.info).trim() : "";
|
|
781
781
|
let i = "", s = "";
|
|
782
782
|
if (n) {
|
|
783
|
-
const
|
|
784
|
-
i =
|
|
783
|
+
const l = n.split(/(\s+)/g);
|
|
784
|
+
i = l[0], s = l.slice(2).join("");
|
|
785
785
|
}
|
|
786
786
|
let o;
|
|
787
787
|
if (t.highlight ? o = t.highlight(a.content, i, s) || X(a.content) : o = X(a.content), o.indexOf("<pre") === 0)
|
|
788
788
|
return o + `
|
|
789
789
|
`;
|
|
790
790
|
if (n) {
|
|
791
|
-
const
|
|
792
|
-
|
|
791
|
+
const l = a.attrIndex("class"), d = a.attrs ? a.attrs.slice() : [];
|
|
792
|
+
l < 0 ? d.push(["class", t.langPrefix + i]) : (d[l] = d[l].slice(), d[l][1] += " " + t.langPrefix + i);
|
|
793
793
|
const h = {
|
|
794
|
-
attrs:
|
|
794
|
+
attrs: d
|
|
795
795
|
};
|
|
796
796
|
return `<pre><code${c.renderAttrs(h)}>${o}</code></pre>
|
|
797
797
|
`;
|
|
@@ -1053,32 +1053,32 @@ function st(u) {
|
|
|
1053
1053
|
if (i.type === "html_inline" && (nt(i.content) && a > 0 && a--, it(i.content) && a++), !(a > 0) && i.type === "text" && u.md.linkify.test(i.content)) {
|
|
1054
1054
|
const s = i.content;
|
|
1055
1055
|
let o = u.md.linkify.match(s);
|
|
1056
|
-
const
|
|
1057
|
-
let
|
|
1056
|
+
const l = [];
|
|
1057
|
+
let d = i.level, h = 0;
|
|
1058
1058
|
o.length > 0 && o[0].index === 0 && n > 0 && c[n - 1].type === "text_special" && (o = o.slice(1));
|
|
1059
1059
|
for (let b = 0; b < o.length; b++) {
|
|
1060
|
-
const
|
|
1060
|
+
const f = o[b].url, x = u.md.normalizeLink(f);
|
|
1061
1061
|
if (!u.md.validateLink(x))
|
|
1062
1062
|
continue;
|
|
1063
|
-
let
|
|
1064
|
-
o[b].schema ? o[b].schema === "mailto:" && !/^mailto:/i.test(
|
|
1065
|
-
const
|
|
1066
|
-
if (
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1063
|
+
let g = o[b].text;
|
|
1064
|
+
o[b].schema ? o[b].schema === "mailto:" && !/^mailto:/i.test(g) ? g = u.md.normalizeLinkText("mailto:" + g).replace(/^mailto:/, "") : g = u.md.normalizeLinkText(g) : g = u.md.normalizeLinkText("http://" + g).replace(/^http:\/\//, "");
|
|
1065
|
+
const D = o[b].index;
|
|
1066
|
+
if (D > h) {
|
|
1067
|
+
const A = new u.Token("text", "", 0);
|
|
1068
|
+
A.content = s.slice(h, D), A.level = d, l.push(A);
|
|
1069
1069
|
}
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1070
|
+
const m = new u.Token("link_open", "a", 1);
|
|
1071
|
+
m.attrs = [["href", x]], m.level = d++, m.markup = "linkify", m.info = "auto", l.push(m);
|
|
1072
|
+
const E = new u.Token("text", "", 0);
|
|
1073
|
+
E.content = g, E.level = d, l.push(E);
|
|
1074
|
+
const _ = new u.Token("link_close", "a", -1);
|
|
1075
|
+
_.level = --d, _.markup = "linkify", _.info = "auto", l.push(_), h = o[b].lastIndex;
|
|
1076
1076
|
}
|
|
1077
1077
|
if (h < s.length) {
|
|
1078
1078
|
const b = new u.Token("text", "", 0);
|
|
1079
|
-
b.content = s.slice(h), b.level =
|
|
1079
|
+
b.content = s.slice(h), b.level = d, l.push(b);
|
|
1080
1080
|
}
|
|
1081
|
-
e[t].children = c = T0(c, n,
|
|
1081
|
+
e[t].children = c = T0(c, n, l);
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
@@ -1128,19 +1128,19 @@ function mt(u, e) {
|
|
|
1128
1128
|
u:
|
|
1129
1129
|
for (; s < o; ) {
|
|
1130
1130
|
n0.lastIndex = s;
|
|
1131
|
-
const
|
|
1132
|
-
if (!
|
|
1131
|
+
const l = n0.exec(i);
|
|
1132
|
+
if (!l)
|
|
1133
1133
|
break;
|
|
1134
|
-
let
|
|
1135
|
-
s =
|
|
1136
|
-
const b =
|
|
1137
|
-
let
|
|
1138
|
-
if (
|
|
1139
|
-
|
|
1134
|
+
let d = !0, h = !0;
|
|
1135
|
+
s = l.index + 1;
|
|
1136
|
+
const b = l[0] === "'";
|
|
1137
|
+
let f = 32;
|
|
1138
|
+
if (l.index - 1 >= 0)
|
|
1139
|
+
f = i.charCodeAt(l.index - 1);
|
|
1140
1140
|
else
|
|
1141
1141
|
for (t = c - 1; t >= 0 && !(u[t].type === "softbreak" || u[t].type === "hardbreak"); t--)
|
|
1142
1142
|
if (u[t].content) {
|
|
1143
|
-
|
|
1143
|
+
f = u[t].content.charCodeAt(u[t].content.length - 1);
|
|
1144
1144
|
break;
|
|
1145
1145
|
}
|
|
1146
1146
|
let x = 32;
|
|
@@ -1152,33 +1152,33 @@ function mt(u, e) {
|
|
|
1152
1152
|
x = u[t].content.charCodeAt(0);
|
|
1153
1153
|
break;
|
|
1154
1154
|
}
|
|
1155
|
-
const
|
|
1156
|
-
if (
|
|
1157
|
-
b && (a.content = hu(a.content,
|
|
1155
|
+
const g = su(f) || iu(String.fromCharCode(f)), D = su(x) || iu(String.fromCharCode(x)), m = nu(f), E = nu(x);
|
|
1156
|
+
if (E ? d = !1 : D && (m || g || (d = !1)), m ? h = !1 : g && (E || D || (h = !1)), x === 34 && l[0] === '"' && f >= 48 && f <= 57 && (h = d = !1), d && h && (d = g, h = D), !d && !h) {
|
|
1157
|
+
b && (a.content = hu(a.content, l.index, i0));
|
|
1158
1158
|
continue;
|
|
1159
1159
|
}
|
|
1160
1160
|
if (h)
|
|
1161
1161
|
for (t = r.length - 1; t >= 0; t--) {
|
|
1162
|
-
let
|
|
1162
|
+
let _ = r[t];
|
|
1163
1163
|
if (r[t].level < n)
|
|
1164
1164
|
break;
|
|
1165
|
-
if (
|
|
1166
|
-
|
|
1167
|
-
let
|
|
1168
|
-
b ? (
|
|
1169
|
-
u[
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
), s +=
|
|
1165
|
+
if (_.single === b && r[t].level === n) {
|
|
1166
|
+
_ = r[t];
|
|
1167
|
+
let A, y;
|
|
1168
|
+
b ? (A = e.md.options.quotes[2], y = e.md.options.quotes[3]) : (A = e.md.options.quotes[0], y = e.md.options.quotes[1]), a.content = hu(a.content, l.index, y), u[_.token].content = hu(
|
|
1169
|
+
u[_.token].content,
|
|
1170
|
+
_.pos,
|
|
1171
|
+
A
|
|
1172
|
+
), s += y.length - 1, _.token === c && (s += A.length - 1), i = a.content, o = i.length, r.length = t;
|
|
1173
1173
|
continue u;
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
|
|
1176
|
+
d ? r.push({
|
|
1177
1177
|
token: c,
|
|
1178
|
-
pos:
|
|
1178
|
+
pos: l.index,
|
|
1179
1179
|
single: b,
|
|
1180
1180
|
level: n
|
|
1181
|
-
}) : h && b && (a.content = hu(a.content,
|
|
1181
|
+
}) : h && b && (a.content = hu(a.content, l.index, i0));
|
|
1182
1182
|
}
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
@@ -1200,7 +1200,7 @@ function _t(u) {
|
|
|
1200
1200
|
e !== t && (n.length = t);
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
|
-
const
|
|
1203
|
+
const Fu = [
|
|
1204
1204
|
["normalize", rt],
|
|
1205
1205
|
["block", ct],
|
|
1206
1206
|
["inline", at],
|
|
@@ -1213,8 +1213,8 @@ const wu = [
|
|
|
1213
1213
|
];
|
|
1214
1214
|
function ju() {
|
|
1215
1215
|
this.ruler = new B();
|
|
1216
|
-
for (let u = 0; u <
|
|
1217
|
-
this.ruler.push(
|
|
1216
|
+
for (let u = 0; u < Fu.length; u++)
|
|
1217
|
+
this.ruler.push(Fu[u][0], Fu[u][1]);
|
|
1218
1218
|
}
|
|
1219
1219
|
ju.prototype.process = function(u) {
|
|
1220
1220
|
const e = this.ruler.getRules("");
|
|
@@ -1225,15 +1225,15 @@ ju.prototype.State = N0;
|
|
|
1225
1225
|
function H(u, e, t, r) {
|
|
1226
1226
|
this.src = u, this.md = e, this.env = t, this.tokens = r, this.bMarks = [], this.eMarks = [], this.tShift = [], this.sCount = [], this.bsCount = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.ddIndent = -1, this.listIndent = -1, this.parentType = "root", this.level = 0;
|
|
1227
1227
|
const c = this.src;
|
|
1228
|
-
for (let a = 0, n = 0, i = 0, s = 0, o = c.length,
|
|
1229
|
-
const
|
|
1230
|
-
if (!
|
|
1231
|
-
if (
|
|
1232
|
-
i++,
|
|
1228
|
+
for (let a = 0, n = 0, i = 0, s = 0, o = c.length, l = !1; n < o; n++) {
|
|
1229
|
+
const d = c.charCodeAt(n);
|
|
1230
|
+
if (!l)
|
|
1231
|
+
if (w(d)) {
|
|
1232
|
+
i++, d === 9 ? s += 4 - s % 4 : s++;
|
|
1233
1233
|
continue;
|
|
1234
1234
|
} else
|
|
1235
|
-
|
|
1236
|
-
(
|
|
1235
|
+
l = !0;
|
|
1236
|
+
(d === 10 || n === o - 1) && (d !== 10 && n++, this.bMarks.push(a), this.eMarks.push(n), this.tShift.push(i), this.sCount.push(s), this.bsCount.push(0), l = !1, i = 0, s = 0, a = n + 1);
|
|
1237
1237
|
}
|
|
1238
1238
|
this.bMarks.push(c.length), this.eMarks.push(c.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
|
|
1239
1239
|
}
|
|
@@ -1252,7 +1252,7 @@ H.prototype.skipEmptyLines = function(e) {
|
|
|
1252
1252
|
H.prototype.skipSpaces = function(e) {
|
|
1253
1253
|
for (let t = this.src.length; e < t; e++) {
|
|
1254
1254
|
const r = this.src.charCodeAt(e);
|
|
1255
|
-
if (!
|
|
1255
|
+
if (!w(r))
|
|
1256
1256
|
break;
|
|
1257
1257
|
}
|
|
1258
1258
|
return e;
|
|
@@ -1261,7 +1261,7 @@ H.prototype.skipSpacesBack = function(e, t) {
|
|
|
1261
1261
|
if (e <= t)
|
|
1262
1262
|
return e;
|
|
1263
1263
|
for (; e > t; )
|
|
1264
|
-
if (!
|
|
1264
|
+
if (!w(this.src.charCodeAt(--e)))
|
|
1265
1265
|
return e + 1;
|
|
1266
1266
|
return e;
|
|
1267
1267
|
};
|
|
@@ -1285,24 +1285,24 @@ H.prototype.getLines = function(e, t, r, c) {
|
|
|
1285
1285
|
for (let n = 0, i = e; i < t; i++, n++) {
|
|
1286
1286
|
let s = 0;
|
|
1287
1287
|
const o = this.bMarks[i];
|
|
1288
|
-
let
|
|
1289
|
-
for (i + 1 < t || c ?
|
|
1290
|
-
const h = this.src.charCodeAt(
|
|
1291
|
-
if (
|
|
1288
|
+
let l = o, d;
|
|
1289
|
+
for (i + 1 < t || c ? d = this.eMarks[i] + 1 : d = this.eMarks[i]; l < d && s < r; ) {
|
|
1290
|
+
const h = this.src.charCodeAt(l);
|
|
1291
|
+
if (w(h))
|
|
1292
1292
|
h === 9 ? s += 4 - (s + this.bsCount[i]) % 4 : s++;
|
|
1293
|
-
else if (
|
|
1293
|
+
else if (l - o < this.tShift[i])
|
|
1294
1294
|
s++;
|
|
1295
1295
|
else
|
|
1296
1296
|
break;
|
|
1297
|
-
|
|
1297
|
+
l++;
|
|
1298
1298
|
}
|
|
1299
|
-
s > r ? a[n] = new Array(s - r + 1).join(" ") + this.src.slice(
|
|
1299
|
+
s > r ? a[n] = new Array(s - r + 1).join(" ") + this.src.slice(l, d) : a[n] = this.src.slice(l, d);
|
|
1300
1300
|
}
|
|
1301
1301
|
return a.join("");
|
|
1302
1302
|
};
|
|
1303
1303
|
H.prototype.Token = z;
|
|
1304
1304
|
const kt = 65536;
|
|
1305
|
-
function
|
|
1305
|
+
function wu(u, e) {
|
|
1306
1306
|
const t = u.bMarks[e] + u.tShift[e], r = u.eMarks[e];
|
|
1307
1307
|
return u.src.slice(t, r);
|
|
1308
1308
|
}
|
|
@@ -1326,75 +1326,75 @@ function Et(u, e, t, r) {
|
|
|
1326
1326
|
if (n !== 124 && n !== 45 && n !== 58 || a >= u.eMarks[c])
|
|
1327
1327
|
return !1;
|
|
1328
1328
|
const i = u.src.charCodeAt(a++);
|
|
1329
|
-
if (i !== 124 && i !== 45 && i !== 58 && !
|
|
1329
|
+
if (i !== 124 && i !== 45 && i !== 58 && !w(i) || n === 45 && w(i))
|
|
1330
1330
|
return !1;
|
|
1331
1331
|
for (; a < u.eMarks[c]; ) {
|
|
1332
|
-
const
|
|
1333
|
-
if (
|
|
1332
|
+
const _ = u.src.charCodeAt(a);
|
|
1333
|
+
if (_ !== 124 && _ !== 45 && _ !== 58 && !w(_))
|
|
1334
1334
|
return !1;
|
|
1335
1335
|
a++;
|
|
1336
1336
|
}
|
|
1337
|
-
let s =
|
|
1338
|
-
const
|
|
1339
|
-
for (let
|
|
1340
|
-
const
|
|
1341
|
-
if (!
|
|
1342
|
-
if (
|
|
1337
|
+
let s = wu(u, e + 1), o = s.split("|");
|
|
1338
|
+
const l = [];
|
|
1339
|
+
for (let _ = 0; _ < o.length; _++) {
|
|
1340
|
+
const A = o[_].trim();
|
|
1341
|
+
if (!A) {
|
|
1342
|
+
if (_ === 0 || _ === o.length - 1)
|
|
1343
1343
|
continue;
|
|
1344
1344
|
return !1;
|
|
1345
1345
|
}
|
|
1346
|
-
if (!/^:?-+:?$/.test(
|
|
1346
|
+
if (!/^:?-+:?$/.test(A))
|
|
1347
1347
|
return !1;
|
|
1348
|
-
|
|
1348
|
+
A.charCodeAt(A.length - 1) === 58 ? l.push(A.charCodeAt(0) === 58 ? "center" : "right") : A.charCodeAt(0) === 58 ? l.push("left") : l.push("");
|
|
1349
1349
|
}
|
|
1350
|
-
if (s =
|
|
1350
|
+
if (s = wu(u, e).trim(), s.indexOf("|") === -1 || u.sCount[e] - u.blkIndent >= 4)
|
|
1351
1351
|
return !1;
|
|
1352
1352
|
o = s0(s), o.length && o[0] === "" && o.shift(), o.length && o[o.length - 1] === "" && o.pop();
|
|
1353
|
-
const
|
|
1354
|
-
if (
|
|
1353
|
+
const d = o.length;
|
|
1354
|
+
if (d === 0 || d !== l.length)
|
|
1355
1355
|
return !1;
|
|
1356
1356
|
if (r)
|
|
1357
1357
|
return !0;
|
|
1358
1358
|
const h = u.parentType;
|
|
1359
1359
|
u.parentType = "table";
|
|
1360
|
-
const b = u.md.block.ruler.getRules("blockquote"),
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
for (let
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1360
|
+
const b = u.md.block.ruler.getRules("blockquote"), f = u.push("table_open", "table", 1), x = [e, 0];
|
|
1361
|
+
f.map = x;
|
|
1362
|
+
const g = u.push("thead_open", "thead", 1);
|
|
1363
|
+
g.map = [e, e + 1];
|
|
1364
|
+
const D = u.push("tr_open", "tr", 1);
|
|
1365
|
+
D.map = [e, e + 1];
|
|
1366
|
+
for (let _ = 0; _ < o.length; _++) {
|
|
1367
|
+
const A = u.push("th_open", "th", 1);
|
|
1368
|
+
l[_] && (A.attrs = [["style", "text-align:" + l[_]]]);
|
|
1369
|
+
const y = u.push("inline", "", 0);
|
|
1370
|
+
y.content = o[_].trim(), y.children = [], u.push("th_close", "th", -1);
|
|
1371
1371
|
}
|
|
1372
1372
|
u.push("tr_close", "tr", -1), u.push("thead_close", "thead", -1);
|
|
1373
|
-
let
|
|
1373
|
+
let m, E = 0;
|
|
1374
1374
|
for (c = e + 2; c < t && !(u.sCount[c] < u.blkIndent); c++) {
|
|
1375
|
-
let
|
|
1376
|
-
for (let
|
|
1377
|
-
if (b[
|
|
1378
|
-
|
|
1375
|
+
let _ = !1;
|
|
1376
|
+
for (let y = 0, N = b.length; y < N; y++)
|
|
1377
|
+
if (b[y](u, c, t, !0)) {
|
|
1378
|
+
_ = !0;
|
|
1379
1379
|
break;
|
|
1380
1380
|
}
|
|
1381
|
-
if (
|
|
1381
|
+
if (_ || (s = wu(u, c).trim(), !s) || u.sCount[c] - u.blkIndent >= 4 || (o = s0(s), o.length && o[0] === "" && o.shift(), o.length && o[o.length - 1] === "" && o.pop(), E += d - o.length, E > kt))
|
|
1382
1382
|
break;
|
|
1383
1383
|
if (c === e + 2) {
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1384
|
+
const y = u.push("tbody_open", "tbody", 1);
|
|
1385
|
+
y.map = m = [e + 2, 0];
|
|
1386
1386
|
}
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
for (let
|
|
1387
|
+
const A = u.push("tr_open", "tr", 1);
|
|
1388
|
+
A.map = [c, c + 1];
|
|
1389
|
+
for (let y = 0; y < d; y++) {
|
|
1390
1390
|
const N = u.push("td_open", "td", 1);
|
|
1391
|
-
|
|
1391
|
+
l[y] && (N.attrs = [["style", "text-align:" + l[y]]]);
|
|
1392
1392
|
const M = u.push("inline", "", 0);
|
|
1393
|
-
M.content = o[
|
|
1393
|
+
M.content = o[y] ? o[y].trim() : "", M.children = [], u.push("td_close", "td", -1);
|
|
1394
1394
|
}
|
|
1395
1395
|
u.push("tr_close", "tr", -1);
|
|
1396
1396
|
}
|
|
1397
|
-
return
|
|
1397
|
+
return m && (u.push("tbody_close", "tbody", -1), m[1] = c), u.push("table_close", "table", -1), x[1] = c, u.parentType = h, u.line = c, !0;
|
|
1398
1398
|
}
|
|
1399
1399
|
function At(u, e, t) {
|
|
1400
1400
|
if (u.sCount[e] - u.blkIndent < 4)
|
|
@@ -1428,20 +1428,20 @@ function yt(u, e, t, r) {
|
|
|
1428
1428
|
let s = c - i;
|
|
1429
1429
|
if (s < 3)
|
|
1430
1430
|
return !1;
|
|
1431
|
-
const o = u.src.slice(i, c),
|
|
1432
|
-
if (n === 96 &&
|
|
1431
|
+
const o = u.src.slice(i, c), l = u.src.slice(c, a);
|
|
1432
|
+
if (n === 96 && l.indexOf(String.fromCharCode(n)) >= 0)
|
|
1433
1433
|
return !1;
|
|
1434
1434
|
if (r)
|
|
1435
1435
|
return !0;
|
|
1436
|
-
let
|
|
1437
|
-
for (;
|
|
1438
|
-
if (u.src.charCodeAt(c) === n && !(u.sCount[
|
|
1436
|
+
let d = e, h = !1;
|
|
1437
|
+
for (; d++, !(d >= t || (c = i = u.bMarks[d] + u.tShift[d], a = u.eMarks[d], c < a && u.sCount[d] < u.blkIndent)); )
|
|
1438
|
+
if (u.src.charCodeAt(c) === n && !(u.sCount[d] - u.blkIndent >= 4) && (c = u.skipChars(c, n), !(c - i < s) && (c = u.skipSpaces(c), !(c < a)))) {
|
|
1439
1439
|
h = !0;
|
|
1440
1440
|
break;
|
|
1441
1441
|
}
|
|
1442
|
-
s = u.sCount[e], u.line =
|
|
1442
|
+
s = u.sCount[e], u.line = d + (h ? 1 : 0);
|
|
1443
1443
|
const b = u.push("fence", "code", 0);
|
|
1444
|
-
return b.info =
|
|
1444
|
+
return b.info = l, b.content = u.getLines(e + 1, d, s, !0), b.markup = o, b.map = [e, u.line], !0;
|
|
1445
1445
|
}
|
|
1446
1446
|
function Dt(u, e, t, r) {
|
|
1447
1447
|
let c = u.bMarks[e] + u.tShift[e], a = u.eMarks[e];
|
|
@@ -1450,52 +1450,52 @@ function Dt(u, e, t, r) {
|
|
|
1450
1450
|
return !1;
|
|
1451
1451
|
if (r)
|
|
1452
1452
|
return !0;
|
|
1453
|
-
const i = [], s = [], o = [],
|
|
1453
|
+
const i = [], s = [], o = [], l = [], d = u.md.block.ruler.getRules("blockquote"), h = u.parentType;
|
|
1454
1454
|
u.parentType = "blockquote";
|
|
1455
|
-
let b = !1,
|
|
1456
|
-
for (
|
|
1457
|
-
const
|
|
1458
|
-
if (c = u.bMarks[
|
|
1455
|
+
let b = !1, f;
|
|
1456
|
+
for (f = e; f < t; f++) {
|
|
1457
|
+
const E = u.sCount[f] < u.blkIndent;
|
|
1458
|
+
if (c = u.bMarks[f] + u.tShift[f], a = u.eMarks[f], c >= a)
|
|
1459
1459
|
break;
|
|
1460
|
-
if (u.src.charCodeAt(c++) === 62 && !
|
|
1461
|
-
let
|
|
1462
|
-
u.src.charCodeAt(c) === 32 ? (c++,
|
|
1463
|
-
let M =
|
|
1464
|
-
for (i.push(u.bMarks[
|
|
1460
|
+
if (u.src.charCodeAt(c++) === 62 && !E) {
|
|
1461
|
+
let A = u.sCount[f] + 1, y, N;
|
|
1462
|
+
u.src.charCodeAt(c) === 32 ? (c++, A++, N = !1, y = !0) : u.src.charCodeAt(c) === 9 ? (y = !0, (u.bsCount[f] + A) % 4 === 3 ? (c++, A++, N = !1) : N = !0) : y = !1;
|
|
1463
|
+
let M = A;
|
|
1464
|
+
for (i.push(u.bMarks[f]), u.bMarks[f] = c; c < a; ) {
|
|
1465
1465
|
const Z = u.src.charCodeAt(c);
|
|
1466
|
-
if (
|
|
1467
|
-
Z === 9 ? M += 4 - (M + u.bsCount[
|
|
1466
|
+
if (w(Z))
|
|
1467
|
+
Z === 9 ? M += 4 - (M + u.bsCount[f] + (N ? 1 : 0)) % 4 : M++;
|
|
1468
1468
|
else
|
|
1469
1469
|
break;
|
|
1470
1470
|
c++;
|
|
1471
1471
|
}
|
|
1472
|
-
b = c >= a, s.push(u.bsCount[
|
|
1472
|
+
b = c >= a, s.push(u.bsCount[f]), u.bsCount[f] = u.sCount[f] + 1 + (y ? 1 : 0), o.push(u.sCount[f]), u.sCount[f] = M - A, l.push(u.tShift[f]), u.tShift[f] = c - u.bMarks[f];
|
|
1473
1473
|
continue;
|
|
1474
1474
|
}
|
|
1475
1475
|
if (b)
|
|
1476
1476
|
break;
|
|
1477
|
-
let
|
|
1478
|
-
for (let
|
|
1479
|
-
if (
|
|
1480
|
-
|
|
1477
|
+
let _ = !1;
|
|
1478
|
+
for (let A = 0, y = d.length; A < y; A++)
|
|
1479
|
+
if (d[A](u, f, t, !0)) {
|
|
1480
|
+
_ = !0;
|
|
1481
1481
|
break;
|
|
1482
1482
|
}
|
|
1483
|
-
if (
|
|
1484
|
-
u.lineMax =
|
|
1483
|
+
if (_) {
|
|
1484
|
+
u.lineMax = f, u.blkIndent !== 0 && (i.push(u.bMarks[f]), s.push(u.bsCount[f]), l.push(u.tShift[f]), o.push(u.sCount[f]), u.sCount[f] -= u.blkIndent);
|
|
1485
1485
|
break;
|
|
1486
1486
|
}
|
|
1487
|
-
i.push(u.bMarks[
|
|
1487
|
+
i.push(u.bMarks[f]), s.push(u.bsCount[f]), l.push(u.tShift[f]), o.push(u.sCount[f]), u.sCount[f] = -1;
|
|
1488
1488
|
}
|
|
1489
1489
|
const x = u.blkIndent;
|
|
1490
1490
|
u.blkIndent = 0;
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
for (let
|
|
1498
|
-
u.bMarks[
|
|
1491
|
+
const g = u.push("blockquote_open", "blockquote", 1);
|
|
1492
|
+
g.markup = ">";
|
|
1493
|
+
const D = [e, 0];
|
|
1494
|
+
g.map = D, u.md.block.tokenize(u, e, f);
|
|
1495
|
+
const m = u.push("blockquote_close", "blockquote", -1);
|
|
1496
|
+
m.markup = ">", u.lineMax = n, u.parentType = h, D[1] = u.line;
|
|
1497
|
+
for (let E = 0; E < l.length; E++)
|
|
1498
|
+
u.bMarks[E + e] = i[E], u.tShift[E + e] = l[E], u.sCount[E + e] = o[E], u.bsCount[E + e] = s[E];
|
|
1499
1499
|
return u.blkIndent = x, !0;
|
|
1500
1500
|
}
|
|
1501
1501
|
function Ct(u, e, t, r) {
|
|
@@ -1509,7 +1509,7 @@ function Ct(u, e, t, r) {
|
|
|
1509
1509
|
let i = 1;
|
|
1510
1510
|
for (; a < c; ) {
|
|
1511
1511
|
const o = u.src.charCodeAt(a++);
|
|
1512
|
-
if (o !== n && !
|
|
1512
|
+
if (o !== n && !w(o))
|
|
1513
1513
|
return !1;
|
|
1514
1514
|
o === n && i++;
|
|
1515
1515
|
}
|
|
@@ -1529,7 +1529,7 @@ function o0(u, e) {
|
|
|
1529
1529
|
return -1;
|
|
1530
1530
|
if (r < t) {
|
|
1531
1531
|
const a = u.src.charCodeAt(r);
|
|
1532
|
-
if (!
|
|
1532
|
+
if (!w(a))
|
|
1533
1533
|
return -1;
|
|
1534
1534
|
}
|
|
1535
1535
|
return r;
|
|
@@ -1554,169 +1554,169 @@ function d0(u, e) {
|
|
|
1554
1554
|
break;
|
|
1555
1555
|
return -1;
|
|
1556
1556
|
}
|
|
1557
|
-
return c < r && (a = u.src.charCodeAt(c), !
|
|
1557
|
+
return c < r && (a = u.src.charCodeAt(c), !w(a)) ? -1 : c;
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function Ft(u, e) {
|
|
1560
1560
|
const t = u.level + 2;
|
|
1561
1561
|
for (let r = e + 2, c = u.tokens.length - 2; r < c; r++)
|
|
1562
1562
|
u.tokens[r].level === t && u.tokens[r].type === "paragraph_open" && (u.tokens[r + 2].hidden = !0, u.tokens[r].hidden = !0, r += 2);
|
|
1563
1563
|
}
|
|
1564
|
-
function
|
|
1564
|
+
function wt(u, e, t, r) {
|
|
1565
1565
|
let c, a, n, i, s = e, o = !0;
|
|
1566
1566
|
if (u.sCount[s] - u.blkIndent >= 4 || u.listIndent >= 0 && u.sCount[s] - u.listIndent >= 4 && u.sCount[s] < u.blkIndent)
|
|
1567
1567
|
return !1;
|
|
1568
|
-
let
|
|
1569
|
-
r && u.parentType === "paragraph" && u.sCount[s] >= u.blkIndent && (
|
|
1570
|
-
let
|
|
1568
|
+
let l = !1;
|
|
1569
|
+
r && u.parentType === "paragraph" && u.sCount[s] >= u.blkIndent && (l = !0);
|
|
1570
|
+
let d, h, b;
|
|
1571
1571
|
if ((b = d0(u, s)) >= 0) {
|
|
1572
|
-
if (
|
|
1572
|
+
if (d = !0, n = u.bMarks[s] + u.tShift[s], h = Number(u.src.slice(n, b - 1)), l && h !== 1) return !1;
|
|
1573
1573
|
} else if ((b = o0(u, s)) >= 0)
|
|
1574
|
-
|
|
1574
|
+
d = !1;
|
|
1575
1575
|
else
|
|
1576
1576
|
return !1;
|
|
1577
|
-
if (
|
|
1577
|
+
if (l && u.skipSpaces(b) >= u.eMarks[s])
|
|
1578
1578
|
return !1;
|
|
1579
1579
|
if (r)
|
|
1580
1580
|
return !0;
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1583
|
-
const
|
|
1584
|
-
i.map =
|
|
1585
|
-
let
|
|
1586
|
-
const
|
|
1581
|
+
const f = u.src.charCodeAt(b - 1), x = u.tokens.length;
|
|
1582
|
+
d ? (i = u.push("ordered_list_open", "ol", 1), h !== 1 && (i.attrs = [["start", h]])) : i = u.push("bullet_list_open", "ul", 1);
|
|
1583
|
+
const g = [s, 0];
|
|
1584
|
+
i.map = g, i.markup = String.fromCharCode(f);
|
|
1585
|
+
let D = !1;
|
|
1586
|
+
const m = u.md.block.ruler.getRules("list"), E = u.parentType;
|
|
1587
1587
|
for (u.parentType = "list"; s < t; ) {
|
|
1588
1588
|
a = b, c = u.eMarks[s];
|
|
1589
|
-
const
|
|
1590
|
-
let
|
|
1589
|
+
const _ = u.sCount[s] + b - (u.bMarks[s] + u.tShift[s]);
|
|
1590
|
+
let A = _;
|
|
1591
1591
|
for (; a < c; ) {
|
|
1592
1592
|
const Y = u.src.charCodeAt(a);
|
|
1593
1593
|
if (Y === 9)
|
|
1594
|
-
|
|
1594
|
+
A += 4 - (A + u.bsCount[s]) % 4;
|
|
1595
1595
|
else if (Y === 32)
|
|
1596
|
-
|
|
1596
|
+
A++;
|
|
1597
1597
|
else
|
|
1598
1598
|
break;
|
|
1599
1599
|
a++;
|
|
1600
1600
|
}
|
|
1601
|
-
const
|
|
1601
|
+
const y = a;
|
|
1602
1602
|
let N;
|
|
1603
|
-
|
|
1604
|
-
const M =
|
|
1605
|
-
i = u.push("list_item_open", "li", 1), i.markup = String.fromCharCode(
|
|
1603
|
+
y >= c ? N = 1 : N = A - _, N > 4 && (N = 1);
|
|
1604
|
+
const M = _ + N;
|
|
1605
|
+
i = u.push("list_item_open", "li", 1), i.markup = String.fromCharCode(f);
|
|
1606
1606
|
const Z = [s, 0];
|
|
1607
|
-
i.map = Z,
|
|
1607
|
+
i.map = Z, d && (i.info = u.src.slice(n, b - 1));
|
|
1608
1608
|
const au = u.tight, Du = u.tShift[s], te = u.sCount[s], re = u.listIndent;
|
|
1609
|
-
if (u.listIndent = u.blkIndent, u.blkIndent = M, u.tight = !0, u.tShift[s] =
|
|
1609
|
+
if (u.listIndent = u.blkIndent, u.blkIndent = M, u.tight = !0, u.tShift[s] = y - u.bMarks[s], u.sCount[s] = A, y >= c && u.isEmpty(s + 1) ? u.line = Math.min(u.line + 2, t) : u.md.block.tokenize(u, s, t, !0), (!u.tight || D) && (o = !1), D = u.line - s > 1 && u.isEmpty(u.line - 1), u.blkIndent = u.listIndent, u.listIndent = re, u.tShift[s] = Du, u.sCount[s] = te, u.tight = au, i = u.push("list_item_close", "li", -1), i.markup = String.fromCharCode(f), s = u.line, Z[1] = s, s >= t || u.sCount[s] < u.blkIndent || u.sCount[s] - u.blkIndent >= 4)
|
|
1610
1610
|
break;
|
|
1611
1611
|
let Ju = !1;
|
|
1612
|
-
for (let Y = 0, ce =
|
|
1613
|
-
if (
|
|
1612
|
+
for (let Y = 0, ce = m.length; Y < ce; Y++)
|
|
1613
|
+
if (m[Y](u, s, t, !0)) {
|
|
1614
1614
|
Ju = !0;
|
|
1615
1615
|
break;
|
|
1616
1616
|
}
|
|
1617
1617
|
if (Ju)
|
|
1618
1618
|
break;
|
|
1619
|
-
if (
|
|
1619
|
+
if (d) {
|
|
1620
1620
|
if (b = d0(u, s), b < 0)
|
|
1621
1621
|
break;
|
|
1622
1622
|
n = u.bMarks[s] + u.tShift[s];
|
|
1623
1623
|
} else if (b = o0(u, s), b < 0)
|
|
1624
1624
|
break;
|
|
1625
|
-
if (
|
|
1625
|
+
if (f !== u.src.charCodeAt(b - 1))
|
|
1626
1626
|
break;
|
|
1627
1627
|
}
|
|
1628
|
-
return
|
|
1628
|
+
return d ? i = u.push("ordered_list_close", "ol", -1) : i = u.push("bullet_list_close", "ul", -1), i.markup = String.fromCharCode(f), g[1] = s, u.line = s, u.parentType = E, o && Ft(u, x), !0;
|
|
1629
1629
|
}
|
|
1630
1630
|
function St(u, e, t, r) {
|
|
1631
1631
|
let c = u.bMarks[e] + u.tShift[e], a = u.eMarks[e], n = e + 1;
|
|
1632
1632
|
if (u.sCount[e] - u.blkIndent >= 4 || u.src.charCodeAt(c) !== 91)
|
|
1633
1633
|
return !1;
|
|
1634
|
-
function i(
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1634
|
+
function i(m) {
|
|
1635
|
+
const E = u.lineMax;
|
|
1636
|
+
if (m >= E || u.isEmpty(m))
|
|
1637
1637
|
return null;
|
|
1638
|
-
let
|
|
1639
|
-
if (u.sCount[
|
|
1638
|
+
let _ = !1;
|
|
1639
|
+
if (u.sCount[m] - u.blkIndent > 3 && (_ = !0), u.sCount[m] < 0 && (_ = !0), !_) {
|
|
1640
1640
|
const N = u.md.block.ruler.getRules("reference"), M = u.parentType;
|
|
1641
1641
|
u.parentType = "reference";
|
|
1642
1642
|
let Z = !1;
|
|
1643
1643
|
for (let au = 0, Du = N.length; au < Du; au++)
|
|
1644
|
-
if (N[au](u,
|
|
1644
|
+
if (N[au](u, m, E, !0)) {
|
|
1645
1645
|
Z = !0;
|
|
1646
1646
|
break;
|
|
1647
1647
|
}
|
|
1648
1648
|
if (u.parentType = M, Z)
|
|
1649
1649
|
return null;
|
|
1650
1650
|
}
|
|
1651
|
-
const
|
|
1652
|
-
return u.src.slice(
|
|
1651
|
+
const A = u.bMarks[m] + u.tShift[m], y = u.eMarks[m];
|
|
1652
|
+
return u.src.slice(A, y + 1);
|
|
1653
1653
|
}
|
|
1654
1654
|
let s = u.src.slice(c, a + 1);
|
|
1655
1655
|
a = s.length;
|
|
1656
1656
|
let o = -1;
|
|
1657
1657
|
for (c = 1; c < a; c++) {
|
|
1658
|
-
const
|
|
1659
|
-
if (
|
|
1658
|
+
const m = s.charCodeAt(c);
|
|
1659
|
+
if (m === 91)
|
|
1660
1660
|
return !1;
|
|
1661
|
-
if (
|
|
1661
|
+
if (m === 93) {
|
|
1662
1662
|
o = c;
|
|
1663
1663
|
break;
|
|
1664
|
-
} else if (
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1667
|
-
} else if (
|
|
1668
|
-
const
|
|
1669
|
-
|
|
1664
|
+
} else if (m === 10) {
|
|
1665
|
+
const E = i(n);
|
|
1666
|
+
E !== null && (s += E, a = s.length, n++);
|
|
1667
|
+
} else if (m === 92 && (c++, c < a && s.charCodeAt(c) === 10)) {
|
|
1668
|
+
const E = i(n);
|
|
1669
|
+
E !== null && (s += E, a = s.length, n++);
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
if (o < 0 || s.charCodeAt(o + 1) !== 58)
|
|
1673
1673
|
return !1;
|
|
1674
1674
|
for (c = o + 2; c < a; c++) {
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1679
|
-
} else if (!
|
|
1680
|
-
}
|
|
1681
|
-
const
|
|
1682
|
-
if (!
|
|
1675
|
+
const m = s.charCodeAt(c);
|
|
1676
|
+
if (m === 10) {
|
|
1677
|
+
const E = i(n);
|
|
1678
|
+
E !== null && (s += E, a = s.length, n++);
|
|
1679
|
+
} else if (!w(m)) break;
|
|
1680
|
+
}
|
|
1681
|
+
const l = u.md.helpers.parseLinkDestination(s, c, a);
|
|
1682
|
+
if (!l.ok)
|
|
1683
1683
|
return !1;
|
|
1684
|
-
const
|
|
1685
|
-
if (!u.md.validateLink(
|
|
1684
|
+
const d = u.md.normalizeLink(l.str);
|
|
1685
|
+
if (!u.md.validateLink(d))
|
|
1686
1686
|
return !1;
|
|
1687
|
-
c =
|
|
1688
|
-
const h = c, b = n,
|
|
1687
|
+
c = l.pos;
|
|
1688
|
+
const h = c, b = n, f = c;
|
|
1689
1689
|
for (; c < a; c++) {
|
|
1690
|
-
const
|
|
1691
|
-
if (
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1694
|
-
} else if (!
|
|
1690
|
+
const m = s.charCodeAt(c);
|
|
1691
|
+
if (m === 10) {
|
|
1692
|
+
const E = i(n);
|
|
1693
|
+
E !== null && (s += E, a = s.length, n++);
|
|
1694
|
+
} else if (!w(m)) break;
|
|
1695
1695
|
}
|
|
1696
1696
|
let x = u.md.helpers.parseLinkTitle(s, c, a);
|
|
1697
1697
|
for (; x.can_continue; ) {
|
|
1698
|
-
const
|
|
1699
|
-
if (
|
|
1700
|
-
s +=
|
|
1701
|
-
}
|
|
1702
|
-
let
|
|
1703
|
-
for (c < a &&
|
|
1704
|
-
const
|
|
1705
|
-
if (!
|
|
1698
|
+
const m = i(n);
|
|
1699
|
+
if (m === null) break;
|
|
1700
|
+
s += m, c = a, a = s.length, n++, x = u.md.helpers.parseLinkTitle(s, c, a, x);
|
|
1701
|
+
}
|
|
1702
|
+
let g;
|
|
1703
|
+
for (c < a && f !== c && x.ok ? (g = x.str, c = x.pos) : (g = "", c = h, n = b); c < a; ) {
|
|
1704
|
+
const m = s.charCodeAt(c);
|
|
1705
|
+
if (!w(m))
|
|
1706
1706
|
break;
|
|
1707
1707
|
c++;
|
|
1708
1708
|
}
|
|
1709
|
-
if (c < a && s.charCodeAt(c) !== 10 &&
|
|
1710
|
-
for (
|
|
1711
|
-
const
|
|
1712
|
-
if (!
|
|
1709
|
+
if (c < a && s.charCodeAt(c) !== 10 && g)
|
|
1710
|
+
for (g = "", c = h, n = b; c < a; ) {
|
|
1711
|
+
const m = s.charCodeAt(c);
|
|
1712
|
+
if (!w(m))
|
|
1713
1713
|
break;
|
|
1714
1714
|
c++;
|
|
1715
1715
|
}
|
|
1716
1716
|
if (c < a && s.charCodeAt(c) !== 10)
|
|
1717
1717
|
return !1;
|
|
1718
|
-
const
|
|
1719
|
-
return
|
|
1718
|
+
const D = Eu(s.slice(1, o));
|
|
1719
|
+
return D ? (r || (typeof u.env.references > "u" && (u.env.references = {}), typeof u.env.references[D] > "u" && (u.env.references[D] = { title: g, href: d }), u.line = n), !0) : !1;
|
|
1720
1720
|
}
|
|
1721
1721
|
const vt = [
|
|
1722
1722
|
"address",
|
|
@@ -1823,19 +1823,19 @@ function $t(u, e, t, r) {
|
|
|
1823
1823
|
let i = 1;
|
|
1824
1824
|
for (n = u.src.charCodeAt(++c); n === 35 && c < a && i <= 6; )
|
|
1825
1825
|
i++, n = u.src.charCodeAt(++c);
|
|
1826
|
-
if (i > 6 || c < a && !
|
|
1826
|
+
if (i > 6 || c < a && !w(n))
|
|
1827
1827
|
return !1;
|
|
1828
1828
|
if (r)
|
|
1829
1829
|
return !0;
|
|
1830
1830
|
a = u.skipSpacesBack(a, c);
|
|
1831
1831
|
const s = u.skipCharsBack(a, 35, c);
|
|
1832
|
-
s > c &&
|
|
1832
|
+
s > c && w(u.src.charCodeAt(s - 1)) && (a = s), u.line = e + 1;
|
|
1833
1833
|
const o = u.push("heading_open", "h" + String(i), 1);
|
|
1834
1834
|
o.markup = "########".slice(0, i), o.map = [e, u.line];
|
|
1835
|
-
const
|
|
1836
|
-
|
|
1837
|
-
const
|
|
1838
|
-
return
|
|
1835
|
+
const l = u.push("inline", "", 0);
|
|
1836
|
+
l.content = u.src.slice(c, a).trim(), l.map = [e, u.line], l.children = [];
|
|
1837
|
+
const d = u.push("heading_close", "h" + String(i), -1);
|
|
1838
|
+
return d.markup = "########".slice(0, i), !0;
|
|
1839
1839
|
}
|
|
1840
1840
|
function Ht(u, e, t) {
|
|
1841
1841
|
const r = u.md.block.ruler.getRules("paragraph");
|
|
@@ -1849,8 +1849,8 @@ function Ht(u, e, t) {
|
|
|
1849
1849
|
continue;
|
|
1850
1850
|
if (u.sCount[i] >= u.blkIndent) {
|
|
1851
1851
|
let b = u.bMarks[i] + u.tShift[i];
|
|
1852
|
-
const
|
|
1853
|
-
if (b <
|
|
1852
|
+
const f = u.eMarks[i];
|
|
1853
|
+
if (b < f && (n = u.src.charCodeAt(b), (n === 45 || n === 61) && (b = u.skipChars(b, n), b = u.skipSpaces(b), b >= f))) {
|
|
1854
1854
|
a = n === 61 ? 1 : 2;
|
|
1855
1855
|
break;
|
|
1856
1856
|
}
|
|
@@ -1858,7 +1858,7 @@ function Ht(u, e, t) {
|
|
|
1858
1858
|
if (u.sCount[i] < 0)
|
|
1859
1859
|
continue;
|
|
1860
1860
|
let h = !1;
|
|
1861
|
-
for (let b = 0,
|
|
1861
|
+
for (let b = 0, f = r.length; b < f; b++)
|
|
1862
1862
|
if (r[b](u, i, t, !0)) {
|
|
1863
1863
|
h = !0;
|
|
1864
1864
|
break;
|
|
@@ -1872,10 +1872,10 @@ function Ht(u, e, t) {
|
|
|
1872
1872
|
u.line = i + 1;
|
|
1873
1873
|
const o = u.push("heading_open", "h" + String(a), 1);
|
|
1874
1874
|
o.markup = String.fromCharCode(n), o.map = [e, u.line];
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1877
|
-
const
|
|
1878
|
-
return
|
|
1875
|
+
const l = u.push("inline", "", 0);
|
|
1876
|
+
l.content = s, l.map = [e, u.line - 1], l.children = [];
|
|
1877
|
+
const d = u.push("heading_close", "h" + String(a), -1);
|
|
1878
|
+
return d.markup = String.fromCharCode(n), u.parentType = c, !0;
|
|
1879
1879
|
}
|
|
1880
1880
|
function jt(u, e, t) {
|
|
1881
1881
|
const r = u.md.block.ruler.getRules("paragraph"), c = u.parentType;
|
|
@@ -1884,8 +1884,8 @@ function jt(u, e, t) {
|
|
|
1884
1884
|
if (u.sCount[a] - u.blkIndent > 3 || u.sCount[a] < 0)
|
|
1885
1885
|
continue;
|
|
1886
1886
|
let o = !1;
|
|
1887
|
-
for (let
|
|
1888
|
-
if (r[
|
|
1887
|
+
for (let l = 0, d = r.length; l < d; l++)
|
|
1888
|
+
if (r[l](u, a, t, !0)) {
|
|
1889
1889
|
o = !0;
|
|
1890
1890
|
break;
|
|
1891
1891
|
}
|
|
@@ -1907,7 +1907,7 @@ const pu = [
|
|
|
1907
1907
|
["fence", yt, ["paragraph", "reference", "blockquote", "list"]],
|
|
1908
1908
|
["blockquote", Dt, ["paragraph", "reference", "blockquote", "list"]],
|
|
1909
1909
|
["hr", Ct, ["paragraph", "reference", "blockquote", "list"]],
|
|
1910
|
-
["list",
|
|
1910
|
+
["list", wt, ["paragraph", "reference", "blockquote"]],
|
|
1911
1911
|
["reference", St],
|
|
1912
1912
|
["html_block", Vt, ["paragraph", "reference", "blockquote"]],
|
|
1913
1913
|
["heading", $t, ["paragraph", "reference", "blockquote"]],
|
|
@@ -1929,8 +1929,8 @@ Au.prototype.tokenize = function(u, e, t) {
|
|
|
1929
1929
|
}
|
|
1930
1930
|
const s = u.line;
|
|
1931
1931
|
let o = !1;
|
|
1932
|
-
for (let
|
|
1933
|
-
if (o = r[
|
|
1932
|
+
for (let l = 0; l < c; l++)
|
|
1933
|
+
if (o = r[l](u, n, t, !1), o) {
|
|
1934
1934
|
if (s >= u.line)
|
|
1935
1935
|
throw new Error("block rule didn't increment state.line");
|
|
1936
1936
|
break;
|
|
@@ -1964,7 +1964,7 @@ fu.prototype.scanDelims = function(u, e) {
|
|
|
1964
1964
|
let a = u;
|
|
1965
1965
|
for (; a < t && this.src.charCodeAt(a) === r; )
|
|
1966
1966
|
a++;
|
|
1967
|
-
const n = a - u, i = a < t ? this.src.charCodeAt(a) : 32, s = su(c) || iu(String.fromCharCode(c)), o = su(i) || iu(String.fromCharCode(i)),
|
|
1967
|
+
const n = a - u, i = a < t ? this.src.charCodeAt(a) : 32, s = su(c) || iu(String.fromCharCode(c)), o = su(i) || iu(String.fromCharCode(i)), l = nu(c), d = nu(i), h = !d && (!o || l || s), b = !l && (!s || d || o);
|
|
1968
1968
|
return { can_open: h && (e || !b || s), can_close: b && (e || !h || o), length: n };
|
|
1969
1969
|
};
|
|
1970
1970
|
fu.prototype.Token = z;
|
|
@@ -2022,10 +2022,10 @@ function Qt(u, e) {
|
|
|
2022
2022
|
u.pending = u.pending.slice(0, -a.length);
|
|
2023
2023
|
const o = u.push("link_open", "a", 1);
|
|
2024
2024
|
o.attrs = [["href", s]], o.markup = "linkify", o.info = "auto";
|
|
2025
|
-
const
|
|
2026
|
-
|
|
2027
|
-
const
|
|
2028
|
-
|
|
2025
|
+
const l = u.push("text", "", 0);
|
|
2026
|
+
l.content = u.md.normalizeLinkText(i);
|
|
2027
|
+
const d = u.push("link_close", "a", -1);
|
|
2028
|
+
d.markup = "linkify", d.info = "auto";
|
|
2029
2029
|
}
|
|
2030
2030
|
return u.pos += i.length - a.length, !0;
|
|
2031
2031
|
}
|
|
@@ -2044,7 +2044,7 @@ function Jt(u, e) {
|
|
|
2044
2044
|
u.pending = u.pending.slice(0, -1), u.push("softbreak", "br", 0);
|
|
2045
2045
|
else
|
|
2046
2046
|
u.push("softbreak", "br", 0);
|
|
2047
|
-
for (t++; t < c &&
|
|
2047
|
+
for (t++; t < c && w(u.src.charCodeAt(t)); )
|
|
2048
2048
|
t++;
|
|
2049
2049
|
return u.pos = t, !0;
|
|
2050
2050
|
}
|
|
@@ -2060,7 +2060,7 @@ function Xt(u, e) {
|
|
|
2060
2060
|
if (u.src.charCodeAt(t) !== 92 || (t++, t >= r)) return !1;
|
|
2061
2061
|
let c = u.src.charCodeAt(t);
|
|
2062
2062
|
if (c === 10) {
|
|
2063
|
-
for (e || u.push("hardbreak", "br", 0), t++; t < r && (c = u.src.charCodeAt(t), !!
|
|
2063
|
+
for (e || u.push("hardbreak", "br", 0), t++; t < r && (c = u.src.charCodeAt(t), !!w(c)); )
|
|
2064
2064
|
t++;
|
|
2065
2065
|
return u.pos = t, !0;
|
|
2066
2066
|
}
|
|
@@ -2092,15 +2092,15 @@ function Yt(u, e) {
|
|
|
2092
2092
|
for (; (o = u.src.indexOf("`", s)) !== -1; ) {
|
|
2093
2093
|
for (s = o + 1; s < a && u.src.charCodeAt(s) === 96; )
|
|
2094
2094
|
s++;
|
|
2095
|
-
const
|
|
2096
|
-
if (
|
|
2095
|
+
const l = s - o;
|
|
2096
|
+
if (l === i) {
|
|
2097
2097
|
if (!e) {
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2098
|
+
const d = u.push("code_inline", "code", 0);
|
|
2099
|
+
d.markup = n, d.content = u.src.slice(t, o).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
|
|
2100
2100
|
}
|
|
2101
2101
|
return u.pos = s, !0;
|
|
2102
2102
|
}
|
|
2103
|
-
u.backticks[
|
|
2103
|
+
u.backticks[l] = o;
|
|
2104
2104
|
}
|
|
2105
2105
|
return u.backticksScanned = !0, e || (u.pending += n), u.pos += i, !0;
|
|
2106
2106
|
}
|
|
@@ -2213,70 +2213,70 @@ function r1(u, e) {
|
|
|
2213
2213
|
let t, r, c, a, n = "", i = "", s = u.pos, o = !0;
|
|
2214
2214
|
if (u.src.charCodeAt(u.pos) !== 91)
|
|
2215
2215
|
return !1;
|
|
2216
|
-
const
|
|
2216
|
+
const l = u.pos, d = u.posMax, h = u.pos + 1, b = u.md.helpers.parseLinkLabel(u, u.pos, !0);
|
|
2217
2217
|
if (b < 0)
|
|
2218
2218
|
return !1;
|
|
2219
|
-
let
|
|
2220
|
-
if (
|
|
2221
|
-
for (o = !1,
|
|
2219
|
+
let f = b + 1;
|
|
2220
|
+
if (f < d && u.src.charCodeAt(f) === 40) {
|
|
2221
|
+
for (o = !1, f++; f < d && (t = u.src.charCodeAt(f), !(!w(t) && t !== 10)); f++)
|
|
2222
2222
|
;
|
|
2223
|
-
if (
|
|
2223
|
+
if (f >= d)
|
|
2224
2224
|
return !1;
|
|
2225
|
-
if (s =
|
|
2226
|
-
for (n = u.md.normalizeLink(c.str), u.md.validateLink(n) ?
|
|
2225
|
+
if (s = f, c = u.md.helpers.parseLinkDestination(u.src, f, u.posMax), c.ok) {
|
|
2226
|
+
for (n = u.md.normalizeLink(c.str), u.md.validateLink(n) ? f = c.pos : n = "", s = f; f < d && (t = u.src.charCodeAt(f), !(!w(t) && t !== 10)); f++)
|
|
2227
2227
|
;
|
|
2228
|
-
if (c = u.md.helpers.parseLinkTitle(u.src,
|
|
2229
|
-
for (i = c.str,
|
|
2228
|
+
if (c = u.md.helpers.parseLinkTitle(u.src, f, u.posMax), f < d && s !== f && c.ok)
|
|
2229
|
+
for (i = c.str, f = c.pos; f < d && (t = u.src.charCodeAt(f), !(!w(t) && t !== 10)); f++)
|
|
2230
2230
|
;
|
|
2231
2231
|
}
|
|
2232
|
-
(
|
|
2232
|
+
(f >= d || u.src.charCodeAt(f) !== 41) && (o = !0), f++;
|
|
2233
2233
|
}
|
|
2234
2234
|
if (o) {
|
|
2235
2235
|
if (typeof u.env.references > "u")
|
|
2236
2236
|
return !1;
|
|
2237
|
-
if (
|
|
2238
|
-
return u.pos =
|
|
2237
|
+
if (f < d && u.src.charCodeAt(f) === 91 ? (s = f + 1, f = u.md.helpers.parseLinkLabel(u, f), f >= 0 ? r = u.src.slice(s, f++) : f = b + 1) : f = b + 1, r || (r = u.src.slice(h, b)), a = u.env.references[Eu(r)], !a)
|
|
2238
|
+
return u.pos = l, !1;
|
|
2239
2239
|
n = a.href, i = a.title;
|
|
2240
2240
|
}
|
|
2241
2241
|
if (!e) {
|
|
2242
2242
|
u.pos = h, u.posMax = b;
|
|
2243
|
-
const x = u.push("link_open", "a", 1),
|
|
2244
|
-
x.attrs =
|
|
2243
|
+
const x = u.push("link_open", "a", 1), g = [["href", n]];
|
|
2244
|
+
x.attrs = g, i && g.push(["title", i]), u.linkLevel++, u.md.inline.tokenize(u), u.linkLevel--, u.push("link_close", "a", -1);
|
|
2245
2245
|
}
|
|
2246
|
-
return u.pos =
|
|
2246
|
+
return u.pos = f, u.posMax = d, !0;
|
|
2247
2247
|
}
|
|
2248
2248
|
function c1(u, e) {
|
|
2249
|
-
let t, r, c, a, n, i, s, o,
|
|
2250
|
-
const
|
|
2249
|
+
let t, r, c, a, n, i, s, o, l = "";
|
|
2250
|
+
const d = u.pos, h = u.posMax;
|
|
2251
2251
|
if (u.src.charCodeAt(u.pos) !== 33 || u.src.charCodeAt(u.pos + 1) !== 91)
|
|
2252
2252
|
return !1;
|
|
2253
|
-
const b = u.pos + 2,
|
|
2254
|
-
if (
|
|
2253
|
+
const b = u.pos + 2, f = u.md.helpers.parseLinkLabel(u, u.pos + 1, !1);
|
|
2254
|
+
if (f < 0)
|
|
2255
2255
|
return !1;
|
|
2256
|
-
if (a =
|
|
2257
|
-
for (a++; a < h && (t = u.src.charCodeAt(a), !(!
|
|
2256
|
+
if (a = f + 1, a < h && u.src.charCodeAt(a) === 40) {
|
|
2257
|
+
for (a++; a < h && (t = u.src.charCodeAt(a), !(!w(t) && t !== 10)); a++)
|
|
2258
2258
|
;
|
|
2259
2259
|
if (a >= h)
|
|
2260
2260
|
return !1;
|
|
2261
|
-
for (o = a, i = u.md.helpers.parseLinkDestination(u.src, a, u.posMax), i.ok && (
|
|
2261
|
+
for (o = a, i = u.md.helpers.parseLinkDestination(u.src, a, u.posMax), i.ok && (l = u.md.normalizeLink(i.str), u.md.validateLink(l) ? a = i.pos : l = ""), o = a; a < h && (t = u.src.charCodeAt(a), !(!w(t) && t !== 10)); a++)
|
|
2262
2262
|
;
|
|
2263
2263
|
if (i = u.md.helpers.parseLinkTitle(u.src, a, u.posMax), a < h && o !== a && i.ok)
|
|
2264
|
-
for (s = i.str, a = i.pos; a < h && (t = u.src.charCodeAt(a), !(!
|
|
2264
|
+
for (s = i.str, a = i.pos; a < h && (t = u.src.charCodeAt(a), !(!w(t) && t !== 10)); a++)
|
|
2265
2265
|
;
|
|
2266
2266
|
else
|
|
2267
2267
|
s = "";
|
|
2268
2268
|
if (a >= h || u.src.charCodeAt(a) !== 41)
|
|
2269
|
-
return u.pos =
|
|
2269
|
+
return u.pos = d, !1;
|
|
2270
2270
|
a++;
|
|
2271
2271
|
} else {
|
|
2272
2272
|
if (typeof u.env.references > "u")
|
|
2273
2273
|
return !1;
|
|
2274
|
-
if (a < h && u.src.charCodeAt(a) === 91 ? (o = a + 1, a = u.md.helpers.parseLinkLabel(u, a), a >= 0 ? c = u.src.slice(o, a++) : a =
|
|
2275
|
-
return u.pos =
|
|
2276
|
-
|
|
2274
|
+
if (a < h && u.src.charCodeAt(a) === 91 ? (o = a + 1, a = u.md.helpers.parseLinkLabel(u, a), a >= 0 ? c = u.src.slice(o, a++) : a = f + 1) : a = f + 1, c || (c = u.src.slice(b, f)), n = u.env.references[Eu(c)], !n)
|
|
2275
|
+
return u.pos = d, !1;
|
|
2276
|
+
l = n.href, s = n.title;
|
|
2277
2277
|
}
|
|
2278
2278
|
if (!e) {
|
|
2279
|
-
r = u.src.slice(b,
|
|
2279
|
+
r = u.src.slice(b, f);
|
|
2280
2280
|
const x = [];
|
|
2281
2281
|
u.md.inline.parse(
|
|
2282
2282
|
r,
|
|
@@ -2284,8 +2284,8 @@ function c1(u, e) {
|
|
|
2284
2284
|
u.env,
|
|
2285
2285
|
x
|
|
2286
2286
|
);
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2287
|
+
const g = u.push("image", "img", 0), D = [["src", l], ["alt", ""]];
|
|
2288
|
+
g.attrs = D, g.children = x, g.content = r, s && D.push(["title", s]);
|
|
2289
2289
|
}
|
|
2290
2290
|
return u.pos = a, u.posMax = h, !0;
|
|
2291
2291
|
}
|
|
@@ -2398,19 +2398,19 @@ function b0(u) {
|
|
|
2398
2398
|
if (a.push(0), (u[r].marker !== i.marker || c !== i.token - 1) && (r = n), c = i.token, i.length = i.length || 0, !i.close) continue;
|
|
2399
2399
|
e.hasOwnProperty(i.marker) || (e[i.marker] = [-1, -1, -1, -1, -1, -1]);
|
|
2400
2400
|
const s = e[i.marker][(i.open ? 3 : 0) + i.length % 3];
|
|
2401
|
-
let o = r - a[r] - 1,
|
|
2401
|
+
let o = r - a[r] - 1, l = o;
|
|
2402
2402
|
for (; o > s; o -= a[o] + 1) {
|
|
2403
|
-
const
|
|
2404
|
-
if (
|
|
2403
|
+
const d = u[o];
|
|
2404
|
+
if (d.marker === i.marker && d.open && d.end < 0) {
|
|
2405
2405
|
let h = !1;
|
|
2406
|
-
if ((
|
|
2406
|
+
if ((d.close || i.open) && (d.length + i.length) % 3 === 0 && (d.length % 3 !== 0 || i.length % 3 !== 0) && (h = !0), !h) {
|
|
2407
2407
|
const b = o > 0 && !u[o - 1].open ? a[o - 1] + 1 : 0;
|
|
2408
|
-
a[n] = n - o + b, a[o] = b, i.open = !1,
|
|
2408
|
+
a[n] = n - o + b, a[o] = b, i.open = !1, d.end = n, d.close = !1, l = -1, c = -2;
|
|
2409
2409
|
break;
|
|
2410
2410
|
}
|
|
2411
2411
|
}
|
|
2412
2412
|
}
|
|
2413
|
-
|
|
2413
|
+
l !== -1 && (e[i.marker][(i.open ? 3 : 0) + (i.length || 0) % 3] = l);
|
|
2414
2414
|
}
|
|
2415
2415
|
}
|
|
2416
2416
|
function p1(u) {
|
|
@@ -2505,7 +2505,7 @@ lu.prototype.parse = function(u, e, t, r) {
|
|
|
2505
2505
|
lu.prototype.State = fu;
|
|
2506
2506
|
function m1(u) {
|
|
2507
2507
|
const e = {};
|
|
2508
|
-
u = u || {}, e.src_Any = C0.source, e.src_Cc =
|
|
2508
|
+
u = u || {}, e.src_Any = C0.source, e.src_Cc = F0.source, e.src_Z = S0.source, e.src_P = Vu.source, e.src_ZPCc = [e.src_Z, e.src_P, e.src_Cc].join("|"), e.src_ZCc = [e.src_Z, e.src_Cc].join("|");
|
|
2509
2509
|
const t = "[><|]";
|
|
2510
2510
|
return e.src_pseudo_letter = "(?:(?!" + t + "|" + e.src_ZPCc + ")" + e.src_Any + ")", e.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", e.src_auth = "(?:(?:(?!" + e.src_ZCc + "|[@/\\[\\]()]).)+@)?", e.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?", e.src_host_terminator = "(?=$|" + t + "|" + e.src_ZPCc + ")(?!" + (u["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + e.src_ZPCc + "))", e.src_path = "(?:[/?#](?:(?!" + e.src_ZCc + "|" + t + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + e.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + e.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + e.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + e.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + e.src_ZCc + "|[']).)+\\'|\\'(?=" + e.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + e.src_ZCc + "|[.]|$)|" + (u["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + // allow `,,,` in paths
|
|
2511
2511
|
",(?!" + e.src_ZCc + "|$)|;(?!" + e.src_ZCc + "|$)|\\!+(?!" + e.src_ZCc + "|[!]|$)|\\?(?!" + e.src_ZCc + "|[?]|$))+|\\/)?", e.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*', e.src_xn = "xn--[a-z0-9\\-]{1,59}", e.src_domain_root = // Allow letters & digits (http://test1)
|
|
@@ -2583,10 +2583,10 @@ const y1 = {
|
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
2585
|
}, D1 = "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]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]", C1 = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
|
|
2586
|
-
function
|
|
2586
|
+
function F1(u) {
|
|
2587
2587
|
u.__index__ = -1, u.__text_cache__ = "";
|
|
2588
2588
|
}
|
|
2589
|
-
function
|
|
2589
|
+
function w1(u) {
|
|
2590
2590
|
return function(e, t) {
|
|
2591
2591
|
const r = e.slice(t);
|
|
2592
2592
|
return u.test(r) ? r.match(u)[0].length : 0;
|
|
@@ -2615,7 +2615,7 @@ function _u(u) {
|
|
|
2615
2615
|
return;
|
|
2616
2616
|
const o = { validate: null, link: null };
|
|
2617
2617
|
if (u.__compiled__[i] = o, _1(s)) {
|
|
2618
|
-
k1(s.validate) ? o.validate =
|
|
2618
|
+
k1(s.validate) ? o.validate = w1(s.validate) : h0(s.validate) ? o.validate = s.validate : a(i, s), h0(s.normalize) ? o.normalize = s.normalize : s.normalize ? a(i, s) : o.normalize = p0();
|
|
2619
2619
|
return;
|
|
2620
2620
|
}
|
|
2621
2621
|
if (g1(s)) {
|
|
@@ -2632,7 +2632,7 @@ function _u(u) {
|
|
|
2632
2632
|
u.re.schema_test = RegExp("(^|(?!_)(?:[><|]|" + e.src_ZPCc + "))(" + n + ")", "i"), u.re.schema_search = RegExp("(^|(?!_)(?:[><|]|" + e.src_ZPCc + "))(" + n + ")", "ig"), u.re.schema_at_start = RegExp("^" + u.re.schema_search.source, "i"), u.re.pretest = RegExp(
|
|
2633
2633
|
"(" + u.re.schema_test.source + ")|(" + u.re.host_fuzzy_test.source + ")|@",
|
|
2634
2634
|
"i"
|
|
2635
|
-
),
|
|
2635
|
+
), F1(u);
|
|
2636
2636
|
}
|
|
2637
2637
|
function S1(u, e) {
|
|
2638
2638
|
const t = u.__index__, r = u.__last_index__, c = u.__text_cache__.slice(t, r);
|
|
@@ -2656,7 +2656,7 @@ L.prototype.set = function(e) {
|
|
|
2656
2656
|
L.prototype.test = function(e) {
|
|
2657
2657
|
if (this.__text_cache__ = e, this.__index__ = -1, !e.length)
|
|
2658
2658
|
return !1;
|
|
2659
|
-
let t, r, c, a, n, i, s, o,
|
|
2659
|
+
let t, r, c, a, n, i, s, o, l;
|
|
2660
2660
|
if (this.re.schema_test.test(e)) {
|
|
2661
2661
|
for (s = this.re.schema_search, s.lastIndex = 0; (t = s.exec(e)) !== null; )
|
|
2662
2662
|
if (a = this.testSchemaAt(e, t[2], s.lastIndex), a) {
|
|
@@ -2664,7 +2664,7 @@ L.prototype.test = function(e) {
|
|
|
2664
2664
|
break;
|
|
2665
2665
|
}
|
|
2666
2666
|
}
|
|
2667
|
-
return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (o = e.search(this.re.host_fuzzy_test), o >= 0 && (this.__index__ < 0 || o < this.__index__) && (r = e.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null && (n = r.index + r[1].length, (this.__index__ < 0 || n < this.__index__) && (this.__schema__ = "", this.__index__ = n, this.__last_index__ = r.index + r[0].length))), this.__opts__.fuzzyEmail && this.__compiled__["mailto:"] && (
|
|
2667
|
+
return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (o = e.search(this.re.host_fuzzy_test), o >= 0 && (this.__index__ < 0 || o < this.__index__) && (r = e.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null && (n = r.index + r[1].length, (this.__index__ < 0 || n < this.__index__) && (this.__schema__ = "", this.__index__ = n, this.__last_index__ = r.index + r[0].length))), this.__opts__.fuzzyEmail && this.__compiled__["mailto:"] && (l = e.indexOf("@"), l >= 0 && (c = e.match(this.re.email_fuzzy)) !== null && (n = c.index + c[1].length, i = c.index + c[0].length, (this.__index__ < 0 || n < this.__index__ || n === this.__index__ && i > this.__last_index__) && (this.__schema__ = "mailto:", this.__index__ = n, this.__last_index__ = i))), this.__index__ >= 0;
|
|
2668
2668
|
};
|
|
2669
2669
|
L.prototype.pretest = function(e) {
|
|
2670
2670
|
return this.re.pretest.test(e);
|
|
@@ -2751,15 +2751,15 @@ const R1 = (u) => String.fromCodePoint(...u), M1 = function(u) {
|
|
|
2751
2751
|
u.charCodeAt(i) >= 128 && G("not-basic"), e.push(u.charCodeAt(i));
|
|
2752
2752
|
for (let i = n > 0 ? n + 1 : 0; i < t; ) {
|
|
2753
2753
|
const s = r;
|
|
2754
|
-
for (let
|
|
2754
|
+
for (let l = 1, d = U; ; d += U) {
|
|
2755
2755
|
i >= t && G("invalid-input");
|
|
2756
2756
|
const h = M1(u.charCodeAt(i++));
|
|
2757
|
-
h >= U && G("invalid-input"), h > V((eu - r) /
|
|
2758
|
-
const b =
|
|
2757
|
+
h >= U && G("invalid-input"), h > V((eu - r) / l) && G("overflow"), r += h * l;
|
|
2758
|
+
const b = d <= a ? Gu : d >= a + ou ? ou : d - a;
|
|
2759
2759
|
if (h < b)
|
|
2760
2760
|
break;
|
|
2761
|
-
const
|
|
2762
|
-
|
|
2761
|
+
const f = U - b;
|
|
2762
|
+
l > V(eu / f) && G("overflow"), l *= f;
|
|
2763
2763
|
}
|
|
2764
2764
|
const o = e.length + 1;
|
|
2765
2765
|
a = j0(r - s, o, s == 0), V(r / o) > eu - c && G("overflow"), c += V(r / o), r %= o, e.splice(r++, 0, c);
|
|
@@ -2776,23 +2776,23 @@ const R1 = (u) => String.fromCodePoint(...u), M1 = function(u) {
|
|
|
2776
2776
|
let i = n;
|
|
2777
2777
|
for (n && e.push(V0); i < t; ) {
|
|
2778
2778
|
let s = eu;
|
|
2779
|
-
for (const
|
|
2780
|
-
|
|
2779
|
+
for (const l of u)
|
|
2780
|
+
l >= r && l < s && (s = l);
|
|
2781
2781
|
const o = i + 1;
|
|
2782
2782
|
s - r > V((eu - c) / o) && G("overflow"), c += (s - r) * o, r = s;
|
|
2783
|
-
for (const
|
|
2784
|
-
if (
|
|
2785
|
-
let
|
|
2783
|
+
for (const l of u)
|
|
2784
|
+
if (l < r && ++c > eu && G("overflow"), l === r) {
|
|
2785
|
+
let d = c;
|
|
2786
2786
|
for (let h = U; ; h += U) {
|
|
2787
2787
|
const b = h <= a ? Gu : h >= a + ou ? ou : h - a;
|
|
2788
|
-
if (
|
|
2788
|
+
if (d < b)
|
|
2789
2789
|
break;
|
|
2790
|
-
const
|
|
2790
|
+
const f = d - b, x = U - b;
|
|
2791
2791
|
e.push(
|
|
2792
|
-
Tu(x0(b +
|
|
2793
|
-
),
|
|
2792
|
+
Tu(x0(b + f % x, 0))
|
|
2793
|
+
), d = V(f / x);
|
|
2794
2794
|
}
|
|
2795
|
-
e.push(Tu(x0(
|
|
2795
|
+
e.push(Tu(x0(d, 0))), a = j0(c, o, i === n), c = 0, ++i;
|
|
2796
2796
|
}
|
|
2797
2797
|
++c, ++r;
|
|
2798
2798
|
}
|
|
@@ -3371,22 +3371,22 @@ function cr(u, e, t, r) {
|
|
|
3371
3371
|
}
|
|
3372
3372
|
return -1;
|
|
3373
3373
|
}
|
|
3374
|
-
var
|
|
3374
|
+
var k;
|
|
3375
3375
|
(function(u) {
|
|
3376
3376
|
u[u.Tab = 9] = "Tab", u[u.NewLine = 10] = "NewLine", u[u.FormFeed = 12] = "FormFeed", u[u.CarriageReturn = 13] = "CarriageReturn", u[u.Space = 32] = "Space", u[u.ExclamationMark = 33] = "ExclamationMark", u[u.Number = 35] = "Number", u[u.Amp = 38] = "Amp", u[u.SingleQuote = 39] = "SingleQuote", u[u.DoubleQuote = 34] = "DoubleQuote", u[u.Dash = 45] = "Dash", u[u.Slash = 47] = "Slash", u[u.Zero = 48] = "Zero", u[u.Nine = 57] = "Nine", u[u.Semi = 59] = "Semi", u[u.Lt = 60] = "Lt", u[u.Eq = 61] = "Eq", u[u.Gt = 62] = "Gt", u[u.Questionmark = 63] = "Questionmark", u[u.UpperA = 65] = "UpperA", u[u.LowerA = 97] = "LowerA", u[u.UpperF = 70] = "UpperF", u[u.LowerF = 102] = "LowerF", u[u.UpperZ = 90] = "UpperZ", u[u.LowerZ = 122] = "LowerZ", u[u.LowerX = 120] = "LowerX", u[u.OpeningSquareBracket = 91] = "OpeningSquareBracket";
|
|
3377
|
-
})(
|
|
3377
|
+
})(k || (k = {}));
|
|
3378
3378
|
var p;
|
|
3379
3379
|
(function(u) {
|
|
3380
3380
|
u[u.Text = 1] = "Text", u[u.BeforeTagName = 2] = "BeforeTagName", u[u.InTagName = 3] = "InTagName", u[u.InSelfClosingTag = 4] = "InSelfClosingTag", u[u.BeforeClosingTagName = 5] = "BeforeClosingTagName", u[u.InClosingTagName = 6] = "InClosingTagName", u[u.AfterClosingTagName = 7] = "AfterClosingTagName", u[u.BeforeAttributeName = 8] = "BeforeAttributeName", u[u.InAttributeName = 9] = "InAttributeName", u[u.AfterAttributeName = 10] = "AfterAttributeName", u[u.BeforeAttributeValue = 11] = "BeforeAttributeValue", u[u.InAttributeValueDq = 12] = "InAttributeValueDq", u[u.InAttributeValueSq = 13] = "InAttributeValueSq", u[u.InAttributeValueNq = 14] = "InAttributeValueNq", u[u.BeforeDeclaration = 15] = "BeforeDeclaration", u[u.InDeclaration = 16] = "InDeclaration", u[u.InProcessingInstruction = 17] = "InProcessingInstruction", u[u.BeforeComment = 18] = "BeforeComment", u[u.CDATASequence = 19] = "CDATASequence", u[u.InSpecialComment = 20] = "InSpecialComment", u[u.InCommentLike = 21] = "InCommentLike", u[u.BeforeSpecialS = 22] = "BeforeSpecialS", u[u.BeforeSpecialT = 23] = "BeforeSpecialT", u[u.SpecialStartSequence = 24] = "SpecialStartSequence", u[u.InSpecialTag = 25] = "InSpecialTag", u[u.InEntity = 26] = "InEntity";
|
|
3381
3381
|
})(p || (p = {}));
|
|
3382
3382
|
function j(u) {
|
|
3383
|
-
return u ===
|
|
3383
|
+
return u === k.Space || u === k.NewLine || u === k.Tab || u === k.FormFeed || u === k.CarriageReturn;
|
|
3384
3384
|
}
|
|
3385
3385
|
function xu(u) {
|
|
3386
|
-
return u ===
|
|
3386
|
+
return u === k.Slash || u === k.Gt || j(u);
|
|
3387
3387
|
}
|
|
3388
3388
|
function ar(u) {
|
|
3389
|
-
return u >=
|
|
3389
|
+
return u >= k.LowerA && u <= k.LowerZ || u >= k.UpperA && u <= k.UpperZ;
|
|
3390
3390
|
}
|
|
3391
3391
|
var O;
|
|
3392
3392
|
(function(u) {
|
|
@@ -3441,7 +3441,7 @@ class nr {
|
|
|
3441
3441
|
this.running = !0, this.index < this.buffer.length + this.offset && this.parse();
|
|
3442
3442
|
}
|
|
3443
3443
|
stateText(e) {
|
|
3444
|
-
e ===
|
|
3444
|
+
e === k.Lt || !this.decodeEntities && this.fastForwardTo(k.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = p.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && e === k.Amp && this.startEntity();
|
|
3445
3445
|
}
|
|
3446
3446
|
stateSpecialStartSequence(e) {
|
|
3447
3447
|
const t = this.sequenceIndex === this.currentSequence.length;
|
|
@@ -3462,7 +3462,7 @@ class nr {
|
|
|
3462
3462
|
/** Look for an end tag. For <title> tags, also decode entities. */
|
|
3463
3463
|
stateInSpecialTag(e) {
|
|
3464
3464
|
if (this.sequenceIndex === this.currentSequence.length) {
|
|
3465
|
-
if (e ===
|
|
3465
|
+
if (e === k.Gt || j(e)) {
|
|
3466
3466
|
const t = this.index - this.currentSequence.length;
|
|
3467
3467
|
if (this.sectionStart < t) {
|
|
3468
3468
|
const r = this.index;
|
|
@@ -3473,7 +3473,7 @@ class nr {
|
|
|
3473
3473
|
}
|
|
3474
3474
|
this.sequenceIndex = 0;
|
|
3475
3475
|
}
|
|
3476
|
-
(e | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === S.TitleEnd ? this.decodeEntities && e ===
|
|
3476
|
+
(e | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === S.TitleEnd ? this.decodeEntities && e === k.Amp && this.startEntity() : this.fastForwardTo(k.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(e === k.Lt);
|
|
3477
3477
|
}
|
|
3478
3478
|
stateCDATASequence(e) {
|
|
3479
3479
|
e === S.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === S.Cdata.length && (this.state = p.InCommentLike, this.currentSequence = S.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = p.InDeclaration, this.stateInDeclaration(e));
|
|
@@ -3514,68 +3514,68 @@ class nr {
|
|
|
3514
3514
|
this.isSpecial = !0, this.currentSequence = e, this.sequenceIndex = t, this.state = p.SpecialStartSequence;
|
|
3515
3515
|
}
|
|
3516
3516
|
stateBeforeTagName(e) {
|
|
3517
|
-
if (e ===
|
|
3517
|
+
if (e === k.ExclamationMark)
|
|
3518
3518
|
this.state = p.BeforeDeclaration, this.sectionStart = this.index + 1;
|
|
3519
|
-
else if (e ===
|
|
3519
|
+
else if (e === k.Questionmark)
|
|
3520
3520
|
this.state = p.InProcessingInstruction, this.sectionStart = this.index + 1;
|
|
3521
3521
|
else if (this.isTagStartChar(e)) {
|
|
3522
3522
|
const t = e | 32;
|
|
3523
3523
|
this.sectionStart = this.index, this.xmlMode ? this.state = p.InTagName : t === S.ScriptEnd[2] ? this.state = p.BeforeSpecialS : t === S.TitleEnd[2] || t === S.XmpEnd[2] ? this.state = p.BeforeSpecialT : this.state = p.InTagName;
|
|
3524
|
-
} else e ===
|
|
3524
|
+
} else e === k.Slash ? this.state = p.BeforeClosingTagName : (this.state = p.Text, this.stateText(e));
|
|
3525
3525
|
}
|
|
3526
3526
|
stateInTagName(e) {
|
|
3527
3527
|
xu(e) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = p.BeforeAttributeName, this.stateBeforeAttributeName(e));
|
|
3528
3528
|
}
|
|
3529
3529
|
stateBeforeClosingTagName(e) {
|
|
3530
|
-
j(e) || (e ===
|
|
3530
|
+
j(e) || (e === k.Gt ? this.state = p.Text : (this.state = this.isTagStartChar(e) ? p.InClosingTagName : p.InSpecialComment, this.sectionStart = this.index));
|
|
3531
3531
|
}
|
|
3532
3532
|
stateInClosingTagName(e) {
|
|
3533
|
-
(e ===
|
|
3533
|
+
(e === k.Gt || j(e)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = p.AfterClosingTagName, this.stateAfterClosingTagName(e));
|
|
3534
3534
|
}
|
|
3535
3535
|
stateAfterClosingTagName(e) {
|
|
3536
|
-
(e ===
|
|
3536
|
+
(e === k.Gt || this.fastForwardTo(k.Gt)) && (this.state = p.Text, this.sectionStart = this.index + 1);
|
|
3537
3537
|
}
|
|
3538
3538
|
stateBeforeAttributeName(e) {
|
|
3539
|
-
e ===
|
|
3539
|
+
e === k.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = p.InSpecialTag, this.sequenceIndex = 0) : this.state = p.Text, this.sectionStart = this.index + 1) : e === k.Slash ? this.state = p.InSelfClosingTag : j(e) || (this.state = p.InAttributeName, this.sectionStart = this.index);
|
|
3540
3540
|
}
|
|
3541
3541
|
stateInSelfClosingTag(e) {
|
|
3542
|
-
e ===
|
|
3542
|
+
e === k.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = p.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : j(e) || (this.state = p.BeforeAttributeName, this.stateBeforeAttributeName(e));
|
|
3543
3543
|
}
|
|
3544
3544
|
stateInAttributeName(e) {
|
|
3545
|
-
(e ===
|
|
3545
|
+
(e === k.Eq || xu(e)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = p.AfterAttributeName, this.stateAfterAttributeName(e));
|
|
3546
3546
|
}
|
|
3547
3547
|
stateAfterAttributeName(e) {
|
|
3548
|
-
e ===
|
|
3548
|
+
e === k.Eq ? this.state = p.BeforeAttributeValue : e === k.Slash || e === k.Gt ? (this.cbs.onattribend(O.NoValue, this.sectionStart), this.sectionStart = -1, this.state = p.BeforeAttributeName, this.stateBeforeAttributeName(e)) : j(e) || (this.cbs.onattribend(O.NoValue, this.sectionStart), this.state = p.InAttributeName, this.sectionStart = this.index);
|
|
3549
3549
|
}
|
|
3550
3550
|
stateBeforeAttributeValue(e) {
|
|
3551
|
-
e ===
|
|
3551
|
+
e === k.DoubleQuote ? (this.state = p.InAttributeValueDq, this.sectionStart = this.index + 1) : e === k.SingleQuote ? (this.state = p.InAttributeValueSq, this.sectionStart = this.index + 1) : j(e) || (this.sectionStart = this.index, this.state = p.InAttributeValueNq, this.stateInAttributeValueNoQuotes(e));
|
|
3552
3552
|
}
|
|
3553
3553
|
handleInAttributeValue(e, t) {
|
|
3554
|
-
e === t || !this.decodeEntities && this.fastForwardTo(t) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(t ===
|
|
3554
|
+
e === t || !this.decodeEntities && this.fastForwardTo(t) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(t === k.DoubleQuote ? O.Double : O.Single, this.index + 1), this.state = p.BeforeAttributeName) : this.decodeEntities && e === k.Amp && this.startEntity();
|
|
3555
3555
|
}
|
|
3556
3556
|
stateInAttributeValueDoubleQuotes(e) {
|
|
3557
|
-
this.handleInAttributeValue(e,
|
|
3557
|
+
this.handleInAttributeValue(e, k.DoubleQuote);
|
|
3558
3558
|
}
|
|
3559
3559
|
stateInAttributeValueSingleQuotes(e) {
|
|
3560
|
-
this.handleInAttributeValue(e,
|
|
3560
|
+
this.handleInAttributeValue(e, k.SingleQuote);
|
|
3561
3561
|
}
|
|
3562
3562
|
stateInAttributeValueNoQuotes(e) {
|
|
3563
|
-
j(e) || e ===
|
|
3563
|
+
j(e) || e === k.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(O.Unquoted, this.index), this.state = p.BeforeAttributeName, this.stateBeforeAttributeName(e)) : this.decodeEntities && e === k.Amp && this.startEntity();
|
|
3564
3564
|
}
|
|
3565
3565
|
stateBeforeDeclaration(e) {
|
|
3566
|
-
e ===
|
|
3566
|
+
e === k.OpeningSquareBracket ? (this.state = p.CDATASequence, this.sequenceIndex = 0) : this.state = e === k.Dash ? p.BeforeComment : p.InDeclaration;
|
|
3567
3567
|
}
|
|
3568
3568
|
stateInDeclaration(e) {
|
|
3569
|
-
(e ===
|
|
3569
|
+
(e === k.Gt || this.fastForwardTo(k.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = p.Text, this.sectionStart = this.index + 1);
|
|
3570
3570
|
}
|
|
3571
3571
|
stateInProcessingInstruction(e) {
|
|
3572
|
-
(e ===
|
|
3572
|
+
(e === k.Gt || this.fastForwardTo(k.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = p.Text, this.sectionStart = this.index + 1);
|
|
3573
3573
|
}
|
|
3574
3574
|
stateBeforeComment(e) {
|
|
3575
|
-
e ===
|
|
3575
|
+
e === k.Dash ? (this.state = p.InCommentLike, this.currentSequence = S.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = p.InDeclaration;
|
|
3576
3576
|
}
|
|
3577
3577
|
stateInSpecialComment(e) {
|
|
3578
|
-
(e ===
|
|
3578
|
+
(e === k.Gt || this.fastForwardTo(k.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = p.Text, this.sectionStart = this.index + 1);
|
|
3579
3579
|
}
|
|
3580
3580
|
stateBeforeSpecialS(e) {
|
|
3581
3581
|
const t = e | 32;
|
|
@@ -3753,19 +3753,19 @@ const uu = /* @__PURE__ */ new Set([
|
|
|
3753
3753
|
"button",
|
|
3754
3754
|
"datalist",
|
|
3755
3755
|
"textarea"
|
|
3756
|
-
]),
|
|
3756
|
+
]), F = /* @__PURE__ */ new Set(["p"]), g0 = /* @__PURE__ */ new Set(["thead", "tbody"]), _0 = /* @__PURE__ */ new Set(["dd", "dt"]), k0 = /* @__PURE__ */ new Set(["rt", "rp"]), ir = /* @__PURE__ */ new Map([
|
|
3757
3757
|
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
|
|
3758
3758
|
["th", /* @__PURE__ */ new Set(["th"])],
|
|
3759
3759
|
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
|
|
3760
3760
|
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
|
|
3761
3761
|
["li", /* @__PURE__ */ new Set(["li"])],
|
|
3762
|
-
["p",
|
|
3763
|
-
["h1",
|
|
3764
|
-
["h2",
|
|
3765
|
-
["h3",
|
|
3766
|
-
["h4",
|
|
3767
|
-
["h5",
|
|
3768
|
-
["h6",
|
|
3762
|
+
["p", F],
|
|
3763
|
+
["h1", F],
|
|
3764
|
+
["h2", F],
|
|
3765
|
+
["h3", F],
|
|
3766
|
+
["h4", F],
|
|
3767
|
+
["h5", F],
|
|
3768
|
+
["h6", F],
|
|
3769
3769
|
["select", uu],
|
|
3770
3770
|
["input", uu],
|
|
3771
3771
|
["output", uu],
|
|
@@ -3776,27 +3776,27 @@ const uu = /* @__PURE__ */ new Set([
|
|
|
3776
3776
|
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
|
|
3777
3777
|
["dd", _0],
|
|
3778
3778
|
["dt", _0],
|
|
3779
|
-
["address",
|
|
3780
|
-
["article",
|
|
3781
|
-
["aside",
|
|
3782
|
-
["blockquote",
|
|
3783
|
-
["details",
|
|
3784
|
-
["div",
|
|
3785
|
-
["dl",
|
|
3786
|
-
["fieldset",
|
|
3787
|
-
["figcaption",
|
|
3788
|
-
["figure",
|
|
3789
|
-
["footer",
|
|
3790
|
-
["form",
|
|
3791
|
-
["header",
|
|
3792
|
-
["hr",
|
|
3793
|
-
["main",
|
|
3794
|
-
["nav",
|
|
3795
|
-
["ol",
|
|
3796
|
-
["pre",
|
|
3797
|
-
["section",
|
|
3798
|
-
["table",
|
|
3799
|
-
["ul",
|
|
3779
|
+
["address", F],
|
|
3780
|
+
["article", F],
|
|
3781
|
+
["aside", F],
|
|
3782
|
+
["blockquote", F],
|
|
3783
|
+
["details", F],
|
|
3784
|
+
["div", F],
|
|
3785
|
+
["dl", F],
|
|
3786
|
+
["fieldset", F],
|
|
3787
|
+
["figcaption", F],
|
|
3788
|
+
["figure", F],
|
|
3789
|
+
["footer", F],
|
|
3790
|
+
["form", F],
|
|
3791
|
+
["header", F],
|
|
3792
|
+
["hr", F],
|
|
3793
|
+
["main", F],
|
|
3794
|
+
["nav", F],
|
|
3795
|
+
["ol", F],
|
|
3796
|
+
["pre", F],
|
|
3797
|
+
["section", F],
|
|
3798
|
+
["table", F],
|
|
3799
|
+
["ul", F],
|
|
3800
3800
|
["rt", k0],
|
|
3801
3801
|
["rp", k0],
|
|
3802
3802
|
["tbody", g0],
|
|
@@ -3883,19 +3883,19 @@ class dr {
|
|
|
3883
3883
|
}
|
|
3884
3884
|
/** @internal */
|
|
3885
3885
|
onclosetag(e, t) {
|
|
3886
|
-
var r, c, a, n, i, s, o,
|
|
3886
|
+
var r, c, a, n, i, s, o, l;
|
|
3887
3887
|
this.endIndex = t;
|
|
3888
|
-
let
|
|
3889
|
-
if (this.lowerCaseTagNames && (
|
|
3890
|
-
this.htmlMode &&
|
|
3888
|
+
let d = this.getSlice(e, t);
|
|
3889
|
+
if (this.lowerCaseTagNames && (d = d.toLowerCase()), this.htmlMode && (E0.has(d) || A0.has(d)) && this.foreignContext.shift(), this.isVoidElement(d))
|
|
3890
|
+
this.htmlMode && d === "br" && ((n = (a = this.cbs).onopentagname) === null || n === void 0 || n.call(a, "br"), (s = (i = this.cbs).onopentag) === null || s === void 0 || s.call(i, "br", {}, !0), (l = (o = this.cbs).onclosetag) === null || l === void 0 || l.call(o, "br", !1));
|
|
3891
3891
|
else {
|
|
3892
|
-
const h = this.stack.indexOf(
|
|
3892
|
+
const h = this.stack.indexOf(d);
|
|
3893
3893
|
if (h !== -1)
|
|
3894
3894
|
for (let b = 0; b <= h; b++) {
|
|
3895
|
-
const
|
|
3896
|
-
(c = (r = this.cbs).onclosetag) === null || c === void 0 || c.call(r,
|
|
3895
|
+
const f = this.stack.shift();
|
|
3896
|
+
(c = (r = this.cbs).onclosetag) === null || c === void 0 || c.call(r, f, b !== h);
|
|
3897
3897
|
}
|
|
3898
|
-
else this.htmlMode &&
|
|
3898
|
+
else this.htmlMode && d === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
|
|
3899
3899
|
}
|
|
3900
3900
|
this.startIndex = t + 1;
|
|
3901
3901
|
}
|
|
@@ -3959,10 +3959,10 @@ class dr {
|
|
|
3959
3959
|
}
|
|
3960
3960
|
/** @internal */
|
|
3961
3961
|
oncdata(e, t, r) {
|
|
3962
|
-
var c, a, n, i, s, o,
|
|
3962
|
+
var c, a, n, i, s, o, l, d, h, b;
|
|
3963
3963
|
this.endIndex = t;
|
|
3964
|
-
const
|
|
3965
|
-
!this.htmlMode || this.options.recognizeCDATA ? ((a = (c = this.cbs).oncdatastart) === null || a === void 0 || a.call(c), (i = (n = this.cbs).ontext) === null || i === void 0 || i.call(n,
|
|
3964
|
+
const f = this.getSlice(e, t - r);
|
|
3965
|
+
!this.htmlMode || this.options.recognizeCDATA ? ((a = (c = this.cbs).oncdatastart) === null || a === void 0 || a.call(c), (i = (n = this.cbs).ontext) === null || i === void 0 || i.call(n, f), (o = (s = this.cbs).oncdataend) === null || o === void 0 || o.call(s)) : ((d = (l = this.cbs).oncomment) === null || d === void 0 || d.call(l, `[CDATA[${f}]]`), (b = (h = this.cbs).oncommentend) === null || b === void 0 || b.call(h)), this.startIndex = t + 1;
|
|
3966
3966
|
}
|
|
3967
3967
|
/** @internal */
|
|
3968
3968
|
onend() {
|
|
@@ -4416,32 +4416,32 @@ const kr = D0({
|
|
|
4416
4416
|
setup(u) {
|
|
4417
4417
|
const e = u;
|
|
4418
4418
|
function t() {
|
|
4419
|
-
const
|
|
4419
|
+
const d = {
|
|
4420
4420
|
html: !0,
|
|
4421
4421
|
linkify: !0,
|
|
4422
4422
|
typographer: !0
|
|
4423
|
-
},
|
|
4424
|
-
...
|
|
4423
|
+
}, h = new R({
|
|
4424
|
+
...d,
|
|
4425
4425
|
...e.markdownItOptions
|
|
4426
4426
|
});
|
|
4427
|
-
e.markdownItPlugins && e.markdownItPlugins.length > 0 && e.markdownItPlugins.forEach((
|
|
4428
|
-
Array.isArray(
|
|
4427
|
+
e.markdownItPlugins && e.markdownItPlugins.length > 0 && e.markdownItPlugins.forEach((f) => {
|
|
4428
|
+
Array.isArray(f.options) ? h.use(f.plugin, ...f.options) : h.use(f.plugin, f.options);
|
|
4429
4429
|
});
|
|
4430
|
-
const
|
|
4431
|
-
return
|
|
4430
|
+
const b = h.renderer.rules.link_open || function(f, x, g, D, m) {
|
|
4431
|
+
return m.renderToken(f, x, g);
|
|
4432
4432
|
};
|
|
4433
|
-
return
|
|
4434
|
-
const
|
|
4435
|
-
|
|
4436
|
-
const
|
|
4437
|
-
return
|
|
4438
|
-
},
|
|
4433
|
+
return h.renderer.rules.link_open = function(f, x, g, D, m) {
|
|
4434
|
+
const E = f[x].attrIndex("target");
|
|
4435
|
+
E < 0 ? f[x].attrPush(["target", "_blank"]) : f[x].attrs && (f[x].attrs[E][1] = "_blank");
|
|
4436
|
+
const _ = f[x].attrIndex("rel");
|
|
4437
|
+
return _ < 0 ? f[x].attrPush(["rel", "noopener noreferrer"]) : f[x].attrs && (f[x].attrs[_][1] = "noopener noreferrer"), b(f, x, g, D, m);
|
|
4438
|
+
}, h;
|
|
4439
4439
|
}
|
|
4440
4440
|
let r = t();
|
|
4441
4441
|
function c() {
|
|
4442
4442
|
return !e.customPlugins || e.customPlugins.length === 0 ? [] : e.customPlugins.map(
|
|
4443
|
-
(
|
|
4444
|
-
).sort((
|
|
4443
|
+
(h) => h.plugin(h.options)
|
|
4444
|
+
).sort((h, b) => (b.priority || 0) - (h.priority || 0));
|
|
4445
4445
|
}
|
|
4446
4446
|
const a = Yu(c());
|
|
4447
4447
|
bu(() => e.customPlugins, () => {
|
|
@@ -4450,98 +4450,66 @@ const kr = D0({
|
|
|
4450
4450
|
r = t();
|
|
4451
4451
|
}, { deep: !0 });
|
|
4452
4452
|
const n = Yu([]);
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
return b.type === "text" ? b : b.type === "tag" ? s(b.children) : null;
|
|
4453
|
+
function i(d) {
|
|
4454
|
+
if (!d?.length) return null;
|
|
4455
|
+
let h = d[d.length - 1];
|
|
4456
|
+
return h.type === "text" ? h : h.type === "tag" ? i(h.children) : null;
|
|
4458
4457
|
}
|
|
4459
|
-
const
|
|
4460
|
-
if (!
|
|
4458
|
+
const s = (d) => {
|
|
4459
|
+
if (!d || d.length === 0)
|
|
4461
4460
|
return null;
|
|
4462
|
-
for (let
|
|
4463
|
-
const
|
|
4464
|
-
if (!(
|
|
4465
|
-
return
|
|
4461
|
+
for (let h = d.length - 1; h >= 0; h--) {
|
|
4462
|
+
const b = d[h];
|
|
4463
|
+
if (!(b.type === "text" && b.data.trim() === ""))
|
|
4464
|
+
return b;
|
|
4466
4465
|
}
|
|
4467
4466
|
return null;
|
|
4468
4467
|
};
|
|
4469
|
-
function
|
|
4470
|
-
const
|
|
4471
|
-
if (!
|
|
4472
|
-
const
|
|
4473
|
-
(
|
|
4468
|
+
function o(d, h = "add") {
|
|
4469
|
+
const b = (f) => {
|
|
4470
|
+
if (!f) return;
|
|
4471
|
+
const x = f.findIndex(
|
|
4472
|
+
(g) => g.type === "component" && g.name === "cursor"
|
|
4474
4473
|
);
|
|
4475
|
-
|
|
4474
|
+
x !== -1 && f.splice(x, 1), f.forEach((g) => g.children && b(g.children));
|
|
4476
4475
|
};
|
|
4477
|
-
if (d
|
|
4478
|
-
const
|
|
4479
|
-
let
|
|
4480
|
-
for (;
|
|
4481
|
-
|
|
4482
|
-
|
|
4476
|
+
if (b(d), h === "add") {
|
|
4477
|
+
const f = { type: "component", name: "cursor" };
|
|
4478
|
+
let x = d, g = s(d);
|
|
4479
|
+
for (; g && g.type === "tag" && g.children; )
|
|
4480
|
+
x = g.children, g = s(x);
|
|
4481
|
+
x.push(f);
|
|
4483
4482
|
}
|
|
4484
4483
|
}
|
|
4485
|
-
const l = (
|
|
4486
|
-
const
|
|
4484
|
+
const l = (d) => {
|
|
4485
|
+
const h = r.render(d), b = _r(h).children;
|
|
4487
4486
|
try {
|
|
4488
|
-
typeof window < "u" && (window.__mio_last_html__ =
|
|
4487
|
+
typeof window < "u" && (window.__mio_last_html__ = h, window.__mio_last_ast__ = b);
|
|
4489
4488
|
} catch {
|
|
4490
4489
|
}
|
|
4491
|
-
return
|
|
4490
|
+
return b;
|
|
4492
4491
|
};
|
|
4493
4492
|
return ae(() => {
|
|
4494
|
-
|
|
4495
|
-
/* @vite-ignore */
|
|
4496
|
-
"/assets/parser.worker-67NQKZt5.js",
|
|
4497
|
-
import.meta.url
|
|
4498
|
-
), {
|
|
4499
|
-
type: "module"
|
|
4500
|
-
}), i.onmessage = (h) => {
|
|
4501
|
-
n.value = h.data.ast;
|
|
4502
|
-
try {
|
|
4503
|
-
typeof window < "u" && (window.__mio_last_ast__ = n.value);
|
|
4504
|
-
} catch {
|
|
4505
|
-
}
|
|
4506
|
-
e.isStreaming && f(n.value, "add");
|
|
4507
|
-
}) : (n.value = l(e.md), e.isStreaming && f(n.value, "add"));
|
|
4493
|
+
n.value = l(e.md), e.isStreaming && o(n.value, "add");
|
|
4508
4494
|
}), ne(() => {
|
|
4509
|
-
i && i.terminate();
|
|
4510
4495
|
}), bu(
|
|
4511
4496
|
() => e.md,
|
|
4512
|
-
(
|
|
4513
|
-
const
|
|
4514
|
-
if (
|
|
4497
|
+
(d, h) => {
|
|
4498
|
+
const b = h || "";
|
|
4499
|
+
if (d === b) return;
|
|
4515
4500
|
if (!e.isStreaming) {
|
|
4516
|
-
|
|
4517
|
-
try {
|
|
4518
|
-
typeof window < "u" && (window.__mio_last_html__ = r.render(h));
|
|
4519
|
-
} catch {
|
|
4520
|
-
}
|
|
4521
|
-
i.postMessage({ markdownText: h });
|
|
4522
|
-
} else
|
|
4523
|
-
n.value = l(h);
|
|
4501
|
+
o(n.value, "remove"), n.value = l(d);
|
|
4524
4502
|
return;
|
|
4525
4503
|
}
|
|
4526
|
-
|
|
4527
|
-
if (f(n.value, "remove"), s(n.value), e.useWorker && i) {
|
|
4528
|
-
try {
|
|
4529
|
-
typeof window < "u" && (window.__mio_last_html__ = r.render(h));
|
|
4530
|
-
} catch {
|
|
4531
|
-
}
|
|
4532
|
-
i.postMessage({ markdownText: h });
|
|
4533
|
-
} else
|
|
4534
|
-
n.value = l(h);
|
|
4535
|
-
e.isStreaming && f(n.value, "add");
|
|
4536
|
-
}
|
|
4504
|
+
d.substring(b.length) && (o(n.value, "remove"), i(n.value), n.value = l(d), e.isStreaming && o(n.value, "add"));
|
|
4537
4505
|
},
|
|
4538
4506
|
{ immediate: !1 }
|
|
4539
4507
|
), bu(
|
|
4540
4508
|
() => e.isStreaming,
|
|
4541
|
-
(
|
|
4542
|
-
|
|
4509
|
+
(d) => {
|
|
4510
|
+
d ? o(n.value, "add") : o(n.value, "remove");
|
|
4543
4511
|
}
|
|
4544
|
-
), (
|
|
4512
|
+
), (d, h) => (se(), ie("div", Er, [
|
|
4545
4513
|
oe(kr, {
|
|
4546
4514
|
nodes: n.value,
|
|
4547
4515
|
plugins: a.value,
|
|
@@ -4553,7 +4521,7 @@ const kr = D0({
|
|
|
4553
4521
|
export {
|
|
4554
4522
|
Dr as MdRenderer,
|
|
4555
4523
|
qr as alertPlugin,
|
|
4556
|
-
|
|
4524
|
+
wr as codeBlockPlugin,
|
|
4557
4525
|
Sr as cursorPlugin,
|
|
4558
4526
|
Dr as default,
|
|
4559
4527
|
vr as emojiPlugin,
|