mark-deco-cli 0.6.0 → 0.7.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/dist/cli.cjs +133 -132
- package/dist/cli.cjs.map +1 -1
- package/package.json +6 -6
package/dist/cli.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*!
|
|
3
3
|
* name: mark-deco-cli
|
|
4
|
-
* version: 0.
|
|
4
|
+
* version: 0.7.0
|
|
5
5
|
* description: Command-line interface for mark-deco Markdown to HTML conversion processor
|
|
6
6
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
7
7
|
* license: MIT
|
|
8
8
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
9
|
-
* git.commit.hash:
|
|
9
|
+
* git.commit.hash: 2b8fc59fb30d614d1c529a3d2c9ec721a49c9115
|
|
10
10
|
*/
|
|
11
11
|
"use strict";
|
|
12
12
|
const commander = require("commander");
|
|
@@ -21412,16 +21412,17 @@ var dump_1 = dump$1;
|
|
|
21412
21412
|
var dumper = {
|
|
21413
21413
|
dump: dump_1
|
|
21414
21414
|
};
|
|
21415
|
+
var JSON_SCHEMA = json;
|
|
21415
21416
|
var load = loader.load;
|
|
21416
21417
|
var dump = dumper.dump;
|
|
21417
21418
|
/*!
|
|
21418
21419
|
* name: mark-deco
|
|
21419
|
-
* version: 0.
|
|
21420
|
+
* version: 0.7.0
|
|
21420
21421
|
* description: Flexible Markdown to HTML conversion library
|
|
21421
21422
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
21422
21423
|
* license: MIT
|
|
21423
21424
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
21424
|
-
* git.commit.hash:
|
|
21425
|
+
* git.commit.hash: 2b8fc59fb30d614d1c529a3d2c9ec721a49c9115
|
|
21425
21426
|
*/
|
|
21426
21427
|
const qd = (e) => {
|
|
21427
21428
|
try {
|
|
@@ -21459,7 +21460,7 @@ const qd = (e) => {
|
|
|
21459
21460
|
}, Ys = () => "width: 100%; height: auto; display: block; object-fit: contain; object-position: center;", ou = (e, t, u, r) => {
|
|
21460
21461
|
const a = Ys(), i = "", n = r ? ` ${r}` : "";
|
|
21461
21462
|
return `<img src="${e}" alt="${t}"${i} style="${a}"${n} />`;
|
|
21462
|
-
}, At = (e, t, u, r, a) => {
|
|
21463
|
+
}, At$1 = (e, t, u, r, a) => {
|
|
21463
21464
|
const i = ou(e, t, r, a);
|
|
21464
21465
|
return `<div class="${u}">
|
|
21465
21466
|
${i}
|
|
@@ -21744,7 +21745,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21744
21745
|
html: `<div class="oembed-description">${R(e.author_name)}</div>`
|
|
21745
21746
|
}), r.thumbnail !== void 0 && e.thumbnail_url && T2.push({
|
|
21746
21747
|
order: r.thumbnail,
|
|
21747
|
-
html: At(
|
|
21748
|
+
html: At$1(
|
|
21748
21749
|
R(e.thumbnail_url),
|
|
21749
21750
|
R(i),
|
|
21750
21751
|
"oembed-thumbnail"
|
|
@@ -21772,7 +21773,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21772
21773
|
</div>`
|
|
21773
21774
|
});
|
|
21774
21775
|
}
|
|
21775
|
-
const A = T2.sort((M2,
|
|
21776
|
+
const A = T2.sort((M2, ee2) => M2.order - ee2.order), w = [], v = [];
|
|
21776
21777
|
A.forEach((M2) => {
|
|
21777
21778
|
M2.html.includes("oembed-title") || M2.html.includes("oembed-author") || M2.html.includes("oembed-provider") || M2.html.includes("oembed-description") ? w.push(M2.html) : v.push(M2.html);
|
|
21778
21779
|
});
|
|
@@ -21801,7 +21802,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21801
21802
|
html: `<div class="oembed-description">${R(e.author_name)}</div>`
|
|
21802
21803
|
}), r.thumbnail !== void 0 && e.thumbnail_url && m.push({
|
|
21803
21804
|
order: r.thumbnail,
|
|
21804
|
-
html: At(
|
|
21805
|
+
html: At$1(
|
|
21805
21806
|
R(e.thumbnail_url),
|
|
21806
21807
|
R(i),
|
|
21807
21808
|
"oembed-thumbnail"
|
|
@@ -21849,7 +21850,7 @@ const Gd = async (e, t, u, r, a) => {
|
|
|
21849
21850
|
html: `<div class="oembed-description">${R(n)}</div>`
|
|
21850
21851
|
}), r.thumbnail !== void 0 && c && h.push({
|
|
21851
21852
|
order: r.thumbnail,
|
|
21852
|
-
html: At(
|
|
21853
|
+
html: At$1(
|
|
21853
21854
|
R(c),
|
|
21854
21855
|
R(i),
|
|
21855
21856
|
"oembed-thumbnail"
|
|
@@ -22101,7 +22102,7 @@ function Qt$1(e) {
|
|
|
22101
22102
|
function Te(e) {
|
|
22102
22103
|
return e.type === L.Root;
|
|
22103
22104
|
}
|
|
22104
|
-
function B(e) {
|
|
22105
|
+
function B$1(e) {
|
|
22105
22106
|
return Object.prototype.hasOwnProperty.call(e, "children");
|
|
22106
22107
|
}
|
|
22107
22108
|
function ze(e, t = false) {
|
|
@@ -22461,20 +22462,20 @@ function Ir(e, t) {
|
|
|
22461
22462
|
return xt$1(e, t);
|
|
22462
22463
|
}
|
|
22463
22464
|
function ya(e, t) {
|
|
22464
|
-
return B(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
|
|
22465
|
+
return B$1(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
|
|
22465
22466
|
}
|
|
22466
22467
|
function ot(e) {
|
|
22467
22468
|
return Array.isArray(e) ? e.map(ot).join("") : I(e) ? e.name === "br" ? `
|
|
22468
22469
|
` : ot(e.children) : wt$1(e) ? ot(e.children) : se(e) ? e.data : "";
|
|
22469
22470
|
}
|
|
22470
22471
|
function Le(e) {
|
|
22471
|
-
return Array.isArray(e) ? e.map(Le).join("") : B(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
|
|
22472
|
+
return Array.isArray(e) ? e.map(Le).join("") : B$1(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
|
|
22472
22473
|
}
|
|
22473
22474
|
function dt(e) {
|
|
22474
|
-
return Array.isArray(e) ? e.map(dt).join("") : B(e) && (e.type === L.Tag || wt$1(e)) ? dt(e.children) : se(e) ? e.data : "";
|
|
22475
|
+
return Array.isArray(e) ? e.map(dt).join("") : B$1(e) && (e.type === L.Tag || wt$1(e)) ? dt(e.children) : se(e) ? e.data : "";
|
|
22475
22476
|
}
|
|
22476
22477
|
function It$1(e) {
|
|
22477
|
-
return B(e) ? e.children : [];
|
|
22478
|
+
return B$1(e) ? e.children : [];
|
|
22478
22479
|
}
|
|
22479
22480
|
function Sr(e) {
|
|
22480
22481
|
return e.parent || null;
|
|
@@ -22579,7 +22580,7 @@ function Eu(e, t, u, r) {
|
|
|
22579
22580
|
const c = i[0][n[0]++];
|
|
22580
22581
|
if (e(c) && (a.push(c), --r <= 0))
|
|
22581
22582
|
return a;
|
|
22582
|
-
u && B(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
|
|
22583
|
+
u && B$1(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
|
|
22583
22584
|
}
|
|
22584
22585
|
}
|
|
22585
22586
|
function Ua(e, t) {
|
|
@@ -22591,7 +22592,7 @@ function Tu(e, t, u = true) {
|
|
|
22591
22592
|
const i = r[a];
|
|
22592
22593
|
if (I(i) && e(i))
|
|
22593
22594
|
return i;
|
|
22594
|
-
if (u && B(i) && i.children.length > 0) {
|
|
22595
|
+
if (u && B$1(i) && i.children.length > 0) {
|
|
22595
22596
|
const n = Tu(e, i.children, true);
|
|
22596
22597
|
if (n)
|
|
22597
22598
|
return n;
|
|
@@ -22600,7 +22601,7 @@ function Tu(e, t, u = true) {
|
|
|
22600
22601
|
return null;
|
|
22601
22602
|
}
|
|
22602
22603
|
function yr(e, t) {
|
|
22603
|
-
return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B(u) && yr(e, u.children));
|
|
22604
|
+
return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B$1(u) && yr(e, u.children));
|
|
22604
22605
|
}
|
|
22605
22606
|
function Fa(e, t) {
|
|
22606
22607
|
const u = [], r = [Array.isArray(t) ? t : [t]], a = [0];
|
|
@@ -22612,7 +22613,7 @@ function Fa(e, t) {
|
|
|
22612
22613
|
continue;
|
|
22613
22614
|
}
|
|
22614
22615
|
const i = r[0][a[0]++];
|
|
22615
|
-
I(i) && e(i) && u.push(i), B(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
|
|
22616
|
+
I(i) && e(i) && u.push(i), B$1(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
|
|
22616
22617
|
}
|
|
22617
22618
|
}
|
|
22618
22619
|
const ht = {
|
|
@@ -22683,10 +22684,10 @@ function Lr(e, t) {
|
|
|
22683
22684
|
const u = [], r = [];
|
|
22684
22685
|
if (e === t)
|
|
22685
22686
|
return 0;
|
|
22686
|
-
let a = B(e) ? e : e.parent;
|
|
22687
|
+
let a = B$1(e) ? e : e.parent;
|
|
22687
22688
|
for (; a; )
|
|
22688
22689
|
u.unshift(a), a = a.parent;
|
|
22689
|
-
for (a = B(t) ? t : t.parent; a; )
|
|
22690
|
+
for (a = B$1(t) ? t : t.parent; a; )
|
|
22690
22691
|
r.unshift(a), a = a.parent;
|
|
22691
22692
|
const i = Math.min(u.length, r.length);
|
|
22692
22693
|
let n = 0;
|
|
@@ -22810,7 +22811,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
22810
22811
|
getSiblings: Cr,
|
|
22811
22812
|
getText: ot,
|
|
22812
22813
|
hasAttrib: La,
|
|
22813
|
-
hasChildren: B,
|
|
22814
|
+
hasChildren: B$1,
|
|
22814
22815
|
innerText: dt,
|
|
22815
22816
|
isCDATA: wt$1,
|
|
22816
22817
|
isComment: Nt$1,
|
|
@@ -22935,7 +22936,7 @@ var ve;
|
|
|
22935
22936
|
(function(e) {
|
|
22936
22937
|
e[e.LowerA = 97] = "LowerA", e[e.LowerZ = 122] = "LowerZ", e[e.UpperA = 65] = "UpperA", e[e.UpperZ = 90] = "UpperZ", e[e.Exclamation = 33] = "Exclamation";
|
|
22937
22938
|
})(ve || (ve = {}));
|
|
22938
|
-
function Xt(e) {
|
|
22939
|
+
function Xt$1(e) {
|
|
22939
22940
|
const t = e.indexOf("<");
|
|
22940
22941
|
if (t === -1 || t > e.length - 3)
|
|
22941
22942
|
return false;
|
|
@@ -24378,7 +24379,7 @@ function Hr(e, t, u) {
|
|
|
24378
24379
|
throw new Error("Expected `=`");
|
|
24379
24380
|
i(2);
|
|
24380
24381
|
} else t.charCodeAt(u) === 61 && (S2 = H.Equals, i(1));
|
|
24381
|
-
let M2 = "",
|
|
24382
|
+
let M2 = "", ee2 = null;
|
|
24382
24383
|
if (S2 !== "exists") {
|
|
24383
24384
|
if (Ht$1(t.charCodeAt(u))) {
|
|
24384
24385
|
const ge = t.charCodeAt(u);
|
|
@@ -24396,7 +24397,7 @@ function Hr(e, t, u) {
|
|
|
24396
24397
|
}
|
|
24397
24398
|
i(0);
|
|
24398
24399
|
const ae = t.charCodeAt(u) | 32;
|
|
24399
|
-
ae === 115 ? (
|
|
24400
|
+
ae === 115 ? (ee2 = false, i(1)) : ae === 105 && (ee2 = true, i(1));
|
|
24400
24401
|
}
|
|
24401
24402
|
if (t.charCodeAt(u) !== 93)
|
|
24402
24403
|
throw new Error("Attribute selector didn't terminate");
|
|
@@ -24407,7 +24408,7 @@ function Hr(e, t, u) {
|
|
|
24407
24408
|
action: S2,
|
|
24408
24409
|
value: M2,
|
|
24409
24410
|
namespace: v,
|
|
24410
|
-
ignoreCase:
|
|
24411
|
+
ignoreCase: ee2
|
|
24411
24412
|
};
|
|
24412
24413
|
r.push(he);
|
|
24413
24414
|
break;
|
|
@@ -25425,7 +25426,7 @@ const Cn = xu((e) => fu(e)), yn = et((e) => {
|
|
|
25425
25426
|
return t;
|
|
25426
25427
|
}, Pe), Dn = Iu((e) => bu(e), Pe), kn = et((e) => Cr(e).filter((t) => I(t) && t !== e), ke), Pn = et((e) => It$1(e).filter(I), Pe);
|
|
25427
25428
|
function Mn() {
|
|
25428
|
-
const e = this.toArray().reduce((t, u) => B(u) ? t.concat(u.children) : t, []);
|
|
25429
|
+
const e = this.toArray().reduce((t, u) => B$1(u) ? t.concat(u.children) : t, []);
|
|
25429
25430
|
return this._make(e);
|
|
25430
25431
|
}
|
|
25431
25432
|
function Bn(e) {
|
|
@@ -25594,7 +25595,7 @@ function ts(e) {
|
|
|
25594
25595
|
return function(...t) {
|
|
25595
25596
|
const u = this.length - 1;
|
|
25596
25597
|
return P(this, (r, a) => {
|
|
25597
|
-
if (!B(r))
|
|
25598
|
+
if (!B$1(r))
|
|
25598
25599
|
return;
|
|
25599
25600
|
const i = typeof t[0] == "function" ? t[0].call(r, a, this._render(r.children)) : t, n = this._makeDomArray(i, a < u);
|
|
25600
25601
|
e(n, r.children, r);
|
|
@@ -25633,8 +25634,8 @@ function us(e) {
|
|
|
25633
25634
|
return function(t) {
|
|
25634
25635
|
const u = this.length - 1, r = this.parents().last();
|
|
25635
25636
|
for (let a = 0; a < this.length; a++) {
|
|
25636
|
-
const i = this[a], n = typeof t == "function" ? t.call(i, a, i) : typeof t == "string" && !Xt(t) ? r.find(t).clone() : t, [c] = this._makeDomArray(n, a < u);
|
|
25637
|
-
if (!c || !B(c))
|
|
25637
|
+
const i = this[a], n = typeof t == "function" ? t.call(i, a, i) : typeof t == "string" && !Xt$1(t) ? r.find(t).clone() : t, [c] = this._makeDomArray(n, a < u);
|
|
25638
|
+
if (!c || !B$1(c))
|
|
25638
25639
|
continue;
|
|
25639
25640
|
let h = c, m = 0;
|
|
25640
25641
|
for (; m < h.children.length; ) {
|
|
@@ -25653,7 +25654,7 @@ const io = us((e, t, u) => {
|
|
|
25653
25654
|
const a = r.children, i = a.indexOf(e);
|
|
25654
25655
|
xe([e], t), _e(a, i, 0, u, r);
|
|
25655
25656
|
}), no = us((e, t, u) => {
|
|
25656
|
-
B(e) && (xe(e.children, t), xe(u, e));
|
|
25657
|
+
B$1(e) && (xe(e.children, t), xe(u, e));
|
|
25657
25658
|
});
|
|
25658
25659
|
function oo(e) {
|
|
25659
25660
|
return this.parent(e).not("body").each((t, u) => {
|
|
@@ -25679,7 +25680,7 @@ function co(e) {
|
|
|
25679
25680
|
function ho(...e) {
|
|
25680
25681
|
const t = this.length - 1;
|
|
25681
25682
|
return P(this, (u, r) => {
|
|
25682
|
-
if (!B(u) || !u.parent)
|
|
25683
|
+
if (!B$1(u) || !u.parent)
|
|
25683
25684
|
return;
|
|
25684
25685
|
const a = u.parent.children, i = a.indexOf(u);
|
|
25685
25686
|
if (i === -1)
|
|
@@ -25703,7 +25704,7 @@ function lo(e) {
|
|
|
25703
25704
|
function mo(...e) {
|
|
25704
25705
|
const t = this.length - 1;
|
|
25705
25706
|
return P(this, (u, r) => {
|
|
25706
|
-
if (!B(u) || !u.parent)
|
|
25707
|
+
if (!B$1(u) || !u.parent)
|
|
25707
25708
|
return;
|
|
25708
25709
|
const a = u.parent.children, i = a.indexOf(u);
|
|
25709
25710
|
if (i === -1)
|
|
@@ -25743,7 +25744,7 @@ function bo(e) {
|
|
|
25743
25744
|
}
|
|
25744
25745
|
function Eo() {
|
|
25745
25746
|
return P(this, (e) => {
|
|
25746
|
-
if (B(e)) {
|
|
25747
|
+
if (B$1(e)) {
|
|
25747
25748
|
for (const t of e.children)
|
|
25748
25749
|
t.next = t.prev = t.parent = null;
|
|
25749
25750
|
e.children.length = 0;
|
|
@@ -25753,10 +25754,10 @@ function Eo() {
|
|
|
25753
25754
|
function To(e) {
|
|
25754
25755
|
if (e === void 0) {
|
|
25755
25756
|
const t = this[0];
|
|
25756
|
-
return !t || !B(t) ? null : this._render(t.children);
|
|
25757
|
+
return !t || !B$1(t) ? null : this._render(t.children);
|
|
25757
25758
|
}
|
|
25758
25759
|
return P(this, (t) => {
|
|
25759
|
-
if (!B(t))
|
|
25760
|
+
if (!B$1(t))
|
|
25760
25761
|
return;
|
|
25761
25762
|
for (const r of t.children)
|
|
25762
25763
|
r.next = r.prev = r.parent = null;
|
|
@@ -25769,7 +25770,7 @@ function _o() {
|
|
|
25769
25770
|
}
|
|
25770
25771
|
function go(e) {
|
|
25771
25772
|
return e === void 0 ? Qe(this) : typeof e == "function" ? P(this, (t, u) => this._make(t).text(e.call(t, u, Qe([t])))) : P(this, (t) => {
|
|
25772
|
-
if (!B(t))
|
|
25773
|
+
if (!B$1(t))
|
|
25773
25774
|
return;
|
|
25774
25775
|
for (const r of t.children)
|
|
25775
25776
|
r.next = r.prev = r.parent = null;
|
|
@@ -25961,7 +25962,7 @@ function ko(e, t) {
|
|
|
25961
25962
|
const v = Kt(w, n), S2 = typeof A == "string" ? [e(A, v, false, null)] : "length" in A ? A : [A], U2 = de(S2) ? S2 : new h(S2, null, v);
|
|
25962
25963
|
if (U2._root = U2, !f)
|
|
25963
25964
|
return new h(void 0, U2, v);
|
|
25964
|
-
const M2 = typeof f == "string" && Xt(f) ? (
|
|
25965
|
+
const M2 = typeof f == "string" && Xt$1(f) ? (
|
|
25965
25966
|
// $(<html>)
|
|
25966
25967
|
e(f, v, false, null).children
|
|
25967
25968
|
) : Po(f) ? (
|
|
@@ -25970,15 +25971,15 @@ function ko(e, t) {
|
|
|
25970
25971
|
) : Array.isArray(f) ? (
|
|
25971
25972
|
// $([dom])
|
|
25972
25973
|
f
|
|
25973
|
-
) : void 0,
|
|
25974
|
+
) : void 0, ee2 = new h(M2, U2, v);
|
|
25974
25975
|
if (M2)
|
|
25975
|
-
return
|
|
25976
|
+
return ee2;
|
|
25976
25977
|
if (typeof f != "string")
|
|
25977
25978
|
throw new TypeError("Unexpected type of selector");
|
|
25978
25979
|
let he = f;
|
|
25979
25980
|
const ae = T2 ? (
|
|
25980
25981
|
// If we don't have a context, maybe we have a root, from loading
|
|
25981
|
-
typeof T2 == "string" ? Xt(T2) ? (
|
|
25982
|
+
typeof T2 == "string" ? Xt$1(T2) ? (
|
|
25982
25983
|
// $('li', '<ul>...</ul>')
|
|
25983
25984
|
new h([e(T2, v, false, null)], U2, v)
|
|
25984
25985
|
) : (
|
|
@@ -25992,7 +25993,7 @@ function ko(e, t) {
|
|
|
25992
25993
|
new h(Array.isArray(T2) ? T2 : [T2], U2, v)
|
|
25993
25994
|
)
|
|
25994
25995
|
) : U2;
|
|
25995
|
-
return ae ? ae.find(he) :
|
|
25996
|
+
return ae ? ae.find(he) : ee2;
|
|
25996
25997
|
}
|
|
25997
25998
|
return Object.assign(m, ni, {
|
|
25998
25999
|
load: u,
|
|
@@ -26595,7 +26596,7 @@ const Ko = /* @__PURE__ */ new Map([
|
|
|
26595
26596
|
[p.WBR, s.WBR],
|
|
26596
26597
|
[p.XMP, s.XMP]
|
|
26597
26598
|
]);
|
|
26598
|
-
function yt
|
|
26599
|
+
function yt(e) {
|
|
26599
26600
|
var t;
|
|
26600
26601
|
return (t = Ko.get(e)) !== null && t !== void 0 ? t : s.UNKNOWN;
|
|
26601
26602
|
}
|
|
@@ -26887,7 +26888,7 @@ class rc {
|
|
|
26887
26888
|
}
|
|
26888
26889
|
emitCurrentTagToken() {
|
|
26889
26890
|
const t = this.currentToken;
|
|
26890
|
-
this.prepareToken(t), t.tagID = yt
|
|
26891
|
+
this.prepareToken(t), t.tagID = yt(t.tagName), t.type === O.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(b.endTagWithAttributes), t.selfClosing && this._err(b.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk();
|
|
26891
26892
|
}
|
|
26892
26893
|
emitCurrentComment(t) {
|
|
26893
26894
|
this.prepareToken(t), this.handler.onComment(t), this.preprocessor.dropParsedChunk();
|
|
@@ -28866,11 +28867,11 @@ class dc {
|
|
|
28866
28867
|
}
|
|
28867
28868
|
}
|
|
28868
28869
|
const Gt$1 = 3;
|
|
28869
|
-
var te
|
|
28870
|
+
var te;
|
|
28870
28871
|
(function(e) {
|
|
28871
28872
|
e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element";
|
|
28872
|
-
})(te
|
|
28873
|
-
const nr = { type: te
|
|
28873
|
+
})(te || (te = {}));
|
|
28874
|
+
const nr = { type: te.Marker };
|
|
28874
28875
|
class hc {
|
|
28875
28876
|
constructor(t) {
|
|
28876
28877
|
this.treeAdapter = t, this.entries = [], this.bookmark = null;
|
|
@@ -28882,7 +28883,7 @@ class hc {
|
|
|
28882
28883
|
const r = [], a = u.length, i = this.treeAdapter.getTagName(t), n = this.treeAdapter.getNamespaceURI(t);
|
|
28883
28884
|
for (let c = 0; c < this.entries.length; c++) {
|
|
28884
28885
|
const h = this.entries[c];
|
|
28885
|
-
if (h.type === te
|
|
28886
|
+
if (h.type === te.Marker)
|
|
28886
28887
|
break;
|
|
28887
28888
|
const { element: m } = h;
|
|
28888
28889
|
if (this.treeAdapter.getTagName(m) === i && this.treeAdapter.getNamespaceURI(m) === n) {
|
|
@@ -28911,7 +28912,7 @@ class hc {
|
|
|
28911
28912
|
}
|
|
28912
28913
|
pushElement(t, u) {
|
|
28913
28914
|
this._ensureNoahArkCondition(t), this.entries.unshift({
|
|
28914
|
-
type: te
|
|
28915
|
+
type: te.Element,
|
|
28915
28916
|
element: t,
|
|
28916
28917
|
token: u
|
|
28917
28918
|
});
|
|
@@ -28919,7 +28920,7 @@ class hc {
|
|
|
28919
28920
|
insertElementAfterBookmark(t, u) {
|
|
28920
28921
|
const r = this.entries.indexOf(this.bookmark);
|
|
28921
28922
|
this.entries.splice(r, 0, {
|
|
28922
|
-
type: te
|
|
28923
|
+
type: te.Element,
|
|
28923
28924
|
element: t,
|
|
28924
28925
|
token: u
|
|
28925
28926
|
});
|
|
@@ -28939,11 +28940,11 @@ class hc {
|
|
|
28939
28940
|
}
|
|
28940
28941
|
//Search
|
|
28941
28942
|
getElementEntryInScopeWithTagName(t) {
|
|
28942
|
-
const u = this.entries.find((r) => r.type === te
|
|
28943
|
-
return u && u.type === te
|
|
28943
|
+
const u = this.entries.find((r) => r.type === te.Marker || this.treeAdapter.getTagName(r.element) === t);
|
|
28944
|
+
return u && u.type === te.Element ? u : null;
|
|
28944
28945
|
}
|
|
28945
28946
|
getElementEntry(t) {
|
|
28946
|
-
return this.entries.find((u) => u.type === te
|
|
28947
|
+
return this.entries.find((u) => u.type === te.Element && u.element === t);
|
|
28947
28948
|
}
|
|
28948
28949
|
}
|
|
28949
28950
|
const oe = {
|
|
@@ -29378,7 +29379,7 @@ function Cu(e) {
|
|
|
29378
29379
|
}
|
|
29379
29380
|
function Ic(e) {
|
|
29380
29381
|
const t = wc.get(e.tagName);
|
|
29381
|
-
t != null && (e.tagName = t, e.tagID = yt
|
|
29382
|
+
t != null && (e.tagName = t, e.tagID = yt(e.tagName));
|
|
29382
29383
|
}
|
|
29383
29384
|
function Sc(e, t) {
|
|
29384
29385
|
return t === E.MATHML && (e === s.MI || e === s.MO || e === s.MN || e === s.MS || e === s.MTEXT);
|
|
@@ -29419,7 +29420,7 @@ class Es {
|
|
|
29419
29420
|
this.fragmentContext = r, this.scriptHandler = a, this.currentToken = null, this.stopped = false, this.insertionMode = l.INITIAL, this.originalInsertionMode = l.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = false, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = false, this.framesetOk = true, this.skipNextNewLine = false, this.fosterParentingEnabled = false, this.options = {
|
|
29420
29421
|
...dr,
|
|
29421
29422
|
...t
|
|
29422
|
-
}, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = true), this.document = u ?? this.treeAdapter.createDocument(), this.tokenizer = new rc(this.options, this), this.activeFormattingElements = new hc(this.treeAdapter), this.fragmentContextID = r ? yt
|
|
29423
|
+
}, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = true), this.document = u ?? this.treeAdapter.createDocument(), this.tokenizer = new rc(this.options, this), this.activeFormattingElements = new hc(this.treeAdapter), this.fragmentContextID = r ? yt(this.treeAdapter.getTagName(r)) : s.UNKNOWN, this._setContextModes(r ?? this.document, this.fragmentContextID), this.openElements = new dc(this.document, this.treeAdapter, this);
|
|
29423
29424
|
}
|
|
29424
29425
|
// API
|
|
29425
29426
|
static parse(t, u) {
|
|
@@ -29679,7 +29680,7 @@ class Es {
|
|
|
29679
29680
|
_reconstructActiveFormattingElements() {
|
|
29680
29681
|
const t = this.activeFormattingElements.entries.length;
|
|
29681
29682
|
if (t) {
|
|
29682
|
-
const u = this.activeFormattingElements.entries.findIndex((a) => a.type === te
|
|
29683
|
+
const u = this.activeFormattingElements.entries.findIndex((a) => a.type === te.Marker || this.openElements.contains(a.element)), r = u === -1 ? t - 1 : u - 1;
|
|
29683
29684
|
for (let a = r; a >= 0; a--) {
|
|
29684
29685
|
const i = this.activeFormattingElements.entries[a];
|
|
29685
29686
|
this._insertElement(i.token, this.treeAdapter.getNamespaceURI(i.element)), i.element = this.openElements.current;
|
|
@@ -29859,7 +29860,7 @@ class Es {
|
|
|
29859
29860
|
case l.IN_TABLE:
|
|
29860
29861
|
case l.IN_TABLE_BODY:
|
|
29861
29862
|
case l.IN_ROW: {
|
|
29862
|
-
Wt
|
|
29863
|
+
Wt(this, t);
|
|
29863
29864
|
break;
|
|
29864
29865
|
}
|
|
29865
29866
|
case l.IN_TABLE_TEXT: {
|
|
@@ -29918,7 +29919,7 @@ class Es {
|
|
|
29918
29919
|
case l.IN_TABLE:
|
|
29919
29920
|
case l.IN_TABLE_BODY:
|
|
29920
29921
|
case l.IN_ROW: {
|
|
29921
|
-
Wt
|
|
29922
|
+
Wt(this, t);
|
|
29922
29923
|
break;
|
|
29923
29924
|
}
|
|
29924
29925
|
case l.IN_COLUMN_GROUP: {
|
|
@@ -30032,7 +30033,7 @@ class Es {
|
|
|
30032
30033
|
break;
|
|
30033
30034
|
}
|
|
30034
30035
|
case l.IN_HEAD: {
|
|
30035
|
-
J
|
|
30036
|
+
J(this, t);
|
|
30036
30037
|
break;
|
|
30037
30038
|
}
|
|
30038
30039
|
case l.IN_HEAD_NO_SCRIPT: {
|
|
@@ -30304,7 +30305,7 @@ class Es {
|
|
|
30304
30305
|
case l.IN_TABLE:
|
|
30305
30306
|
case l.IN_TABLE_BODY:
|
|
30306
30307
|
case l.IN_ROW: {
|
|
30307
|
-
Wt
|
|
30308
|
+
Wt(this, t);
|
|
30308
30309
|
break;
|
|
30309
30310
|
}
|
|
30310
30311
|
case l.IN_TABLE_TEXT: {
|
|
@@ -30342,7 +30343,7 @@ function Bc(e, t) {
|
|
|
30342
30343
|
return e.openElements.replace(t.element, r), t.element = r, r;
|
|
30343
30344
|
}
|
|
30344
30345
|
function Uc(e, t, u) {
|
|
30345
|
-
const r = e.treeAdapter.getTagName(t), a = yt
|
|
30346
|
+
const r = e.treeAdapter.getTagName(t), a = yt(r);
|
|
30346
30347
|
if (e._isElementCausesFosterParenting(a))
|
|
30347
30348
|
e._fosterParentElement(u);
|
|
30348
30349
|
else {
|
|
@@ -30429,7 +30430,7 @@ function Gc(e, t) {
|
|
|
30429
30430
|
function je(e, t) {
|
|
30430
30431
|
e._insertFakeElement(p.HEAD, s.HEAD), e.headElement = e.openElements.current, e.insertionMode = l.IN_HEAD, e._processToken(t);
|
|
30431
30432
|
}
|
|
30432
|
-
function J
|
|
30433
|
+
function J(e, t) {
|
|
30433
30434
|
switch (t.tagID) {
|
|
30434
30435
|
case s.HTML: {
|
|
30435
30436
|
G$1(e, t);
|
|
@@ -30511,7 +30512,7 @@ function zc(e, t) {
|
|
|
30511
30512
|
case s.META:
|
|
30512
30513
|
case s.NOFRAMES:
|
|
30513
30514
|
case s.STYLE: {
|
|
30514
|
-
J
|
|
30515
|
+
J(e, t);
|
|
30515
30516
|
break;
|
|
30516
30517
|
}
|
|
30517
30518
|
case s.NOSCRIPT: {
|
|
@@ -30564,7 +30565,7 @@ function Kc(e, t) {
|
|
|
30564
30565
|
case s.STYLE:
|
|
30565
30566
|
case s.TEMPLATE:
|
|
30566
30567
|
case s.TITLE: {
|
|
30567
|
-
e._err(t, b.abandonedHeadElementChild), e.openElements.push(e.headElement, s.HEAD), J
|
|
30568
|
+
e._err(t, b.abandonedHeadElementChild), e.openElements.push(e.headElement, s.HEAD), J(e, t), e.openElements.remove(e.headElement);
|
|
30568
30569
|
break;
|
|
30569
30570
|
}
|
|
30570
30571
|
case s.HEAD: {
|
|
@@ -30853,7 +30854,7 @@ function G$1(e, t) {
|
|
|
30853
30854
|
case s.BGSOUND:
|
|
30854
30855
|
case s.BASEFONT:
|
|
30855
30856
|
case s.TEMPLATE: {
|
|
30856
|
-
J
|
|
30857
|
+
J(e, t);
|
|
30857
30858
|
break;
|
|
30858
30859
|
}
|
|
30859
30860
|
case s.BODY: {
|
|
@@ -31110,7 +31111,7 @@ function M0(e, t) {
|
|
|
31110
31111
|
function B0(e, t) {
|
|
31111
31112
|
e._err(t, b.eofInElementThatCanContainOnlyText), e.openElements.pop(), e.insertionMode = e.originalInsertionMode, e.onEof(t);
|
|
31112
31113
|
}
|
|
31113
|
-
function Wt
|
|
31114
|
+
function Wt(e, t) {
|
|
31114
31115
|
if (e.openElements.currentTagId !== void 0 && bs.has(e.openElements.currentTagId))
|
|
31115
31116
|
switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = false, e.originalInsertionMode = e.insertionMode, e.insertionMode = l.IN_TABLE_TEXT, t.type) {
|
|
31116
31117
|
case O.CHARACTER: {
|
|
@@ -31160,7 +31161,7 @@ function Re(e, t) {
|
|
|
31160
31161
|
case s.STYLE:
|
|
31161
31162
|
case s.SCRIPT:
|
|
31162
31163
|
case s.TEMPLATE: {
|
|
31163
|
-
J
|
|
31164
|
+
J(e, t);
|
|
31164
31165
|
break;
|
|
31165
31166
|
}
|
|
31166
31167
|
case s.COL: {
|
|
@@ -31282,7 +31283,7 @@ function Lu(e, t) {
|
|
|
31282
31283
|
break;
|
|
31283
31284
|
}
|
|
31284
31285
|
case s.TEMPLATE: {
|
|
31285
|
-
J
|
|
31286
|
+
J(e, t);
|
|
31286
31287
|
break;
|
|
31287
31288
|
}
|
|
31288
31289
|
default:
|
|
@@ -31464,7 +31465,7 @@ function Cs(e, t) {
|
|
|
31464
31465
|
}
|
|
31465
31466
|
case s.SCRIPT:
|
|
31466
31467
|
case s.TEMPLATE: {
|
|
31467
|
-
J
|
|
31468
|
+
J(e, t);
|
|
31468
31469
|
break;
|
|
31469
31470
|
}
|
|
31470
31471
|
}
|
|
@@ -31510,7 +31511,7 @@ function J0(e, t) {
|
|
|
31510
31511
|
case s.STYLE:
|
|
31511
31512
|
case s.TEMPLATE:
|
|
31512
31513
|
case s.TITLE: {
|
|
31513
|
-
J
|
|
31514
|
+
J(e, t);
|
|
31514
31515
|
break;
|
|
31515
31516
|
}
|
|
31516
31517
|
// Re-process the token in the appropriate mode
|
|
@@ -31577,7 +31578,7 @@ function ud(e, t) {
|
|
|
31577
31578
|
break;
|
|
31578
31579
|
}
|
|
31579
31580
|
case s.NOFRAMES: {
|
|
31580
|
-
J
|
|
31581
|
+
J(e, t);
|
|
31581
31582
|
break;
|
|
31582
31583
|
}
|
|
31583
31584
|
}
|
|
@@ -31592,7 +31593,7 @@ function sd(e, t) {
|
|
|
31592
31593
|
break;
|
|
31593
31594
|
}
|
|
31594
31595
|
case s.NOFRAMES: {
|
|
31595
|
-
J
|
|
31596
|
+
J(e, t);
|
|
31596
31597
|
break;
|
|
31597
31598
|
}
|
|
31598
31599
|
}
|
|
@@ -31613,7 +31614,7 @@ function nd(e, t) {
|
|
|
31613
31614
|
break;
|
|
31614
31615
|
}
|
|
31615
31616
|
case s.NOFRAMES: {
|
|
31616
|
-
J
|
|
31617
|
+
J(e, t);
|
|
31617
31618
|
break;
|
|
31618
31619
|
}
|
|
31619
31620
|
}
|
|
@@ -32438,7 +32439,7 @@ const Ld = (e) => {
|
|
|
32438
32439
|
h && a.image !== void 0 && v.push({
|
|
32439
32440
|
order: a.image,
|
|
32440
32441
|
section: "image",
|
|
32441
|
-
html: At(
|
|
32442
|
+
html: At$1(
|
|
32442
32443
|
j$1(h),
|
|
32443
32444
|
j$1(A),
|
|
32444
32445
|
"card-image",
|
|
@@ -32517,7 +32518,7 @@ const Ld = (e) => {
|
|
|
32517
32518
|
"locale",
|
|
32518
32519
|
"favicon"
|
|
32519
32520
|
].includes(y) || a[y] === void 0 && M2.push(y);
|
|
32520
|
-
let
|
|
32521
|
+
let ee2 = 1e3;
|
|
32521
32522
|
for (const y of M2) {
|
|
32522
32523
|
const W2 = e[y];
|
|
32523
32524
|
let Ce = "";
|
|
@@ -32533,7 +32534,7 @@ const Ld = (e) => {
|
|
|
32533
32534
|
<span class="field-value">${j$1(String(W2))}</span>
|
|
32534
32535
|
</div>`;
|
|
32535
32536
|
v.push({
|
|
32536
|
-
order:
|
|
32537
|
+
order: ee2++,
|
|
32537
32538
|
section: "enhanced",
|
|
32538
32539
|
html: Ce
|
|
32539
32540
|
});
|
|
@@ -32562,14 +32563,14 @@ const Ld = (e) => {
|
|
|
32562
32563
|
};
|
|
32563
32564
|
/*!
|
|
32564
32565
|
* name: mark-deco
|
|
32565
|
-
* version: 0.
|
|
32566
|
+
* version: 0.7.0
|
|
32566
32567
|
* description: Flexible Markdown to HTML conversion library
|
|
32567
32568
|
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
32568
32569
|
* license: MIT
|
|
32569
32570
|
* repository.url: https://github.com/kekyo/mark-deco.git
|
|
32570
|
-
* git.commit.hash:
|
|
32571
|
+
* git.commit.hash: 2b8fc59fb30d614d1c529a3d2c9ec721a49c9115
|
|
32571
32572
|
*/
|
|
32572
|
-
function
|
|
32573
|
+
function gt(e) {
|
|
32573
32574
|
const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, r = e.match(t);
|
|
32574
32575
|
if (!r)
|
|
32575
32576
|
return {
|
|
@@ -32578,7 +32579,7 @@ function yt(e) {
|
|
|
32578
32579
|
};
|
|
32579
32580
|
const o2 = r[1] || "", n = e.slice(r[0].length);
|
|
32580
32581
|
try {
|
|
32581
|
-
const s2 = load(o2);
|
|
32582
|
+
const s2 = load(o2, { schema: JSON_SCHEMA });
|
|
32582
32583
|
return {
|
|
32583
32584
|
data: s2 && typeof s2 == "object" && !Array.isArray(s2) ? s2 : {},
|
|
32584
32585
|
content: n
|
|
@@ -32588,7 +32589,7 @@ function yt(e) {
|
|
|
32588
32589
|
throw new Error(`Failed to parse frontmatter YAML: ${h}`);
|
|
32589
32590
|
}
|
|
32590
32591
|
}
|
|
32591
|
-
function
|
|
32592
|
+
function wt(e) {
|
|
32592
32593
|
if (!e || Object.keys(e).length === 0)
|
|
32593
32594
|
return "";
|
|
32594
32595
|
const t = dump(e, { lineWidth: 0 });
|
|
@@ -32596,24 +32597,24 @@ function gt(e) {
|
|
|
32596
32597
|
`) ? t : `${t}
|
|
32597
32598
|
`;
|
|
32598
32599
|
}
|
|
32599
|
-
function
|
|
32600
|
+
function vt(e, t) {
|
|
32600
32601
|
const r = t ?? "";
|
|
32601
32602
|
return `${`---
|
|
32602
|
-
${
|
|
32603
|
+
${wt(e)}---
|
|
32603
32604
|
`}${r}`;
|
|
32604
32605
|
}
|
|
32605
32606
|
const T = () => {
|
|
32606
|
-
},
|
|
32607
|
+
}, kt = {
|
|
32607
32608
|
debug: T,
|
|
32608
32609
|
info: T,
|
|
32609
32610
|
warn: T,
|
|
32610
32611
|
error: T
|
|
32611
|
-
},
|
|
32612
|
+
}, Et = {
|
|
32612
32613
|
debug: console.debug,
|
|
32613
32614
|
info: console.info,
|
|
32614
32615
|
warn: console.warn,
|
|
32615
32616
|
error: console.error
|
|
32616
|
-
},
|
|
32617
|
+
}, bt = () => kt, Gt = () => Et, S = (e) => {
|
|
32617
32618
|
const t = {}, r = e.slice(1, -1).trim(), o2 = r.match(/\.([a-zA-Z0-9_-]+)/g);
|
|
32618
32619
|
if (o2) {
|
|
32619
32620
|
const h = o2.map((p2) => p2.slice(1));
|
|
@@ -32628,7 +32629,7 @@ const T = () => {
|
|
|
32628
32629
|
p2 && d2 && p2 !== "class" && p2 !== "id" && (t[p2] = d2.replace(/["']/g, ""));
|
|
32629
32630
|
}
|
|
32630
32631
|
return t;
|
|
32631
|
-
},
|
|
32632
|
+
}, $t = (e) => {
|
|
32632
32633
|
const t = e.lang ? ` class="language-${e.lang}"` : "", r = e.value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
32633
32634
|
return `<pre><code${t}>${r}</code></pre>`;
|
|
32634
32635
|
}, F = (e, t) => {
|
|
@@ -32639,7 +32640,7 @@ const T = () => {
|
|
|
32639
32640
|
} else
|
|
32640
32641
|
e.data.hProperties[r] = o2;
|
|
32641
32642
|
});
|
|
32642
|
-
},
|
|
32643
|
+
}, St = () => (e) => {
|
|
32643
32644
|
visit(e, (t, r, o2) => {
|
|
32644
32645
|
if (t.type === "heading" && t.children?.length > 0) {
|
|
32645
32646
|
const n = t.children[t.children.length - 1];
|
|
@@ -32750,13 +32751,13 @@ const T = () => {
|
|
|
32750
32751
|
type: "html",
|
|
32751
32752
|
value: `<div class="${h.class || ""}" ${Object.entries(
|
|
32752
32753
|
h
|
|
32753
|
-
).filter(([d2]) => d2 !== "class").map(([d2, a]) => `${d2}="${a}"`).join(" ")}>${
|
|
32754
|
+
).filter(([d2]) => d2 !== "class").map(([d2, a]) => `${d2}="${a}"`).join(" ")}>${$t(t)}</div>`
|
|
32754
32755
|
};
|
|
32755
32756
|
o2 && typeof r == "number" && (o2.children[r] = p2), t.meta = t.meta.replace(n[0], "").trim() || null;
|
|
32756
32757
|
}
|
|
32757
32758
|
}
|
|
32758
32759
|
});
|
|
32759
|
-
},
|
|
32760
|
+
}, xt = () => (e) => {
|
|
32760
32761
|
visit(e, "element", (t) => {
|
|
32761
32762
|
if (t.tagName === "img") {
|
|
32762
32763
|
const r = Ys();
|
|
@@ -32765,7 +32766,7 @@ const T = () => {
|
|
|
32765
32766
|
t.properties.style = n;
|
|
32766
32767
|
}
|
|
32767
32768
|
});
|
|
32768
|
-
}, { html:
|
|
32769
|
+
}, { html: Ft } = Y$1, Ht = {
|
|
32769
32770
|
indent_size: 2,
|
|
32770
32771
|
indent_char: " ",
|
|
32771
32772
|
max_preserve_newlines: 2,
|
|
@@ -32777,7 +32778,7 @@ const T = () => {
|
|
|
32777
32778
|
unformatted: ["code", "pre", "textarea"],
|
|
32778
32779
|
content_unformatted: ["pre", "code", "textarea"],
|
|
32779
32780
|
extra_liners: []
|
|
32780
|
-
},
|
|
32781
|
+
}, Ct = (e) => {
|
|
32781
32782
|
const t = (r) => {
|
|
32782
32783
|
if (r instanceof Date)
|
|
32783
32784
|
return new Date(r.getTime());
|
|
@@ -32806,7 +32807,7 @@ const T = () => {
|
|
|
32806
32807
|
return r;
|
|
32807
32808
|
}
|
|
32808
32809
|
return e;
|
|
32809
|
-
},
|
|
32810
|
+
}, B = (e) => JSON.stringify(M(e ?? {})), U = (e) => e.type === "text" || e.type === "inlineCode" ? e.value || "" : e.children && Array.isArray(e.children) ? e.children.map(U).join("") : "", Ot = (e, t) => `${e}-${t.join("-")}`, It = (e) => {
|
|
32810
32811
|
const t = [], r = [];
|
|
32811
32812
|
for (const o2 of e) {
|
|
32812
32813
|
const n = o2.level;
|
|
@@ -32827,7 +32828,7 @@ const T = () => {
|
|
|
32827
32828
|
}, K = (e, t, r) => {
|
|
32828
32829
|
const o2 = jd(t);
|
|
32829
32830
|
return o2 !== void 0 ? `${e}-${o2}` : r();
|
|
32830
|
-
},
|
|
32831
|
+
}, Lt = (e) => {
|
|
32831
32832
|
const t = [], r = [];
|
|
32832
32833
|
for (const o2 of e) {
|
|
32833
32834
|
const n = {
|
|
@@ -32852,8 +32853,8 @@ const T = () => {
|
|
|
32852
32853
|
r.push(n);
|
|
32853
32854
|
}
|
|
32854
32855
|
return t;
|
|
32855
|
-
},
|
|
32856
|
-
const { plugins: t = [], logger: r =
|
|
32856
|
+
}, Vt = (e) => {
|
|
32857
|
+
const { plugins: t = [], logger: r = bt(), fetcher: o2 } = e, n = /* @__PURE__ */ new Map();
|
|
32857
32858
|
for (const a of t) {
|
|
32858
32859
|
if (n.has(a.name))
|
|
32859
32860
|
throw new Error(
|
|
@@ -32906,7 +32907,7 @@ const T = () => {
|
|
|
32906
32907
|
level: b2.depth,
|
|
32907
32908
|
text: U(b2)
|
|
32908
32909
|
}));
|
|
32909
|
-
w =
|
|
32910
|
+
w = It(v);
|
|
32910
32911
|
}
|
|
32911
32912
|
const g2 = [];
|
|
32912
32913
|
y.forEach((v, b2) => {
|
|
@@ -32934,7 +32935,7 @@ const T = () => {
|
|
|
32934
32935
|
});
|
|
32935
32936
|
} else if (i && b2 < w.length) {
|
|
32936
32937
|
const H2 = w[b2];
|
|
32937
|
-
H2 ? $2 =
|
|
32938
|
+
H2 ? $2 = Ot(
|
|
32938
32939
|
f,
|
|
32939
32940
|
H2.numbers
|
|
32940
32941
|
) : $2 = c(x2);
|
|
@@ -32946,7 +32947,7 @@ const T = () => {
|
|
|
32946
32947
|
id: $2
|
|
32947
32948
|
});
|
|
32948
32949
|
});
|
|
32949
|
-
const E2 =
|
|
32950
|
+
const E2 = Lt(m);
|
|
32950
32951
|
a.push(...E2);
|
|
32951
32952
|
};
|
|
32952
32953
|
return {
|
|
@@ -32959,49 +32960,49 @@ const T = () => {
|
|
|
32959
32960
|
} = {}) => {
|
|
32960
32961
|
const {
|
|
32961
32962
|
allowDangerousHtml: y = true,
|
|
32962
|
-
htmlOptions: w =
|
|
32963
|
+
htmlOptions: w = Ht,
|
|
32963
32964
|
gfmOptions: g2 = {},
|
|
32964
32965
|
remarkPlugins: E2 = [],
|
|
32965
32966
|
rehypePlugins: v = []
|
|
32966
32967
|
} = u || {};
|
|
32967
32968
|
try {
|
|
32968
|
-
const b2 = a, { data: x2, content: C2 } =
|
|
32969
|
+
const b2 = a, { data: x2, content: C2 } = gt(a);
|
|
32969
32970
|
let $2 = x2;
|
|
32970
|
-
const H2 =
|
|
32971
|
+
const H2 = B(x2);
|
|
32971
32972
|
let O2 = false;
|
|
32972
32973
|
if (m) {
|
|
32973
32974
|
const k2 = {
|
|
32974
|
-
originalFrontmatter:
|
|
32975
|
+
originalFrontmatter: Ct(x2),
|
|
32975
32976
|
markdownContent: C2
|
|
32976
|
-
},
|
|
32977
|
-
|
|
32977
|
+
}, R2 = m(k2);
|
|
32978
|
+
R2 !== void 0 && ($2 = R2, O2 = B(R2) !== H2);
|
|
32978
32979
|
}
|
|
32979
|
-
const
|
|
32980
|
+
const A = [];
|
|
32980
32981
|
let I2 = 0;
|
|
32981
|
-
const
|
|
32982
|
+
const P2 = () => `${c}-${++I2}`;
|
|
32982
32983
|
let L2 = unified().use(remarkParse);
|
|
32983
32984
|
if (E2)
|
|
32984
32985
|
for (const k2 of E2)
|
|
32985
32986
|
Array.isArray(k2) ? L2 = L2.use(k2[0], k2[1]) : L2 = L2.use(k2);
|
|
32986
|
-
let N2 = L2.use(remarkGfm, g2).use(
|
|
32987
|
+
let N2 = L2.use(remarkGfm, g2).use(St).use(
|
|
32987
32988
|
p2(
|
|
32988
|
-
|
|
32989
|
-
l2 ? (k2) => K(c, k2,
|
|
32989
|
+
A,
|
|
32990
|
+
l2 ? (k2) => K(c, k2, P2) : P2,
|
|
32990
32991
|
f,
|
|
32991
32992
|
l2,
|
|
32992
32993
|
c
|
|
32993
32994
|
)
|
|
32994
|
-
).use(h($2, i,
|
|
32995
|
+
).use(h($2, i, P2)).use(remarkRehype, { allowDangerousHtml: y }).use(xt).use(rehypeStringify, { allowDangerousHtml: y });
|
|
32995
32996
|
if (v)
|
|
32996
32997
|
for (const k2 of v)
|
|
32997
32998
|
Array.isArray(k2) ? N2 = N2.use(k2[0], k2[1]) : N2 = N2.use(k2);
|
|
32998
32999
|
const Z2 = await N2.process(C2), X2 = String(Z2);
|
|
32999
33000
|
return {
|
|
33000
|
-
html:
|
|
33001
|
+
html: Ft(X2, w),
|
|
33001
33002
|
frontmatter: $2,
|
|
33002
33003
|
changed: O2,
|
|
33003
|
-
headingTree:
|
|
33004
|
-
composeMarkdown: () => O2 ?
|
|
33004
|
+
headingTree: A,
|
|
33005
|
+
composeMarkdown: () => O2 ? vt($2, C2) : b2
|
|
33005
33006
|
};
|
|
33006
33007
|
} catch (b2) {
|
|
33007
33008
|
throw r.error(
|
|
@@ -33012,7 +33013,7 @@ const T = () => {
|
|
|
33012
33013
|
}
|
|
33013
33014
|
}
|
|
33014
33015
|
};
|
|
33015
|
-
},
|
|
33016
|
+
}, Qt = (e, t = {}) => {
|
|
33016
33017
|
const { maxRedirects: r = 5, timeoutEachRedirect: o2 = 1e4 } = t;
|
|
33017
33018
|
return {
|
|
33018
33019
|
name: "oembed",
|
|
@@ -33036,7 +33037,7 @@ const T = () => {
|
|
|
33036
33037
|
}
|
|
33037
33038
|
}
|
|
33038
33039
|
};
|
|
33039
|
-
},
|
|
33040
|
+
}, Zt = (e = {}) => ({
|
|
33040
33041
|
name: "card",
|
|
33041
33042
|
processBlock: async (r, o2) => {
|
|
33042
33043
|
const n = r.trim();
|
|
@@ -33051,7 +33052,7 @@ const T = () => {
|
|
|
33051
33052
|
return typeof window < "u" ? eh(n, h) : eh(n, h);
|
|
33052
33053
|
}
|
|
33053
33054
|
}
|
|
33054
|
-
}),
|
|
33055
|
+
}), Xt = (e = {}) => {
|
|
33055
33056
|
const { className: t = "mermaid", includeId: r = true } = e;
|
|
33056
33057
|
return {
|
|
33057
33058
|
name: "mermaid",
|
|
@@ -33102,7 +33103,7 @@ const W = () => {
|
|
|
33102
33103
|
}, G = {
|
|
33103
33104
|
release: W,
|
|
33104
33105
|
[Symbol.dispose]: W
|
|
33105
|
-
},
|
|
33106
|
+
}, Nt = (e, t) => {
|
|
33106
33107
|
if (!e)
|
|
33107
33108
|
return G;
|
|
33108
33109
|
if (e.aborted) {
|
|
@@ -33131,9 +33132,9 @@ const W = () => {
|
|
|
33131
33132
|
release: o2,
|
|
33132
33133
|
[Symbol.dispose]: o2
|
|
33133
33134
|
};
|
|
33134
|
-
},
|
|
33135
|
+
}, Tt = (e) => {
|
|
33135
33136
|
typeof setImmediate == "function" ? setImmediate(e) : setTimeout(e, 0);
|
|
33136
|
-
}, j = () => new Error("Lock acquisition was aborted"),
|
|
33137
|
+
}, j = () => new Error("Lock acquisition was aborted"), _t = (e) => {
|
|
33137
33138
|
let t = true;
|
|
33138
33139
|
const r = () => {
|
|
33139
33140
|
t && (t = false, e());
|
|
@@ -33159,10 +33160,10 @@ const W = () => {
|
|
|
33159
33160
|
return;
|
|
33160
33161
|
}
|
|
33161
33162
|
t = true;
|
|
33162
|
-
const l2 =
|
|
33163
|
+
const l2 = _t(h);
|
|
33163
33164
|
i.resolve(l2);
|
|
33164
33165
|
}, s2 = () => {
|
|
33165
|
-
o2++, o2 >= e ? (o2 = 0,
|
|
33166
|
+
o2++, o2 >= e ? (o2 = 0, Tt(n)) : n();
|
|
33166
33167
|
}, h = () => {
|
|
33167
33168
|
t && (t = false, s2());
|
|
33168
33169
|
}, p2 = (c) => {
|
|
@@ -33177,7 +33178,7 @@ const W = () => {
|
|
|
33177
33178
|
resolve: void 0,
|
|
33178
33179
|
reject: void 0,
|
|
33179
33180
|
signal: c
|
|
33180
|
-
}, u =
|
|
33181
|
+
}, u = Nt(c, () => {
|
|
33181
33182
|
p2(f), l2(j());
|
|
33182
33183
|
});
|
|
33183
33184
|
f.resolve = (m) => {
|
|
@@ -33206,7 +33207,7 @@ const W = () => {
|
|
|
33206
33207
|
return r.length;
|
|
33207
33208
|
}
|
|
33208
33209
|
};
|
|
33209
|
-
},
|
|
33210
|
+
}, At = () => {
|
|
33210
33211
|
const e = /* @__PURE__ */ new Map(), t = q(), r = (d2 = Date.now()) => {
|
|
33211
33212
|
const a = [];
|
|
33212
33213
|
for (const [c, i] of e.entries())
|
|
@@ -33279,7 +33280,7 @@ const W = () => {
|
|
|
33279
33280
|
function D(e, t, r) {
|
|
33280
33281
|
return `fetch:${e}:${t}:${r}`;
|
|
33281
33282
|
}
|
|
33282
|
-
const
|
|
33283
|
+
const ee = (e, t = 6e4, r, o2) => {
|
|
33283
33284
|
const {
|
|
33284
33285
|
cache: n = true,
|
|
33285
33286
|
cacheTTL: s2 = 3600 * 1e3,
|
|
@@ -33287,7 +33288,7 @@ const te = (e, t = 6e4, r, o2) => {
|
|
|
33287
33288
|
cacheFailures: h = true,
|
|
33288
33289
|
failureCacheTTL: p2 = 300 * 1e3
|
|
33289
33290
|
// 5 minutes default for failures
|
|
33290
|
-
} = {}, d2 = n ? r ||
|
|
33291
|
+
} = {}, d2 = n ? r || At() : void 0;
|
|
33291
33292
|
return {
|
|
33292
33293
|
rawFetcher: async (c, i, l2, f) => {
|
|
33293
33294
|
if (n && d2) {
|
|
@@ -33379,23 +33380,23 @@ const te = (e, t = 6e4, r, o2) => {
|
|
|
33379
33380
|
};
|
|
33380
33381
|
function setupProcessor(config) {
|
|
33381
33382
|
const plugins = [];
|
|
33382
|
-
const logger =
|
|
33383
|
-
const fetcher =
|
|
33383
|
+
const logger = Gt();
|
|
33384
|
+
const fetcher = ee(
|
|
33384
33385
|
"mark-deco-cli/0.0.1",
|
|
33385
33386
|
5e3,
|
|
33386
|
-
|
|
33387
|
+
At()
|
|
33387
33388
|
);
|
|
33388
33389
|
const enabledPlugins = config.noPlugins ? [] : Array.isArray(config.plugins) ? config.plugins : ["oembed", "card", "mermaid"];
|
|
33389
33390
|
if (enabledPlugins.includes("oembed") && config.oembed?.enabled !== false) {
|
|
33390
|
-
plugins.push(
|
|
33391
|
+
plugins.push(Qt($d, {}));
|
|
33391
33392
|
}
|
|
33392
33393
|
if (enabledPlugins.includes("card") && config.card?.enabled !== false) {
|
|
33393
|
-
plugins.push(
|
|
33394
|
+
plugins.push(Zt({}));
|
|
33394
33395
|
}
|
|
33395
33396
|
if (enabledPlugins.includes("mermaid") && config.mermaid?.enabled !== false) {
|
|
33396
|
-
plugins.push(
|
|
33397
|
+
plugins.push(Xt({}));
|
|
33397
33398
|
}
|
|
33398
|
-
return
|
|
33399
|
+
return Vt({
|
|
33399
33400
|
plugins,
|
|
33400
33401
|
logger,
|
|
33401
33402
|
fetcher
|