@coderminer/vue-markdown 0.0.0-stage → 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 +226 -0
- package/LICENSE +21 -0
- package/README.md +584 -3
- package/README.zh-CN.md +550 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +16 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +16 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +63 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +49 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +13 -0
- package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +16 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +14 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js +17 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +22 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +21 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +29 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +16 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +13 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js +51 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +16 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +45 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js +20 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +16 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +15 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +16 -0
- package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +23 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +16 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +16 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +16 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +31 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +16 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +24 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +38 -0
- package/dist/chunks/MarkdownToc-DHWWoH6t.js +49 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +25 -0
- package/dist/chunks/MermaidLiveEditor-1TKkI5bp.js +414 -0
- package/dist/chunks/VueSyntaxHighlighter-BWpCO-cX.js +260 -0
- package/dist/chunks/adapters-CMwX_NEI.js +26 -0
- package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
- package/dist/chunks/blank-line-CKKsFeKR.js +88 -0
- package/dist/chunks/codemirror-DyphMAEg.js +82 -0
- package/dist/chunks/config-aRYo2R8_.js +10 -0
- package/dist/chunks/context-8NfW6fxI.js +30 -0
- package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
- package/dist/chunks/default-ZQ5aHh-N.js +3 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +23 -0
- package/dist/chunks/export-BrgMLgUp.js +1574 -0
- package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
- package/dist/chunks/hast-util-from-html-D3e_iQ89.js +5088 -0
- package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
- package/dist/chunks/identity-Bi27FKyx.js +6243 -0
- package/dist/chunks/labels-BtHiUTQI.js +47 -0
- package/dist/chunks/lib-CCnkLL6S.js +252 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +8 -0
- package/dist/chunks/micromark-factory-space-CpXAnYUY.js +137 -0
- package/dist/chunks/normalize-VKfQXZiK.js +226 -0
- package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
- package/dist/chunks/plugin-YWo5uqTh.js +27 -0
- package/dist/chunks/preset-BjaOuJUL.js +44 -0
- package/dist/chunks/registry-B7BfEkuy.js +6150 -0
- package/dist/chunks/render-DAqK0w5J.js +1754 -0
- package/dist/chunks/rolldown-runtime-QGRDbDUS.js +19 -0
- package/dist/chunks/runtime-D95F41zG.js +574 -0
- package/dist/chunks/security-y4EwUyAs.js +212 -0
- package/dist/chunks/shared-NjFDPmkb.js +67 -0
- package/dist/chunks/space-separated-tokens-1ebNqf35.js +1097 -0
- package/dist/chunks/url-D2BoivaE.js +24 -0
- package/dist/chunks/useActiveHeading-CnyGTG1u.js +359 -0
- package/dist/components/CodeBlock.d.ts +73 -0
- package/dist/components/CodeBlock.js +1 -0
- package/dist/components/Icon.d.ts +6 -0
- package/dist/components/MarkdownBlockquote.d.ts +18 -0
- package/dist/components/MarkdownBlockquote.js +1 -0
- package/dist/components/MarkdownBreak.d.ts +8 -0
- package/dist/components/MarkdownBreak.js +1 -0
- package/dist/components/MarkdownChildren.d.ts +17 -0
- package/dist/components/MarkdownCode.d.ts +29 -0
- package/dist/components/MarkdownCode.js +1 -0
- package/dist/components/MarkdownConfigProvider.d.ts +33 -0
- package/dist/components/MarkdownConfigProvider.js +1 -0
- package/dist/components/MarkdownContent.d.ts +16 -0
- package/dist/components/MarkdownContent.js +1 -0
- package/dist/components/MarkdownCustomTag.d.ts +20 -0
- package/dist/components/MarkdownCustomTag.js +1 -0
- package/dist/components/MarkdownEmphasis.d.ts +18 -0
- package/dist/components/MarkdownEmphasis.js +1 -0
- package/dist/components/MarkdownEmpty.d.ts +8 -0
- package/dist/components/MarkdownEmpty.js +1 -0
- package/dist/components/MarkdownError.d.ts +11 -0
- package/dist/components/MarkdownError.js +1 -0
- package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
- package/dist/components/MarkdownFootnoteReference.js +1 -0
- package/dist/components/MarkdownFootnotes.d.ts +17 -0
- package/dist/components/MarkdownFootnotes.js +1 -0
- package/dist/components/MarkdownHeading.d.ts +18 -0
- package/dist/components/MarkdownHeading.js +1 -0
- package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
- package/dist/components/MarkdownHorizontalRule.js +1 -0
- package/dist/components/MarkdownHtml.d.ts +8 -0
- package/dist/components/MarkdownHtml.js +1 -0
- package/dist/components/MarkdownImage.d.ts +15 -0
- package/dist/components/MarkdownImage.js +1 -0
- package/dist/components/MarkdownInlineCode.d.ts +18 -0
- package/dist/components/MarkdownInlineCode.js +1 -0
- package/dist/components/MarkdownLink.d.ts +22 -0
- package/dist/components/MarkdownLink.js +1 -0
- package/dist/components/MarkdownList.d.ts +18 -0
- package/dist/components/MarkdownList.js +1 -0
- package/dist/components/MarkdownListItem.d.ts +18 -0
- package/dist/components/MarkdownListItem.js +1 -0
- package/dist/components/MarkdownLoading.d.ts +8 -0
- package/dist/components/MarkdownLoading.js +1 -0
- package/dist/components/MarkdownMath.d.ts +12 -0
- package/dist/components/MarkdownMath.js +1 -0
- package/dist/components/MarkdownMermaid.d.ts +78 -0
- package/dist/components/MarkdownMermaid.js +1 -0
- package/dist/components/MarkdownParagraph.d.ts +18 -0
- package/dist/components/MarkdownParagraph.js +1 -0
- package/dist/components/MarkdownRenderer.d.ts +167 -0
- package/dist/components/MarkdownRenderer.js +1 -0
- package/dist/components/MarkdownRoot.d.ts +24 -0
- package/dist/components/MarkdownRoot.js +1 -0
- package/dist/components/MarkdownStrikethrough.d.ts +18 -0
- package/dist/components/MarkdownStrikethrough.js +1 -0
- package/dist/components/MarkdownStrong.d.ts +18 -0
- package/dist/components/MarkdownStrong.js +1 -0
- package/dist/components/MarkdownTable.d.ts +18 -0
- package/dist/components/MarkdownTable.js +1 -0
- package/dist/components/MarkdownTableCell.d.ts +20 -0
- package/dist/components/MarkdownTableCell.js +1 -0
- package/dist/components/MarkdownTableRow.d.ts +18 -0
- package/dist/components/MarkdownTableRow.js +1 -0
- package/dist/components/MarkdownTableSection.d.ts +18 -0
- package/dist/components/MarkdownTableSection.js +1 -0
- package/dist/components/MarkdownTaskItem.d.ts +20 -0
- package/dist/components/MarkdownTaskItem.js +1 -0
- package/dist/components/MarkdownToc.d.ts +36 -0
- package/dist/components/MarkdownToc.js +1 -0
- package/dist/components/MarkdownTocItem.d.ts +14 -0
- package/dist/components/MarkdownTocItem.js +1 -0
- package/dist/components/MermaidBlock.d.ts +50 -0
- package/dist/components/MermaidBlock.js +1 -0
- package/dist/components/MermaidLiveEditor.d.ts +44 -0
- package/dist/components/MermaidLiveEditor.js +1 -0
- package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
- package/dist/components/VueSyntaxHighlighter.js +1 -0
- package/dist/components/codeRegion.d.ts +14 -0
- package/dist/components/config.d.ts +7 -0
- package/dist/components/context.d.ts +45 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.js +38 -0
- package/dist/components/render.d.ts +9 -0
- package/dist/components/scroll-lock.d.ts +7 -0
- package/dist/components/types.d.ts +61 -0
- package/dist/composables/useActiveHeading.d.ts +12 -0
- package/dist/composables/useCodeHighlighter.d.ts +30 -0
- package/dist/composables/useLineWindow.d.ts +38 -0
- package/dist/composables/useMarkdownDocument.d.ts +25 -0
- package/dist/core/adapters.d.ts +7 -0
- package/dist/core/config.d.ts +5 -0
- package/dist/core/diagnostics.d.ts +9 -0
- package/dist/core/finalize.d.ts +18 -0
- package/dist/core/hast-nodes.d.ts +3 -0
- package/dist/core/hast-to-nodes.d.ts +9 -0
- package/dist/core/highlight-lines.d.ts +8 -0
- package/dist/core/identity.d.ts +4 -0
- package/dist/core/labels.d.ts +4 -0
- package/dist/core/manifest.d.ts +38 -0
- package/dist/core/memo.d.ts +5 -0
- package/dist/core/model-hast.d.ts +8 -0
- package/dist/core/model.d.ts +10 -0
- package/dist/core/normalize.d.ts +37 -0
- package/dist/core/parts.d.ts +136 -0
- package/dist/core/preset.d.ts +10 -0
- package/dist/core/run.d.ts +16 -0
- package/dist/core/search.d.ts +5 -0
- package/dist/core/security.d.ts +21 -0
- package/dist/core/slugger.d.ts +13 -0
- package/dist/core/types.d.ts +392 -0
- package/dist/core/url.d.ts +10 -0
- package/dist/editor/codemirror.d.ts +14 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/export/index.d.ts +6 -0
- package/dist/headless.d.ts +21 -0
- package/dist/headless.js +12 -0
- package/dist/highlight/convert-hast.d.ts +8 -0
- package/dist/highlight/highlightjs.d.ts +7 -0
- package/dist/highlight/index.d.ts +4 -0
- package/dist/highlight/index.js +4 -0
- package/dist/highlight/shared.d.ts +11 -0
- package/dist/highlight/shiki.d.ts +7 -0
- package/dist/highlight/shiki.js +75 -0
- package/dist/html/index.d.ts +17 -0
- package/dist/html/index.js +11 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +53 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +585 -0
- package/dist/math/katex.d.ts +4 -0
- package/dist/math/plugin.d.ts +20 -0
- package/dist/mermaid/index.d.ts +6 -0
- package/dist/mermaid/index.js +8 -0
- package/dist/mermaid/plugin.d.ts +17 -0
- package/dist/mermaid/runtime.d.ts +14 -0
- 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 +16 -0
- package/dist/node-components.d.ts +1 -0
- package/dist/node-components.js +39 -0
- package/dist/pipeline/custom.d.ts +8 -0
- package/dist/pipeline/identity.d.ts +12 -0
- package/dist/pipeline/index.d.ts +5 -0
- package/dist/pipeline/official.d.ts +6 -0
- package/dist/pipeline.d.ts +1 -0
- package/dist/pipeline.js +1 -0
- package/dist/plugins/builtin.d.ts +15 -0
- package/dist/plugins/define.d.ts +7 -0
- package/dist/plugins/registry.d.ts +16 -0
- package/dist/plugins/source.d.ts +7 -0
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +1 -0
- package/dist/presets.d.ts +3 -0
- package/dist/presets.js +1 -0
- package/dist/style.css +2 -0
- package/dist/styles/components.css +737 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/math-full.css +3 -0
- package/dist/styles/math.css +18 -0
- package/dist/styles/tokens.css +96 -0
- package/package.json +214 -6
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// src/core/labels.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
return typeof e == "function" ? e(t == null ? {} : t) : e;
|
|
4
|
+
}
|
|
5
|
+
var t = {
|
|
6
|
+
toc: "Table of contents",
|
|
7
|
+
error: "The Markdown document could not be rendered.",
|
|
8
|
+
empty: "No content",
|
|
9
|
+
loading: "Loading…",
|
|
10
|
+
headingAnchor: "Link to this heading",
|
|
11
|
+
externalLink: "Opens in a new tab",
|
|
12
|
+
copy: "Copy",
|
|
13
|
+
copied: "Copied",
|
|
14
|
+
copyFailed: "Copy failed",
|
|
15
|
+
download: "Download",
|
|
16
|
+
footnoteReference: "Footnote",
|
|
17
|
+
footnotes: "Footnotes",
|
|
18
|
+
math: "Math",
|
|
19
|
+
mermaid: "Diagram",
|
|
20
|
+
mermaidFallback: "Diagram could not be rendered.",
|
|
21
|
+
preview: "Preview",
|
|
22
|
+
source: "Source",
|
|
23
|
+
retry: "Retry",
|
|
24
|
+
showAll: "Show all lines",
|
|
25
|
+
showLess: "Show less",
|
|
26
|
+
exportPng: "Export PNG",
|
|
27
|
+
fullscreen: "Fullscreen",
|
|
28
|
+
exitFullscreen: "Exit fullscreen",
|
|
29
|
+
zoomIn: "Zoom in",
|
|
30
|
+
zoomOut: "Zoom out",
|
|
31
|
+
reset: "Reset zoom",
|
|
32
|
+
editor: "Mermaid editor",
|
|
33
|
+
editorEmpty: "Nothing to preview yet.",
|
|
34
|
+
editorLine: (e) => {
|
|
35
|
+
var t;
|
|
36
|
+
return `Line ${String((t = e.line) == null ? "" : t)}`;
|
|
37
|
+
},
|
|
38
|
+
editorSplitter: "Resize editor",
|
|
39
|
+
editorDiagnostics: "Diagnostics",
|
|
40
|
+
editorReset: "Reset split",
|
|
41
|
+
editorSyntaxError: (e) => {
|
|
42
|
+
var t;
|
|
43
|
+
return `Mermaid syntax error near line ${String((t = e.line) == null ? "" : t)}.`;
|
|
44
|
+
},
|
|
45
|
+
editorParseError: "Mermaid could not parse this diagram."
|
|
46
|
+
};
|
|
47
|
+
export { e as n, t };
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { t as e } from "./objectSpread2-CtBNx0TF.js";
|
|
2
|
+
// node_modules/unist-util-stringify-position/lib/index.js
|
|
3
|
+
function t(e) {
|
|
4
|
+
return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? r(e.position) : "start" in e || "end" in e ? r(e) : "line" in e || "column" in e ? n(e) : "";
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return i(e && e.line) + ":" + i(e && e.column);
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
return n(e && e.start) + "-" + n(e && e.end);
|
|
11
|
+
}
|
|
12
|
+
function i(e) {
|
|
13
|
+
return e && typeof e == "number" ? e : 1;
|
|
14
|
+
}
|
|
15
|
+
// node_modules/vfile-message/lib/index.js
|
|
16
|
+
var a = class extends Error {
|
|
17
|
+
constructor(n, r, i) {
|
|
18
|
+
super(), typeof r == "string" && (i = r, r = void 0);
|
|
19
|
+
let a = "", o = {}, s = !1;
|
|
20
|
+
if (r && (o = "line" in r && "column" in r || "start" in r && "end" in r ? { place: r } : "type" in r ? {
|
|
21
|
+
ancestors: [r],
|
|
22
|
+
place: r.position
|
|
23
|
+
} : e({}, r)), typeof n == "string" ? a = n : !o.cause && n && (s = !0, a = n.message, o.cause = n), !o.ruleId && !o.source && typeof i == "string") {
|
|
24
|
+
let e = i.indexOf(":");
|
|
25
|
+
e === -1 ? o.ruleId = i : (o.source = i.slice(0, e), o.ruleId = i.slice(e + 1));
|
|
26
|
+
}
|
|
27
|
+
if (!o.place && o.ancestors && o.ancestors) {
|
|
28
|
+
let e = o.ancestors[o.ancestors.length - 1];
|
|
29
|
+
e && (o.place = e.position);
|
|
30
|
+
}
|
|
31
|
+
let c = o.place && "start" in o.place ? o.place.start : o.place;
|
|
32
|
+
this.ancestors = o.ancestors || void 0, this.cause = o.cause || void 0, this.column = c ? c.column : void 0, this.fatal = void 0, this.file = "", this.message = a, this.line = c ? c.line : void 0, this.name = t(o.place) || "1:1", this.place = o.place || void 0, this.reason = this.message, this.ruleId = o.ruleId || void 0, this.source = o.source || void 0, this.stack = s && o.cause && typeof o.cause.stack == "string" ? o.cause.stack : "", this.actual = void 0, this.expected = void 0, this.note = void 0, this.url = void 0;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
a.prototype.file = "", a.prototype.name = "", a.prototype.reason = "", a.prototype.message = "", a.prototype.stack = "", a.prototype.column = void 0, a.prototype.line = void 0, a.prototype.ancestors = void 0, a.prototype.cause = void 0, a.prototype.fatal = void 0, a.prototype.place = void 0, a.prototype.ruleId = void 0, a.prototype.source = void 0;
|
|
36
|
+
// node_modules/vfile/lib/minpath.browser.js
|
|
37
|
+
var o = {
|
|
38
|
+
basename: s,
|
|
39
|
+
dirname: c,
|
|
40
|
+
extname: l,
|
|
41
|
+
join: u,
|
|
42
|
+
sep: "/"
|
|
43
|
+
};
|
|
44
|
+
function s(e, t) {
|
|
45
|
+
if (t !== void 0 && typeof t != "string") throw TypeError("\"ext\" argument must be a string");
|
|
46
|
+
p(e);
|
|
47
|
+
let n = 0, r = -1, i = e.length, a;
|
|
48
|
+
if (t === void 0 || t.length === 0 || t.length > e.length) {
|
|
49
|
+
for (; i--;) if (e.codePointAt(i) === 47) {
|
|
50
|
+
if (a) {
|
|
51
|
+
n = i + 1;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
} else r < 0 && (a = !0, r = i + 1);
|
|
55
|
+
return r < 0 ? "" : e.slice(n, r);
|
|
56
|
+
}
|
|
57
|
+
if (t === e) return "";
|
|
58
|
+
let o = -1, s = t.length - 1;
|
|
59
|
+
for (; i--;) if (e.codePointAt(i) === 47) {
|
|
60
|
+
if (a) {
|
|
61
|
+
n = i + 1;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
} else o < 0 && (a = !0, o = i + 1), s > -1 && (e.codePointAt(i) === t.codePointAt(s--) ? s < 0 && (r = i) : (s = -1, r = o));
|
|
65
|
+
return n === r ? r = o : r < 0 && (r = e.length), e.slice(n, r);
|
|
66
|
+
}
|
|
67
|
+
function c(e) {
|
|
68
|
+
if (p(e), e.length === 0) return ".";
|
|
69
|
+
let t = -1, n = e.length, r;
|
|
70
|
+
for (; --n;) if (e.codePointAt(n) === 47) {
|
|
71
|
+
if (r) {
|
|
72
|
+
t = n;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
} else r || (r = !0);
|
|
76
|
+
return t < 0 ? e.codePointAt(0) === 47 ? "/" : "." : t === 1 && e.codePointAt(0) === 47 ? "//" : e.slice(0, t);
|
|
77
|
+
}
|
|
78
|
+
function l(e) {
|
|
79
|
+
p(e);
|
|
80
|
+
let t = e.length, n = -1, r = 0, i = -1, a = 0, o;
|
|
81
|
+
for (; t--;) {
|
|
82
|
+
let s = e.codePointAt(t);
|
|
83
|
+
if (s === 47) {
|
|
84
|
+
if (o) {
|
|
85
|
+
r = t + 1;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
} else n < 0 && (o = !0, n = t + 1), s === 46 ? i < 0 ? i = t : a !== 1 && (a = 1) : i > -1 && (a = -1);
|
|
89
|
+
}
|
|
90
|
+
return i < 0 || n < 0 || a === 0 || a === 1 && i === n - 1 && i === r + 1 ? "" : e.slice(i, n);
|
|
91
|
+
}
|
|
92
|
+
function u(...e) {
|
|
93
|
+
let t = -1, n;
|
|
94
|
+
for (; ++t < e.length;) p(e[t]), e[t] && (n = n === void 0 ? e[t] : n + "/" + e[t]);
|
|
95
|
+
return n === void 0 ? "." : d(n);
|
|
96
|
+
}
|
|
97
|
+
function d(e) {
|
|
98
|
+
p(e);
|
|
99
|
+
let t = e.codePointAt(0) === 47, n = f(e, !t);
|
|
100
|
+
return n.length === 0 && !t && (n = "."), n.length > 0 && e.codePointAt(e.length - 1) === 47 && (n += "/"), t ? "/" + n : n;
|
|
101
|
+
}
|
|
102
|
+
function f(e, t) {
|
|
103
|
+
let n = "", r = 0, i = -1, a = 0, o = -1, s, c;
|
|
104
|
+
for (; ++o <= e.length;) {
|
|
105
|
+
if (o < e.length) s = e.codePointAt(o);
|
|
106
|
+
else if (s === 47) break;
|
|
107
|
+
else s = 47;
|
|
108
|
+
if (s === 47) {
|
|
109
|
+
if (i !== o - 1 && a !== 1) {
|
|
110
|
+
if (i !== o - 1 && a === 2) {
|
|
111
|
+
if (n.length < 2 || r !== 2 || n.codePointAt(n.length - 1) !== 46 || n.codePointAt(n.length - 2) !== 46) {
|
|
112
|
+
if (n.length > 2) {
|
|
113
|
+
if (c = n.lastIndexOf("/"), c !== n.length - 1) {
|
|
114
|
+
c < 0 ? (n = "", r = 0) : (n = n.slice(0, c), r = n.length - 1 - n.lastIndexOf("/")), i = o, a = 0;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
} else if (n.length > 0) {
|
|
118
|
+
n = "", r = 0, i = o, a = 0;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
t && (n = n.length > 0 ? n + "/.." : "..", r = 2);
|
|
123
|
+
} else n.length > 0 ? n += "/" + e.slice(i + 1, o) : n = e.slice(i + 1, o), r = o - i - 1;
|
|
124
|
+
}
|
|
125
|
+
i = o, a = 0;
|
|
126
|
+
} else s === 46 && a > -1 ? a++ : a = -1;
|
|
127
|
+
}
|
|
128
|
+
return n;
|
|
129
|
+
}
|
|
130
|
+
function p(e) {
|
|
131
|
+
if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
|
|
132
|
+
}
|
|
133
|
+
// node_modules/vfile/lib/minproc.browser.js
|
|
134
|
+
var m = { cwd: h };
|
|
135
|
+
function h() {
|
|
136
|
+
return "/";
|
|
137
|
+
}
|
|
138
|
+
// node_modules/vfile/lib/minurl.shared.js
|
|
139
|
+
function g(e) {
|
|
140
|
+
return !!(typeof e == "object" && e && "href" in e && e.href && "protocol" in e && e.protocol && e.auth === void 0);
|
|
141
|
+
}
|
|
142
|
+
// node_modules/vfile/lib/minurl.browser.js
|
|
143
|
+
function _(e) {
|
|
144
|
+
if (typeof e == "string") e = new URL(e);
|
|
145
|
+
else if (!g(e)) {
|
|
146
|
+
let t = /* @__PURE__ */ TypeError("The \"path\" argument must be of type string or an instance of URL. Received `" + e + "`");
|
|
147
|
+
throw t.code = "ERR_INVALID_ARG_TYPE", t;
|
|
148
|
+
}
|
|
149
|
+
if (e.protocol !== "file:") {
|
|
150
|
+
let e = /* @__PURE__ */ TypeError("The URL must be of scheme file");
|
|
151
|
+
throw e.code = "ERR_INVALID_URL_SCHEME", e;
|
|
152
|
+
}
|
|
153
|
+
return v(e);
|
|
154
|
+
}
|
|
155
|
+
function v(e) {
|
|
156
|
+
if (e.hostname !== "") {
|
|
157
|
+
let e = /* @__PURE__ */ TypeError("File URL host must be \"localhost\" or empty on darwin");
|
|
158
|
+
throw e.code = "ERR_INVALID_FILE_URL_HOST", e;
|
|
159
|
+
}
|
|
160
|
+
let t = e.pathname, n = -1;
|
|
161
|
+
for (; ++n < t.length;) if (t.codePointAt(n) === 37 && t.codePointAt(n + 1) === 50) {
|
|
162
|
+
let e = t.codePointAt(n + 2);
|
|
163
|
+
if (e === 70 || e === 102) {
|
|
164
|
+
let e = /* @__PURE__ */ TypeError("File URL path must not include encoded / characters");
|
|
165
|
+
throw e.code = "ERR_INVALID_FILE_URL_PATH", e;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return decodeURIComponent(t);
|
|
169
|
+
}
|
|
170
|
+
// node_modules/vfile/lib/index.js
|
|
171
|
+
var y = [
|
|
172
|
+
"history",
|
|
173
|
+
"path",
|
|
174
|
+
"basename",
|
|
175
|
+
"stem",
|
|
176
|
+
"extname",
|
|
177
|
+
"dirname"
|
|
178
|
+
], b = class {
|
|
179
|
+
constructor(e) {
|
|
180
|
+
let t;
|
|
181
|
+
t = e ? g(e) ? { path: e } : typeof e == "string" || w(e) ? { value: e } : e : {}, this.cwd = "cwd" in t ? "" : m.cwd(), this.data = {}, this.history = [], this.messages = [], this.value, this.map, this.result, this.stored;
|
|
182
|
+
let n = -1;
|
|
183
|
+
for (; ++n < y.length;) {
|
|
184
|
+
let e = y[n];
|
|
185
|
+
e in t && t[e] !== void 0 && t[e] !== null && (this[e] = e === "history" ? [...t[e]] : t[e]);
|
|
186
|
+
}
|
|
187
|
+
let r;
|
|
188
|
+
for (r in t) y.includes(r) || (this[r] = t[r]);
|
|
189
|
+
}
|
|
190
|
+
get basename() {
|
|
191
|
+
return typeof this.path == "string" ? o.basename(this.path) : void 0;
|
|
192
|
+
}
|
|
193
|
+
set basename(e) {
|
|
194
|
+
S(e, "basename"), x(e, "basename"), this.path = o.join(this.dirname || "", e);
|
|
195
|
+
}
|
|
196
|
+
get dirname() {
|
|
197
|
+
return typeof this.path == "string" ? o.dirname(this.path) : void 0;
|
|
198
|
+
}
|
|
199
|
+
set dirname(e) {
|
|
200
|
+
C(this.basename, "dirname"), this.path = o.join(e || "", this.basename);
|
|
201
|
+
}
|
|
202
|
+
get extname() {
|
|
203
|
+
return typeof this.path == "string" ? o.extname(this.path) : void 0;
|
|
204
|
+
}
|
|
205
|
+
set extname(e) {
|
|
206
|
+
if (x(e, "extname"), C(this.dirname, "extname"), e) {
|
|
207
|
+
if (e.codePointAt(0) !== 46) throw Error("`extname` must start with `.`");
|
|
208
|
+
if (e.includes(".", 1)) throw Error("`extname` cannot contain multiple dots");
|
|
209
|
+
}
|
|
210
|
+
this.path = o.join(this.dirname, this.stem + (e || ""));
|
|
211
|
+
}
|
|
212
|
+
get path() {
|
|
213
|
+
return this.history[this.history.length - 1];
|
|
214
|
+
}
|
|
215
|
+
set path(e) {
|
|
216
|
+
g(e) && (e = _(e)), S(e, "path"), this.path !== e && this.history.push(e);
|
|
217
|
+
}
|
|
218
|
+
get stem() {
|
|
219
|
+
return typeof this.path == "string" ? o.basename(this.path, this.extname) : void 0;
|
|
220
|
+
}
|
|
221
|
+
set stem(e) {
|
|
222
|
+
S(e, "stem"), x(e, "stem"), this.path = o.join(this.dirname || "", e + (this.extname || ""));
|
|
223
|
+
}
|
|
224
|
+
fail(e, t, n) {
|
|
225
|
+
let r = this.message(e, t, n);
|
|
226
|
+
throw r.fatal = !0, r;
|
|
227
|
+
}
|
|
228
|
+
info(e, t, n) {
|
|
229
|
+
let r = this.message(e, t, n);
|
|
230
|
+
return r.fatal = void 0, r;
|
|
231
|
+
}
|
|
232
|
+
message(e, t, n) {
|
|
233
|
+
let r = new a(e, t, n);
|
|
234
|
+
return this.path && (r.name = this.path + ":" + r.name, r.file = this.path), r.fatal = !1, this.messages.push(r), r;
|
|
235
|
+
}
|
|
236
|
+
toString(e) {
|
|
237
|
+
return this.value === void 0 ? "" : typeof this.value == "string" ? this.value : new TextDecoder(e || void 0).decode(this.value);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
function x(e, t) {
|
|
241
|
+
if (e && e.includes(o.sep)) throw Error("`" + t + "` cannot be a path: did not expect `" + o.sep + "`");
|
|
242
|
+
}
|
|
243
|
+
function S(e, t) {
|
|
244
|
+
if (!e) throw Error("`" + t + "` cannot be empty");
|
|
245
|
+
}
|
|
246
|
+
function C(e, t) {
|
|
247
|
+
if (!e) throw Error("Setting `" + t + "` requires `path` to be set too");
|
|
248
|
+
}
|
|
249
|
+
function w(e) {
|
|
250
|
+
return !!(e && typeof e == "object" && "byteLength" in e && "byteOffset" in e);
|
|
251
|
+
}
|
|
252
|
+
export { a as n, t as r, b as t };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// node_modules/longest-streak/index.js
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = String(e), r = n.indexOf(t), i = r, a = 0, o = 0;
|
|
4
|
+
if (typeof t != "string") throw TypeError("Expected substring");
|
|
5
|
+
for (; r !== -1;) r === i ? ++a > o && (o = a) : a = 1, i = r + t.length, r = n.indexOf(t, i);
|
|
6
|
+
return o;
|
|
7
|
+
}
|
|
8
|
+
export { e as t };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// node_modules/micromark-util-character/index.js
|
|
2
|
+
var e = f(/[A-Za-z]/), t = f(/[\dA-Za-z]/), n = f(/[#-'*+\--9=?A-Z^-~]/);
|
|
3
|
+
function r(e) {
|
|
4
|
+
return e !== null && (e < 32 || e === 127);
|
|
5
|
+
}
|
|
6
|
+
var i = f(/\d/), a = f(/[\dA-Fa-f]/), o = f(/[!-/:-@[-`{-~]/);
|
|
7
|
+
function s(e) {
|
|
8
|
+
return e !== null && e < -2;
|
|
9
|
+
}
|
|
10
|
+
function c(e) {
|
|
11
|
+
return e !== null && (e < 0 || e === 32);
|
|
12
|
+
}
|
|
13
|
+
function l(e) {
|
|
14
|
+
return e === -2 || e === -1 || e === 32;
|
|
15
|
+
}
|
|
16
|
+
var u = f(RegExp("\\p{P}|\\p{S}", "u")), d = f(/\s/);
|
|
17
|
+
function f(e) {
|
|
18
|
+
return t;
|
|
19
|
+
function t(t) {
|
|
20
|
+
return t !== null && t > -1 && e.test(String.fromCharCode(t));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// node_modules/unist-util-is/lib/index.js
|
|
24
|
+
var p = (function(e) {
|
|
25
|
+
if (e == null) return v;
|
|
26
|
+
if (typeof e == "function") return _(e);
|
|
27
|
+
if (typeof e == "object") return Array.isArray(e) ? m(e) : h(e);
|
|
28
|
+
if (typeof e == "string") return g(e);
|
|
29
|
+
throw Error("Expected function, string, or object as test");
|
|
30
|
+
});
|
|
31
|
+
function m(e) {
|
|
32
|
+
let t = [], n = -1;
|
|
33
|
+
for (; ++n < e.length;) t[n] = p(e[n]);
|
|
34
|
+
return _(r);
|
|
35
|
+
function r(...e) {
|
|
36
|
+
let n = -1;
|
|
37
|
+
for (; ++n < t.length;) if (t[n].apply(this, e)) return !0;
|
|
38
|
+
return !1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function h(e) {
|
|
42
|
+
let t = e;
|
|
43
|
+
return _(n);
|
|
44
|
+
function n(n) {
|
|
45
|
+
let r = n, i;
|
|
46
|
+
for (i in e) if (r[i] !== t[i]) return !1;
|
|
47
|
+
return !0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function g(e) {
|
|
51
|
+
return _(t);
|
|
52
|
+
function t(t) {
|
|
53
|
+
return t && t.type === e;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function _(e) {
|
|
57
|
+
return t;
|
|
58
|
+
function t(t, n, r) {
|
|
59
|
+
return !!(y(t) && e.call(this, t, typeof n == "number" ? n : void 0, r || void 0));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function v() {
|
|
63
|
+
return !0;
|
|
64
|
+
}
|
|
65
|
+
function y(e) {
|
|
66
|
+
return typeof e == "object" && !!e && "type" in e;
|
|
67
|
+
}
|
|
68
|
+
// node_modules/unist-util-visit-parents/lib/color.js
|
|
69
|
+
function b(e) {
|
|
70
|
+
return e;
|
|
71
|
+
}
|
|
72
|
+
// node_modules/unist-util-visit-parents/lib/index.js
|
|
73
|
+
var x = [], S = "skip";
|
|
74
|
+
function C(e, t, n, r) {
|
|
75
|
+
let i;
|
|
76
|
+
typeof t == "function" && typeof n != "function" ? (r = n, n = t) : i = t;
|
|
77
|
+
let a = p(i), o = r ? -1 : 1;
|
|
78
|
+
s(e, void 0, [])();
|
|
79
|
+
function s(e, i, c) {
|
|
80
|
+
let l = e && typeof e == "object" ? e : {};
|
|
81
|
+
if (typeof l.type == "string") {
|
|
82
|
+
let t = typeof l.tagName == "string" ? l.tagName : typeof l.name == "string" ? l.name : void 0;
|
|
83
|
+
Object.defineProperty(u, "name", { value: "node (" + b(e.type + (t ? "<" + t + ">" : "")) + ")" });
|
|
84
|
+
}
|
|
85
|
+
return u;
|
|
86
|
+
function u() {
|
|
87
|
+
let l = x, u, d, f;
|
|
88
|
+
if ((!t || a(e, i, c[c.length - 1] || void 0)) && (l = w(n(e, c)), l[0] === !1)) return l;
|
|
89
|
+
if ("children" in e && e.children) {
|
|
90
|
+
let t = e;
|
|
91
|
+
if (t.children && l[0] !== "skip") for (d = (r ? t.children.length : -1) + o, f = c.concat(t); d > -1 && d < t.children.length;) {
|
|
92
|
+
let e = t.children[d];
|
|
93
|
+
if (u = s(e, d, f)(), u[0] === !1) return u;
|
|
94
|
+
d = typeof u[1] == "number" ? u[1] : d + o;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return l;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function w(e) {
|
|
102
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [!0, e] : e == null ? x : [e];
|
|
103
|
+
}
|
|
104
|
+
// node_modules/unist-util-visit/lib/index.js
|
|
105
|
+
function T(e, t, n, r) {
|
|
106
|
+
let i, a, o;
|
|
107
|
+
typeof t == "function" && typeof n != "function" ? (a = void 0, o = t, i = n) : (a = t, o = n, i = r), C(e, a, s, i);
|
|
108
|
+
function s(e, t) {
|
|
109
|
+
let n = t[t.length - 1], r = n ? n.children.indexOf(e) : void 0;
|
|
110
|
+
return o(e, r, n);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// node_modules/micromark-factory-space/index.js
|
|
114
|
+
function E(e, t, n, r) {
|
|
115
|
+
let i = r ? r - 1 : Infinity, a = 0;
|
|
116
|
+
return o;
|
|
117
|
+
function o(r) {
|
|
118
|
+
return l(r) ? (e.enter(n), s(r)) : t(r);
|
|
119
|
+
}
|
|
120
|
+
function s(r) {
|
|
121
|
+
return l(r) && a++ < i ? (e.consume(r), s) : (e.exit(n), t(r));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function D(e, t, n, r, i, a) {
|
|
125
|
+
let o = 0;
|
|
126
|
+
return s;
|
|
127
|
+
function s(t) {
|
|
128
|
+
return a > 0 && l(t) ? (e.enter(r), c(t)) : u(t);
|
|
129
|
+
}
|
|
130
|
+
function c(t) {
|
|
131
|
+
return l(t) && o < a ? (e.consume(t), o++, c) : (e.exit(r), u(t));
|
|
132
|
+
}
|
|
133
|
+
function u(e) {
|
|
134
|
+
return o >= i ? t(e) : n(e);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export { u as _, C as a, t as c, i as d, a as f, l as g, c as h, S as i, n as l, s as m, D as n, p as o, o as p, T as r, e as s, E as t, r as u, d as v };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { n as e, t } from "./diagnostics-CtHoJyiX.js";
|
|
2
|
+
import { r as n, t as r } from "./url-D2BoivaE.js";
|
|
3
|
+
import { a as i, i as a, n as o, r as s } from "./security-y4EwUyAs.js";
|
|
4
|
+
// src/core/normalize.ts
|
|
5
|
+
function c(e) {
|
|
6
|
+
let t = e.position;
|
|
7
|
+
if (t != null && t.start && t.end) return {
|
|
8
|
+
start: {
|
|
9
|
+
line: t.start.line,
|
|
10
|
+
column: t.start.column,
|
|
11
|
+
offset: t.start.offset
|
|
12
|
+
},
|
|
13
|
+
end: {
|
|
14
|
+
line: t.end.line,
|
|
15
|
+
column: t.end.column,
|
|
16
|
+
offset: t.end.offset
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function l(e) {
|
|
21
|
+
let t = "";
|
|
22
|
+
for (let n of e) n.kind === "text" ? t += n.value : "children" in n && Array.isArray(n.children) ? t += l(n.children) : n.kind === "code" && (t += n.code);
|
|
23
|
+
return t;
|
|
24
|
+
}
|
|
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) {
|
|
34
|
+
var t;
|
|
35
|
+
let n = (t = e.properties) == null ? void 0 : t.className;
|
|
36
|
+
return Array.isArray(n) ? n.map(String) : typeof n == "string" ? n.split(/\s+/) : [];
|
|
37
|
+
}
|
|
38
|
+
function p(e) {
|
|
39
|
+
var t, n;
|
|
40
|
+
let r = f(e);
|
|
41
|
+
if (!(e.tagName === "vmd-math" || r.includes("language-math") && r.some((e) => e.startsWith("math-")))) return;
|
|
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");
|
|
43
|
+
return ((l == null ? void 0 : l.tagName) === "pre" || (l == null ? void 0 : l.tagName) === "code") && (c = l.children), {
|
|
44
|
+
tex: s,
|
|
45
|
+
displayMode: i,
|
|
46
|
+
rendered: c
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function m(e) {
|
|
50
|
+
for (let t of e.children) if (t.type === "element") {
|
|
51
|
+
if (t.tagName === "code" && f(t).includes("language-math")) return t;
|
|
52
|
+
if (t.tagName === "pre") {
|
|
53
|
+
let e = m(t);
|
|
54
|
+
if (e) return e;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function h(e) {
|
|
59
|
+
var t;
|
|
60
|
+
if (e.tagName !== "pre") return !1;
|
|
61
|
+
let n = e.children.filter((e) => e.type !== "text" || e.value.trim() !== "");
|
|
62
|
+
return n.length === 1 && ((t = n[0]) == null ? void 0 : t.type) === "element" && n[0].tagName === "code";
|
|
63
|
+
}
|
|
64
|
+
function g(e) {
|
|
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) : []];
|
|
66
|
+
for (let e of n) {
|
|
67
|
+
let t = /^(?:language|lang)-(.+)$/u.exec(e);
|
|
68
|
+
if (t != null && t[1]) return t[1].toLowerCase();
|
|
69
|
+
}
|
|
70
|
+
return "";
|
|
71
|
+
}
|
|
72
|
+
function _(e, t, n) {
|
|
73
|
+
let r = e.children.find((e) => e.type === "element" && e.tagName === "code");
|
|
74
|
+
return {
|
|
75
|
+
kind: "code",
|
|
76
|
+
key: t,
|
|
77
|
+
code: r ? r.children.map((e) => e.type === "text" ? e.value : "").join("") : e.children.map((e) => e.type === "text" ? e.value : "").join(""),
|
|
78
|
+
language: g(e),
|
|
79
|
+
source: n
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function v(n, r, i, a) {
|
|
83
|
+
let { allowedElements: o, disallowedElements: s, unwrapDisallowed: c, allowElement: l, diagnostics: u } = a.options, d = !1;
|
|
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.", {
|
|
85
|
+
severity: "warning",
|
|
86
|
+
phase: "normalize"
|
|
87
|
+
}))), d = !o.includes(n.tag)) : s && s.includes(n.tag) && (d = !0), !d && l) try {
|
|
88
|
+
d = !l(n, r, i);
|
|
89
|
+
} catch (n) {
|
|
90
|
+
u == null || u.push(t("filter-predicate", e(n), { phase: "normalize" })), d = !0;
|
|
91
|
+
}
|
|
92
|
+
return d ? c ? "unwrap" : "drop" : "keep";
|
|
93
|
+
}
|
|
94
|
+
function y(a, o, s, c, l) {
|
|
95
|
+
let u = n(a, l.options.baseUrl), d = l.options.urlTransform, f = (e) => {
|
|
96
|
+
if (o === "srcset") return i(e, "srcset");
|
|
97
|
+
let t = r(e, o);
|
|
98
|
+
return t === "" ? e.trim() === "" ? "" : void 0 : t;
|
|
99
|
+
};
|
|
100
|
+
if (!d) return f(u);
|
|
101
|
+
try {
|
|
102
|
+
let e = d(u, o, {
|
|
103
|
+
tag: s,
|
|
104
|
+
attrs: c
|
|
105
|
+
});
|
|
106
|
+
return e === null ? void 0 : typeof e == "string" ? i(e, o) : f(u);
|
|
107
|
+
} catch (n) {
|
|
108
|
+
if (!l.urlErrorReported) {
|
|
109
|
+
var p;
|
|
110
|
+
l.urlErrorReported = !0, (p = l.options.diagnostics) == null || p.push(t("url-transform", e(n), { phase: "normalize" }));
|
|
111
|
+
}
|
|
112
|
+
return f(u);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function b(e, t, n, r, i, u = !1) {
|
|
116
|
+
if (o.has(e.tagName) && !(u && e.tagName === "math")) return null;
|
|
117
|
+
let d = c(e), f = a(e.tagName, e.properties), m = p(e);
|
|
118
|
+
if (m) {
|
|
119
|
+
let a = {
|
|
120
|
+
kind: "element",
|
|
121
|
+
key: t,
|
|
122
|
+
tag: e.tagName,
|
|
123
|
+
attrs: f,
|
|
124
|
+
children: [],
|
|
125
|
+
source: d
|
|
126
|
+
};
|
|
127
|
+
return v(a, n, r, i) === "keep" ? {
|
|
128
|
+
kind: "math",
|
|
129
|
+
key: t,
|
|
130
|
+
tex: m.tex,
|
|
131
|
+
displayMode: m.displayMode,
|
|
132
|
+
rendered: x(m.rendered, t, a, i, !0),
|
|
133
|
+
source: d
|
|
134
|
+
} : null;
|
|
135
|
+
}
|
|
136
|
+
let g = {
|
|
137
|
+
kind: "element",
|
|
138
|
+
key: t,
|
|
139
|
+
tag: e.tagName,
|
|
140
|
+
attrs: f,
|
|
141
|
+
children: [],
|
|
142
|
+
source: d
|
|
143
|
+
}, b = x(e.children, t, g, i, u);
|
|
144
|
+
g.children = b;
|
|
145
|
+
let S = v(g, n, r, i);
|
|
146
|
+
if (S === "drop") return null;
|
|
147
|
+
if (S === "unwrap") return b;
|
|
148
|
+
if (h(e)) return _(e, t, d);
|
|
149
|
+
for (let t of Object.keys(f)) {
|
|
150
|
+
if (!s.has(t)) continue;
|
|
151
|
+
let n = y(f[t], t, e.tagName, f, i);
|
|
152
|
+
n === void 0 ? delete f[t] : f[t] = n;
|
|
153
|
+
}
|
|
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);
|
|
156
|
+
if (e.trim()) {
|
|
157
|
+
var C;
|
|
158
|
+
f.id = `${(C = i.options.idPrefix) == null ? "" : C}${i.options.slugger.slug(e)}`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return g;
|
|
162
|
+
}
|
|
163
|
+
function x(e, t, n, r, i = !1) {
|
|
164
|
+
let a = [];
|
|
165
|
+
return e.forEach((e, o) => {
|
|
166
|
+
let s = t ? `${t}.${o}` : String(o);
|
|
167
|
+
if (e.type === "text") {
|
|
168
|
+
if (e.value === "" || !n && e.value.trim() === "") return;
|
|
169
|
+
a.push({
|
|
170
|
+
kind: "text",
|
|
171
|
+
key: s,
|
|
172
|
+
value: e.value,
|
|
173
|
+
source: c(e)
|
|
174
|
+
});
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (e.type === "raw" || e.type !== "element") return;
|
|
178
|
+
let l = b(e, s, o, n, r, i);
|
|
179
|
+
l !== null && (Array.isArray(l) ? a.push(...l) : a.push(l));
|
|
180
|
+
}), a;
|
|
181
|
+
}
|
|
182
|
+
function S(e, t) {
|
|
183
|
+
let n = {
|
|
184
|
+
options: t,
|
|
185
|
+
conflictReported: !1,
|
|
186
|
+
urlErrorReported: !1
|
|
187
|
+
}, r = x(e.children, "", void 0, n);
|
|
188
|
+
return {
|
|
189
|
+
nodes: r,
|
|
190
|
+
toc: w(r),
|
|
191
|
+
customTags: T(r)
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function C(e, t) {
|
|
195
|
+
if (t === void 0 || !Number.isFinite(t) || t <= 0 || t >= 6) return [...e];
|
|
196
|
+
let n = Math.min(6, Math.max(1, Math.floor(t)));
|
|
197
|
+
return e.filter((e) => e.level <= n);
|
|
198
|
+
}
|
|
199
|
+
function w(e) {
|
|
200
|
+
let t = [], n = (e) => {
|
|
201
|
+
for (let r of e) if (r.kind === "element") {
|
|
202
|
+
let e = /^h([1-6])$/.exec(r.tag);
|
|
203
|
+
e && r.attrs.id && t.push({
|
|
204
|
+
id: r.attrs.id,
|
|
205
|
+
text: l(r.children).trim(),
|
|
206
|
+
level: Number(e[1])
|
|
207
|
+
}), n(r.children);
|
|
208
|
+
} else "children" in r && Array.isArray(r.children) && n(r.children);
|
|
209
|
+
};
|
|
210
|
+
return n(e), t;
|
|
211
|
+
}
|
|
212
|
+
function T(e) {
|
|
213
|
+
let t = [], n = (e) => {
|
|
214
|
+
for (let r of e) r.kind === "custom" ? (t.push({
|
|
215
|
+
key: r.key,
|
|
216
|
+
tag: r.tag,
|
|
217
|
+
props: r.props,
|
|
218
|
+
attrs: r.attrs
|
|
219
|
+
}), n(r.children)) : "children" in r && Array.isArray(r.children) && n(r.children);
|
|
220
|
+
};
|
|
221
|
+
return n(e), t;
|
|
222
|
+
}
|
|
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);
|
|
225
|
+
}
|
|
226
|
+
export { S as a, d as i, w as n, E as o, C as r, T as t };
|