@coderminer/vue-markdown 1.0.0 → 1.0.1
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/CHANGELOG.md +116 -0
- package/README.md +7 -2
- package/README.zh-CN.md +6 -3
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +0 -2
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +0 -2
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +0 -2
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +0 -2
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +0 -2
- package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +0 -2
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +0 -2
- package/dist/chunks/MarkdownError-C0sPs5W0.js +0 -2
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +0 -2
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +0 -2
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +0 -2
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +0 -2
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +0 -2
- package/dist/chunks/MarkdownImage-BRy76svs.js +0 -2
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +0 -2
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +0 -2
- package/dist/chunks/MarkdownList-BJ-_C71k.js +0 -2
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +0 -2
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +0 -2
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +0 -2
- package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +0 -2
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +0 -2
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +0 -2
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +0 -2
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +0 -2
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +0 -2
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +0 -2
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +0 -2
- package/dist/chunks/{MarkdownToc-BdOHF-Yo.js → MarkdownToc-DHWWoH6t.js} +1 -3
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +0 -2
- package/dist/chunks/{MermaidLiveEditor-W-qf3G-5.js → MermaidLiveEditor-1TKkI5bp.js} +1 -3
- package/dist/chunks/{VueSyntaxHighlighter-DyLsYMwy.js → VueSyntaxHighlighter-BWpCO-cX.js} +1 -3
- package/dist/chunks/adapters-CMwX_NEI.js +0 -2
- package/dist/chunks/{blank-line-Cb-JBP_5.js → blank-line-CKKsFeKR.js} +1 -3
- package/dist/chunks/codemirror-DyphMAEg.js +0 -2
- package/dist/chunks/config-aRYo2R8_.js +0 -2
- package/dist/chunks/context-8NfW6fxI.js +0 -2
- package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
- package/dist/chunks/default-ZQ5aHh-N.js +3 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +0 -2
- package/dist/chunks/{export-DZQ3cUry.js → export-BrgMLgUp.js} +13 -14
- package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
- package/dist/chunks/{lib-BQiWGWpu.js → hast-util-from-html-D3e_iQ89.js} +495 -494
- package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
- package/dist/chunks/{identity-jZEhX2d5.js → identity-Bi27FKyx.js} +7 -8
- package/dist/chunks/labels-BtHiUTQI.js +0 -2
- package/dist/chunks/lib-CCnkLL6S.js +252 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +0 -2
- package/dist/chunks/{micromark-factory-space-Db040TnW.js → micromark-factory-space-CpXAnYUY.js} +2 -4
- package/dist/chunks/{normalize-CRYv3Wqt.js → normalize-VKfQXZiK.js} +57 -51
- package/dist/chunks/{plugin-DqkFHyny.js → plugin-YWo5uqTh.js} +1 -2
- package/dist/chunks/preset-BjaOuJUL.js +0 -2
- package/dist/chunks/{registry-DLjr93-V.js → registry-B7BfEkuy.js} +1051 -1045
- package/dist/chunks/{render-Cs8iKrgz.js → render-DAqK0w5J.js} +524 -494
- package/dist/chunks/{default-DWVS-I_8.js → rolldown-runtime-QGRDbDUS.js} +1 -5
- package/dist/chunks/{runtime-DJMnzjah.js → runtime-D95F41zG.js} +145 -117
- package/dist/chunks/security-y4EwUyAs.js +0 -2
- package/dist/chunks/{shared-DNAvZ-UY.js → shared-NjFDPmkb.js} +18 -27
- package/dist/chunks/{space-separated-tokens-CmBjEPdR.js → space-separated-tokens-1ebNqf35.js} +1 -3
- package/dist/chunks/url-D2BoivaE.js +0 -2
- package/dist/chunks/{useActiveHeading-BaGVMJnB.js → useActiveHeading-CnyGTG1u.js} +165 -122
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/MarkdownCustomTag.js +1 -1
- package/dist/components/MarkdownMath.js +1 -1
- package/dist/components/MarkdownMermaid.d.ts +3 -3
- package/dist/components/MarkdownMermaid.js +1 -1
- package/dist/components/MarkdownRenderer.d.ts +16 -19
- package/dist/components/MarkdownRenderer.js +1 -1
- package/dist/components/MarkdownToc.js +1 -1
- package/dist/components/MermaidBlock.js +1 -1
- package/dist/components/MermaidLiveEditor.js +1 -1
- package/dist/components/VueSyntaxHighlighter.js +1 -1
- package/dist/components/context.d.ts +2 -2
- package/dist/components/index.js +6 -6
- package/dist/components/types.d.ts +34 -2
- package/dist/composables/useMarkdownDocument.d.ts +2 -0
- package/dist/core/hast-nodes.d.ts +0 -3
- package/dist/core/hast-to-nodes.d.ts +9 -0
- package/dist/core/normalize.d.ts +10 -0
- package/dist/core/parts.d.ts +1 -0
- package/dist/core/slugger.d.ts +7 -0
- package/dist/core/types.d.ts +3 -1
- package/dist/headless.js +8 -8
- package/dist/highlight/convert-hast.d.ts +8 -0
- package/dist/highlight/index.d.ts +2 -1
- package/dist/highlight/index.js +4 -3
- package/dist/highlight/shared.d.ts +0 -5
- package/dist/highlight/shiki.js +2 -3
- package/dist/html/index.js +0 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +47 -49
- package/dist/math/index.js +18 -16
- package/dist/mermaid/index.d.ts +2 -1
- package/dist/mermaid/index.js +8 -3
- package/dist/mermaid/plugin.d.ts +3 -0
- package/dist/mermaid/runtime.d.ts +3 -1
- package/dist/mermaid/sanitize-svg-lazy.d.ts +10 -0
- package/dist/mermaid/sanitize-svg.d.ts +3 -0
- package/dist/mermaid/sanitize.d.ts +6 -2
- package/dist/node-components.js +6 -6
- package/dist/pipeline.js +1 -1
- package/dist/plugins.js +1 -1
- package/dist/styles/components.css +25 -0
- package/package.json +6 -3
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js.map +0 -1
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js.map +0 -1
- package/dist/chunks/MarkdownCode-B1k9tmW5.js.map +0 -1
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js.map +0 -1
- package/dist/chunks/MarkdownContent-BAK6dqo7.js.map +0 -1
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js +0 -42
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js.map +0 -1
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js.map +0 -1
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js.map +0 -1
- package/dist/chunks/MarkdownError-C0sPs5W0.js.map +0 -1
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js.map +0 -1
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js.map +0 -1
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js.map +0 -1
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js.map +0 -1
- package/dist/chunks/MarkdownHtml-66lYkvwM.js.map +0 -1
- package/dist/chunks/MarkdownImage-BRy76svs.js.map +0 -1
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js.map +0 -1
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js.map +0 -1
- package/dist/chunks/MarkdownList-BJ-_C71k.js.map +0 -1
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js.map +0 -1
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js.map +0 -1
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js.map +0 -1
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js +0 -416
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js.map +0 -1
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js.map +0 -1
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js.map +0 -1
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js.map +0 -1
- package/dist/chunks/MarkdownTable-DmBTg_CR.js.map +0 -1
- package/dist/chunks/MarkdownTableCell-eiCJe847.js.map +0 -1
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js.map +0 -1
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js.map +0 -1
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js.map +0 -1
- package/dist/chunks/MarkdownToc-BdOHF-Yo.js.map +0 -1
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js.map +0 -1
- package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js.map +0 -1
- package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js.map +0 -1
- package/dist/chunks/adapters-CMwX_NEI.js.map +0 -1
- package/dist/chunks/blank-line-Cb-JBP_5.js.map +0 -1
- package/dist/chunks/codemirror-DyphMAEg.js.map +0 -1
- package/dist/chunks/config-aRYo2R8_.js.map +0 -1
- package/dist/chunks/context-8NfW6fxI.js.map +0 -1
- package/dist/chunks/default-DWVS-I_8.js.map +0 -1
- package/dist/chunks/diagnostics-CtHoJyiX.js.map +0 -1
- package/dist/chunks/export-DZQ3cUry.js.map +0 -1
- package/dist/chunks/hast-nodes-C0bX3M5Z.js +0 -35
- package/dist/chunks/hast-nodes-C0bX3M5Z.js.map +0 -1
- package/dist/chunks/highlightjs-BEh-YwEG.js +0 -6041
- package/dist/chunks/highlightjs-BEh-YwEG.js.map +0 -1
- package/dist/chunks/identity-jZEhX2d5.js.map +0 -1
- package/dist/chunks/labels-BtHiUTQI.js.map +0 -1
- package/dist/chunks/lib-BQiWGWpu.js.map +0 -1
- package/dist/chunks/lib-LwqA_W3J.js +0 -127
- package/dist/chunks/lib-LwqA_W3J.js.map +0 -1
- package/dist/chunks/longest-streak-DZE_EqsU.js.map +0 -1
- package/dist/chunks/micromark-factory-space-Db040TnW.js.map +0 -1
- package/dist/chunks/normalize-CRYv3Wqt.js.map +0 -1
- package/dist/chunks/plugin-DqkFHyny.js.map +0 -1
- package/dist/chunks/preset-BjaOuJUL.js.map +0 -1
- package/dist/chunks/registry-DLjr93-V.js.map +0 -1
- package/dist/chunks/render-Cs8iKrgz.js.map +0 -1
- package/dist/chunks/runtime-DJMnzjah.js.map +0 -1
- package/dist/chunks/security-y4EwUyAs.js.map +0 -1
- package/dist/chunks/shared-DNAvZ-UY.js.map +0 -1
- package/dist/chunks/space-separated-tokens-CmBjEPdR.js.map +0 -1
- package/dist/chunks/url-D2BoivaE.js.map +0 -1
- package/dist/chunks/useActiveHeading-BaGVMJnB.js.map +0 -1
- package/dist/highlight/shiki.js.map +0 -1
- package/dist/html/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/math/index.js.map +0 -1
|
@@ -23,37 +23,45 @@ function l(e) {
|
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
25
25
|
function u(e) {
|
|
26
|
+
return e.replace(/-+([a-z0-9])/g, (e, t) => t.toUpperCase());
|
|
27
|
+
}
|
|
28
|
+
function d(e) {
|
|
29
|
+
let t = {};
|
|
30
|
+
for (let n of Object.keys(e)) n.startsWith("data-") || n.startsWith("aria-") ? t[n] = e[n] : t[u(n)] = e[n];
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
function f(e) {
|
|
26
34
|
var t;
|
|
27
35
|
let n = (t = e.properties) == null ? void 0 : t.className;
|
|
28
36
|
return Array.isArray(n) ? n.map(String) : typeof n == "string" ? n.split(/\s+/) : [];
|
|
29
37
|
}
|
|
30
|
-
function
|
|
38
|
+
function p(e) {
|
|
31
39
|
var t, n;
|
|
32
|
-
let r =
|
|
40
|
+
let r = f(e);
|
|
33
41
|
if (!(e.tagName === "vmd-math" || r.includes("language-math") && r.some((e) => e.startsWith("math-")))) return;
|
|
34
|
-
let i = ((t = e.properties) == null ? void 0 : t["data-display"]) === "true" || r.includes("math-display"), a = (n = e.properties) == null ? void 0 : n["data-tex"], o =
|
|
42
|
+
let i = ((t = e.properties) == null ? void 0 : t["data-display"]) === "true" || r.includes("math-display"), a = (n = e.properties) == null ? void 0 : n["data-tex"], o = m(e), s = typeof a == "string" ? a : o ? o.children.map((e) => e.type === "text" ? e.value : "").join("") : "", c = (o == null ? e : o).children, l = c.find((e) => e.type === "element");
|
|
35
43
|
return ((l == null ? void 0 : l.tagName) === "pre" || (l == null ? void 0 : l.tagName) === "code") && (c = l.children), {
|
|
36
44
|
tex: s,
|
|
37
45
|
displayMode: i,
|
|
38
46
|
rendered: c
|
|
39
47
|
};
|
|
40
48
|
}
|
|
41
|
-
function
|
|
49
|
+
function m(e) {
|
|
42
50
|
for (let t of e.children) if (t.type === "element") {
|
|
43
|
-
if (t.tagName === "code" &&
|
|
51
|
+
if (t.tagName === "code" && f(t).includes("language-math")) return t;
|
|
44
52
|
if (t.tagName === "pre") {
|
|
45
|
-
let e =
|
|
53
|
+
let e = m(t);
|
|
46
54
|
if (e) return e;
|
|
47
55
|
}
|
|
48
56
|
}
|
|
49
57
|
}
|
|
50
|
-
function
|
|
58
|
+
function h(e) {
|
|
51
59
|
var t;
|
|
52
60
|
if (e.tagName !== "pre") return !1;
|
|
53
61
|
let n = e.children.filter((e) => e.type !== "text" || e.value.trim() !== "");
|
|
54
62
|
return n.length === 1 && ((t = n[0]) == null ? void 0 : t.type) === "element" && n[0].tagName === "code";
|
|
55
63
|
}
|
|
56
|
-
function
|
|
64
|
+
function g(e) {
|
|
57
65
|
let t = e.children.find((e) => e.type === "element" && e.tagName === "code"), n = [...Array.isArray(e.properties.className) ? e.properties.className.map(String) : [], ...Array.isArray(t == null ? void 0 : t.properties.className) ? t.properties.className.map(String) : []];
|
|
58
66
|
for (let e of n) {
|
|
59
67
|
let t = /^(?:language|lang)-(.+)$/u.exec(e);
|
|
@@ -61,17 +69,17 @@ function m(e) {
|
|
|
61
69
|
}
|
|
62
70
|
return "";
|
|
63
71
|
}
|
|
64
|
-
function
|
|
72
|
+
function _(e, t, n) {
|
|
65
73
|
let r = e.children.find((e) => e.type === "element" && e.tagName === "code");
|
|
66
74
|
return {
|
|
67
75
|
kind: "code",
|
|
68
76
|
key: t,
|
|
69
77
|
code: r ? r.children.map((e) => e.type === "text" ? e.value : "").join("") : e.children.map((e) => e.type === "text" ? e.value : "").join(""),
|
|
70
|
-
language:
|
|
78
|
+
language: g(e),
|
|
71
79
|
source: n
|
|
72
80
|
};
|
|
73
81
|
}
|
|
74
|
-
function
|
|
82
|
+
function v(n, r, i, a) {
|
|
75
83
|
let { allowedElements: o, disallowedElements: s, unwrapDisallowed: c, allowElement: l, diagnostics: u } = a.options, d = !1;
|
|
76
84
|
if (o && o.length > 0 ? (s && s.length > 0 && !a.conflictReported && (a.conflictReported = !0, u == null || u.push(t("filter-conflict", "`allowedElements` and `disallowedElements` were both provided; `allowedElements` wins.", {
|
|
77
85
|
severity: "warning",
|
|
@@ -83,7 +91,7 @@ function g(n, r, i, a) {
|
|
|
83
91
|
}
|
|
84
92
|
return d ? c ? "unwrap" : "drop" : "keep";
|
|
85
93
|
}
|
|
86
|
-
function
|
|
94
|
+
function y(a, o, s, c, l) {
|
|
87
95
|
let u = n(a, l.options.baseUrl), d = l.options.urlTransform, f = (e) => {
|
|
88
96
|
if (o === "srcset") return i(e, "srcset");
|
|
89
97
|
let t = r(e, o);
|
|
@@ -104,55 +112,55 @@ function _(a, o, s, c, l) {
|
|
|
104
112
|
return f(u);
|
|
105
113
|
}
|
|
106
114
|
}
|
|
107
|
-
function
|
|
115
|
+
function b(e, t, n, r, i, u = !1) {
|
|
108
116
|
if (o.has(e.tagName) && !(u && e.tagName === "math")) return null;
|
|
109
|
-
let
|
|
110
|
-
if (
|
|
117
|
+
let d = c(e), f = a(e.tagName, e.properties), m = p(e);
|
|
118
|
+
if (m) {
|
|
111
119
|
let a = {
|
|
112
120
|
kind: "element",
|
|
113
121
|
key: t,
|
|
114
122
|
tag: e.tagName,
|
|
115
|
-
attrs:
|
|
123
|
+
attrs: f,
|
|
116
124
|
children: [],
|
|
117
|
-
source:
|
|
125
|
+
source: d
|
|
118
126
|
};
|
|
119
|
-
return
|
|
127
|
+
return v(a, n, r, i) === "keep" ? {
|
|
120
128
|
kind: "math",
|
|
121
129
|
key: t,
|
|
122
|
-
tex:
|
|
123
|
-
displayMode:
|
|
124
|
-
rendered:
|
|
125
|
-
source:
|
|
130
|
+
tex: m.tex,
|
|
131
|
+
displayMode: m.displayMode,
|
|
132
|
+
rendered: x(m.rendered, t, a, i, !0),
|
|
133
|
+
source: d
|
|
126
134
|
} : null;
|
|
127
135
|
}
|
|
128
|
-
let
|
|
136
|
+
let g = {
|
|
129
137
|
kind: "element",
|
|
130
138
|
key: t,
|
|
131
139
|
tag: e.tagName,
|
|
132
|
-
attrs:
|
|
140
|
+
attrs: f,
|
|
133
141
|
children: [],
|
|
134
|
-
source:
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
let S = g
|
|
142
|
+
source: d
|
|
143
|
+
}, b = x(e.children, t, g, i, u);
|
|
144
|
+
g.children = b;
|
|
145
|
+
let S = v(g, n, r, i);
|
|
138
146
|
if (S === "drop") return null;
|
|
139
|
-
if (S === "unwrap") return
|
|
140
|
-
if (
|
|
141
|
-
for (let t of Object.keys(
|
|
147
|
+
if (S === "unwrap") return b;
|
|
148
|
+
if (h(e)) return _(e, t, d);
|
|
149
|
+
for (let t of Object.keys(f)) {
|
|
142
150
|
if (!s.has(t)) continue;
|
|
143
|
-
let n =
|
|
144
|
-
n === void 0 ? delete
|
|
151
|
+
let n = y(f[t], t, e.tagName, f, i);
|
|
152
|
+
n === void 0 ? delete f[t] : f[t] = n;
|
|
145
153
|
}
|
|
146
|
-
if (e.tagName === "a" &&
|
|
147
|
-
let e = l(
|
|
154
|
+
if (e.tagName === "a" && f.target === "_blank" && !f.rel && (f.rel = "noopener noreferrer"), /^h[1-6]$/.test(e.tagName) && !f.id) {
|
|
155
|
+
let e = l(b);
|
|
148
156
|
if (e.trim()) {
|
|
149
157
|
var C;
|
|
150
|
-
|
|
158
|
+
f.id = `${(C = i.options.idPrefix) == null ? "" : C}${i.options.slugger.slug(e)}`;
|
|
151
159
|
}
|
|
152
160
|
}
|
|
153
|
-
return
|
|
161
|
+
return g;
|
|
154
162
|
}
|
|
155
|
-
function
|
|
163
|
+
function x(e, t, n, r, i = !1) {
|
|
156
164
|
let a = [];
|
|
157
165
|
return e.forEach((e, o) => {
|
|
158
166
|
let s = t ? `${t}.${o}` : String(o);
|
|
@@ -167,28 +175,28 @@ function y(e, t, n, r, i = !1) {
|
|
|
167
175
|
return;
|
|
168
176
|
}
|
|
169
177
|
if (e.type === "raw" || e.type !== "element") return;
|
|
170
|
-
let l =
|
|
178
|
+
let l = b(e, s, o, n, r, i);
|
|
171
179
|
l !== null && (Array.isArray(l) ? a.push(...l) : a.push(l));
|
|
172
180
|
}), a;
|
|
173
181
|
}
|
|
174
|
-
function
|
|
182
|
+
function S(e, t) {
|
|
175
183
|
let n = {
|
|
176
184
|
options: t,
|
|
177
185
|
conflictReported: !1,
|
|
178
186
|
urlErrorReported: !1
|
|
179
|
-
}, r =
|
|
187
|
+
}, r = x(e.children, "", void 0, n);
|
|
180
188
|
return {
|
|
181
189
|
nodes: r,
|
|
182
|
-
toc:
|
|
183
|
-
customTags:
|
|
190
|
+
toc: w(r),
|
|
191
|
+
customTags: T(r)
|
|
184
192
|
};
|
|
185
193
|
}
|
|
186
|
-
function
|
|
194
|
+
function C(e, t) {
|
|
187
195
|
if (t === void 0 || !Number.isFinite(t) || t <= 0 || t >= 6) return [...e];
|
|
188
196
|
let n = Math.min(6, Math.max(1, Math.floor(t)));
|
|
189
197
|
return e.filter((e) => e.level <= n);
|
|
190
198
|
}
|
|
191
|
-
function
|
|
199
|
+
function w(e) {
|
|
192
200
|
let t = [], n = (e) => {
|
|
193
201
|
for (let r of e) if (r.kind === "element") {
|
|
194
202
|
let e = /^h([1-6])$/.exec(r.tag);
|
|
@@ -201,7 +209,7 @@ function S(e) {
|
|
|
201
209
|
};
|
|
202
210
|
return n(e), t;
|
|
203
211
|
}
|
|
204
|
-
function
|
|
212
|
+
function T(e) {
|
|
205
213
|
let t = [], n = (e) => {
|
|
206
214
|
for (let r of e) r.kind === "custom" ? (t.push({
|
|
207
215
|
key: r.key,
|
|
@@ -212,9 +220,7 @@ function C(e) {
|
|
|
212
220
|
};
|
|
213
221
|
return n(e), t;
|
|
214
222
|
}
|
|
215
|
-
function
|
|
216
|
-
for (let r of e) t(r, n), "children" in r && Array.isArray(r.children) &&
|
|
223
|
+
function E(e, t, n) {
|
|
224
|
+
for (let r of e) t(r, n), "children" in r && Array.isArray(r.children) && E(r.children, t, r);
|
|
217
225
|
}
|
|
218
|
-
export {
|
|
219
|
-
|
|
220
|
-
//# sourceMappingURL=normalize-CRYv3Wqt.js.map
|
|
226
|
+
export { S as a, d as i, w as n, E as o, C as r, T as t };
|
|
@@ -15,6 +15,7 @@ function r(t, n, i) {
|
|
|
15
15
|
} : "children" in t && Array.isArray(t.children) ? e(e({}, t), {}, { children: r(t.children, n, i) }) : t);
|
|
16
16
|
}
|
|
17
17
|
function i(t = {}) {
|
|
18
|
+
if (!t || typeof t != "object" || Array.isArray(t)) throw TypeError("`mermaidPlugin` expects an options object such as `{ languages: [\"mermaid\"] }`. It does not accept renderer or theme arguments; configure those on `MarkdownRenderer`.");
|
|
18
19
|
let i = n(t.languages);
|
|
19
20
|
return {
|
|
20
21
|
name: "mermaid",
|
|
@@ -24,5 +25,3 @@ function i(t = {}) {
|
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
export { i as t };
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=plugin-DqkFHyny.js.map
|