@elmethis/vue 0.2.0 → 0.2.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, ref, useTemplateRef, watch, onMounted, onUnmounted, createElementBlock, openBlock, normalizeClass } from "vue";
|
|
2
2
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
3
|
__name: "ElmMermaid",
|
|
4
4
|
props: {
|
|
@@ -6,40 +6,76 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
6
6
|
},
|
|
7
7
|
setup(__props) {
|
|
8
8
|
const props = __props;
|
|
9
|
-
const classes = useCssModule();
|
|
10
9
|
const isRendered = ref(false);
|
|
11
10
|
const elementRef = useTemplateRef("svgRef");
|
|
11
|
+
const componentId = `mermaid-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
12
|
+
let renderCount = 0;
|
|
13
|
+
const globalMermaidCache = {
|
|
14
|
+
instance: null,
|
|
15
|
+
svgCache: /* @__PURE__ */ new Map()
|
|
16
|
+
// Cache rendered SVGs by code hash
|
|
17
|
+
};
|
|
18
|
+
const getCacheKey = (code) => {
|
|
19
|
+
let hash = 0;
|
|
20
|
+
for (let i = 0; i < code.length; i++) {
|
|
21
|
+
const char = code.charCodeAt(i);
|
|
22
|
+
hash = (hash << 5) - hash + char;
|
|
23
|
+
hash = hash & hash;
|
|
24
|
+
}
|
|
25
|
+
return `mermaid-${hash}`;
|
|
26
|
+
};
|
|
12
27
|
const renderMermaid = async () => {
|
|
13
28
|
if (!elementRef.value) return;
|
|
14
29
|
isRendered.value = false;
|
|
15
|
-
const { default: mermaid } = await import("mermaid");
|
|
16
30
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const cacheKey = getCacheKey(props.code);
|
|
32
|
+
if (globalMermaidCache.svgCache.has(cacheKey)) {
|
|
33
|
+
console.log("Using cached SVG for:", cacheKey);
|
|
34
|
+
elementRef.value.innerHTML = globalMermaidCache.svgCache.get(cacheKey);
|
|
35
|
+
isRendered.value = true;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!globalMermaidCache.instance) {
|
|
39
|
+
console.log("Initializing mermaid for the first time");
|
|
40
|
+
const { default: mermaid } = await import("mermaid");
|
|
41
|
+
mermaid.initialize({
|
|
42
|
+
startOnLoad: false,
|
|
43
|
+
theme: "base",
|
|
44
|
+
themeVariables: {
|
|
45
|
+
mainBkg: "#fbfcff",
|
|
46
|
+
lineColor: "#606875",
|
|
47
|
+
primaryColor: "#6c7483",
|
|
48
|
+
secondaryColor: "#e9dec5",
|
|
49
|
+
tertiaryColor: "#f5f6f8",
|
|
50
|
+
tertiaryBorderColor: "#e2d4b2",
|
|
51
|
+
tertiaryTextColor: "#b69545",
|
|
52
|
+
signalColor: "#949ba7"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
globalMermaidCache.instance = mermaid;
|
|
56
|
+
}
|
|
57
|
+
const renderId = `${componentId}-${renderCount++}`;
|
|
58
|
+
const { svg } = await globalMermaidCache.instance.render(
|
|
59
|
+
renderId,
|
|
60
|
+
props.code
|
|
61
|
+
);
|
|
62
|
+
globalMermaidCache.svgCache.set(cacheKey, svg);
|
|
63
|
+
console.log("Cached new SVG for:", cacheKey);
|
|
34
64
|
elementRef.value.innerHTML = svg;
|
|
35
65
|
isRendered.value = true;
|
|
36
66
|
} catch (error) {
|
|
37
67
|
console.error("Mermaid render error:", error);
|
|
38
68
|
elementRef.value.innerHTML = `<pre>${props.code}</pre>`;
|
|
69
|
+
isRendered.value = true;
|
|
39
70
|
}
|
|
40
71
|
};
|
|
41
72
|
watch(() => props.code, renderMermaid);
|
|
42
73
|
onMounted(renderMermaid);
|
|
74
|
+
onUnmounted(() => {
|
|
75
|
+
if (elementRef.value) {
|
|
76
|
+
elementRef.value.innerHTML = "";
|
|
77
|
+
}
|
|
78
|
+
});
|
|
43
79
|
return (_ctx, _cache) => {
|
|
44
80
|
return openBlock(), createElementBlock("div", {
|
|
45
81
|
ref: "svgRef",
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
try {
|
|
4
4
|
if (typeof document != "undefined") {
|
|
5
5
|
var elementStyle = document.createElement("style");
|
|
6
|
-
elementStyle.appendChild(document.createTextNode(".
|
|
6
|
+
elementStyle.appendChild(document.createTextNode("._mermaid_36rwq_1{display:block}._mermaid_36rwq_1::-moz-selection{color:#cccfd5;background-color:#494f59}._mermaid_36rwq_1::selection{color:#cccfd5;background-color:#494f59}._raw_36rwq_9{opacity:0}._rendered_36rwq_13{opacity:1;transition:opacity .2s ease-in-out}"));
|
|
7
7
|
document.head.appendChild(elementStyle);
|
|
8
8
|
}
|
|
9
9
|
} catch (e) {
|
|
10
10
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
11
11
|
}
|
|
12
12
|
})();
|
|
13
|
-
const mermaid = "
|
|
14
|
-
const raw = "
|
|
15
|
-
const rendered = "
|
|
13
|
+
const mermaid = "_mermaid_36rwq_1";
|
|
14
|
+
const raw = "_raw_36rwq_9";
|
|
15
|
+
const rendered = "_rendered_36rwq_13";
|
|
16
16
|
const style0 = {
|
|
17
17
|
mermaid,
|
|
18
18
|
raw,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
})();
|
|
13
13
|
import { defineComponent, ref, computed, watch, createElementBlock, openBlock, Fragment, renderList, createBlock, resolveDynamicComponent, h } from "vue";
|
|
14
|
-
import { marked
|
|
14
|
+
import { marked } from "marked";
|
|
15
15
|
import ElmInlineText from "../typography/ElmInlineText.vue.mjs";
|
|
16
16
|
import ElmHeading from "../typography/ElmHeading.vue.mjs";
|
|
17
17
|
import ElmParagraph from "../typography/ElmParagraph.vue.mjs";
|
|
@@ -228,7 +228,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
228
228
|
return results;
|
|
229
229
|
};
|
|
230
230
|
const renderMarkdown = ({ markdown }) => {
|
|
231
|
-
const tokens =
|
|
231
|
+
const tokens = marked.setOptions({ gfm: true }).lexer(markdown);
|
|
232
232
|
return renderByToken({ tokens });
|
|
233
233
|
};
|
|
234
234
|
const renderResult = ref(renderMarkdown({ markdown: props.markdown }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elmethis/vue",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@mdi/js": "^7.4.47",
|
|
27
27
|
"@vueuse/core": "^14.1.0",
|
|
28
28
|
"katex": "^0.16.27",
|
|
29
|
-
"lodash-es": "^4.17.
|
|
29
|
+
"lodash-es": "^4.17.22",
|
|
30
30
|
"marked": "^17.0.1",
|
|
31
31
|
"mermaid": "^11.12.2",
|
|
32
32
|
"nanoid": "^5.1.6",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@ag-ui/core": "^0.0.42",
|
|
38
|
-
"@notionhq/client": "^5.
|
|
39
|
-
"@storybook/vue3-vite": "10.1.
|
|
38
|
+
"@notionhq/client": "^5.6.0",
|
|
39
|
+
"@storybook/vue3-vite": "10.1.10",
|
|
40
40
|
"@types/json-schema": "^7.0.15",
|
|
41
41
|
"@types/katex": "^0.16.7",
|
|
42
42
|
"@types/lodash-es": "^4.17.12",
|
|
43
43
|
"@types/prismjs": "^1.26.5",
|
|
44
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
44
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
45
45
|
"csstype": "^3.2.3",
|
|
46
46
|
"jarkup-ts": "^0.6.0",
|
|
47
47
|
"openapi-types": "^12.1.3",
|
|
48
48
|
"postcss": "^8.5.6",
|
|
49
49
|
"postcss-preset-env": "^10.5.0",
|
|
50
|
-
"sass": "^1.
|
|
51
|
-
"vite": "^7.
|
|
50
|
+
"sass": "^1.97.1",
|
|
51
|
+
"vite": "^7.3.0",
|
|
52
52
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
53
53
|
"vite-plugin-dts": "^4.5.4",
|
|
54
|
-
"vue-tsc": "^3.1
|
|
54
|
+
"vue-tsc": "^3.2.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"vue": "^3.4.0"
|
|
@@ -1,1126 +0,0 @@
|
|
|
1
|
-
function L() {
|
|
2
|
-
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
3
|
-
}
|
|
4
|
-
var T = L();
|
|
5
|
-
function Z(u3) {
|
|
6
|
-
T = u3;
|
|
7
|
-
}
|
|
8
|
-
var C = { exec: () => null };
|
|
9
|
-
function k(u3, e = "") {
|
|
10
|
-
let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
|
|
11
|
-
let s = typeof i == "string" ? i : i.source;
|
|
12
|
-
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
13
|
-
}, getRegex: () => new RegExp(t, e) };
|
|
14
|
-
return n;
|
|
15
|
-
}
|
|
16
|
-
var me = (() => {
|
|
17
|
-
try {
|
|
18
|
-
return !!new RegExp("(?<=1)(?<!1)");
|
|
19
|
-
} catch {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
})(), m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u3) => new RegExp(`^( {0,3}${u3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}#`), htmlBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}<(?:[a-z].*>|!--)`, "i") }, xe = /^(?:[ \t]*(?:\n|$))+/, be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, N = /(?:[*+-]|\d{1,9}[.)])/, re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Oe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, we = /^[^\n]+/, F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ye = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Se = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex(), U = { blockquote: $e, code: be, def: ye, fences: Re, heading: Te, hr: I, html: Se, lheading: se, list: Pe, newline: xe, paragraph: ie, table: C, text: we }, te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), _e = { ...U, lheading: Oe, table: te, paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, Le = { ...U, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: C, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
|
|
23
|
-
]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, K = /[\s\p{P}\p{S}]/u, ae = /[^\s\p{P}\p{S}]/u, Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex(), le = /(?!~)[\p{P}\p{S}]/u, Ie = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, Be = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", me ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, qe = k(ue, "u").replace(/punct/g, D).getRegex(), ve = k(ue, "u").replace(/punct/g, le).getRegex(), pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex(), He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex(), Ze = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex(), Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), Ne = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Qe = k(j).replace("(?:-->|$)", "-->").getRegex(), Fe = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex(), he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex(), Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex(), ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, W = { _backpedal: C, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: oe, code: ze, del: C, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ue, tag: Fe, text: Ae, url: C }, Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, G = { ...W, emStrongRDelimAst: He, emStrongLDelim: ve, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() }, We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, E = { normal: U, gfm: _e, pedantic: Le }, M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
|
|
24
|
-
var Xe = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ke = (u3) => Xe[u3];
|
|
25
|
-
function w(u3, e) {
|
|
26
|
-
if (e) {
|
|
27
|
-
if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ke);
|
|
28
|
-
} else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ke);
|
|
29
|
-
return u3;
|
|
30
|
-
}
|
|
31
|
-
function X(u3) {
|
|
32
|
-
try {
|
|
33
|
-
u3 = encodeURI(u3).replace(m.percentDecode, "%");
|
|
34
|
-
} catch {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return u3;
|
|
38
|
-
}
|
|
39
|
-
function J(u3, e) {
|
|
40
|
-
let t = u3.replace(m.findPipe, (i, s, a) => {
|
|
41
|
-
let o = false, l = s;
|
|
42
|
-
for (; --l >= 0 && a[l] === "\\"; ) o = !o;
|
|
43
|
-
return o ? "|" : " |";
|
|
44
|
-
}), n = t.split(m.splitPipe), r = 0;
|
|
45
|
-
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
|
|
46
|
-
else for (; n.length < e; ) n.push("");
|
|
47
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
48
|
-
return n;
|
|
49
|
-
}
|
|
50
|
-
function z(u3, e, t) {
|
|
51
|
-
let n = u3.length;
|
|
52
|
-
if (n === 0) return "";
|
|
53
|
-
let r = 0;
|
|
54
|
-
for (; r < n; ) {
|
|
55
|
-
let i = u3.charAt(n - r - 1);
|
|
56
|
-
if (i === e && true) r++;
|
|
57
|
-
else break;
|
|
58
|
-
}
|
|
59
|
-
return u3.slice(0, n - r);
|
|
60
|
-
}
|
|
61
|
-
function de(u3, e) {
|
|
62
|
-
if (u3.indexOf(e[1]) === -1) return -1;
|
|
63
|
-
let t = 0;
|
|
64
|
-
for (let n = 0; n < u3.length; n++) if (u3[n] === "\\") n++;
|
|
65
|
-
else if (u3[n] === e[0]) t++;
|
|
66
|
-
else if (u3[n] === e[1] && (t--, t < 0)) return n;
|
|
67
|
-
return t > 0 ? -2 : -1;
|
|
68
|
-
}
|
|
69
|
-
function ge(u3, e, t, n, r) {
|
|
70
|
-
let i = e.href, s = e.title || null, a = u3[1].replace(r.other.outputLinkReplace, "$1");
|
|
71
|
-
n.state.inLink = true;
|
|
72
|
-
let o = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
|
|
73
|
-
return n.state.inLink = false, o;
|
|
74
|
-
}
|
|
75
|
-
function Je(u3, e, t) {
|
|
76
|
-
let n = u3.match(t.other.indentCodeCompensation);
|
|
77
|
-
if (n === null) return e;
|
|
78
|
-
let r = n[1];
|
|
79
|
-
return e.split(`
|
|
80
|
-
`).map((i) => {
|
|
81
|
-
let s = i.match(t.other.beginningSpace);
|
|
82
|
-
if (s === null) return i;
|
|
83
|
-
let [a] = s;
|
|
84
|
-
return a.length >= r.length ? i.slice(r.length) : i;
|
|
85
|
-
}).join(`
|
|
86
|
-
`);
|
|
87
|
-
}
|
|
88
|
-
var y = class {
|
|
89
|
-
options;
|
|
90
|
-
rules;
|
|
91
|
-
lexer;
|
|
92
|
-
constructor(e) {
|
|
93
|
-
this.options = e || T;
|
|
94
|
-
}
|
|
95
|
-
space(e) {
|
|
96
|
-
let t = this.rules.block.newline.exec(e);
|
|
97
|
-
if (t && t[0].length > 0) return { type: "space", raw: t[0] };
|
|
98
|
-
}
|
|
99
|
-
code(e) {
|
|
100
|
-
let t = this.rules.block.code.exec(e);
|
|
101
|
-
if (t) {
|
|
102
|
-
let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
103
|
-
return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
|
|
104
|
-
`) };
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
fences(e) {
|
|
108
|
-
let t = this.rules.block.fences.exec(e);
|
|
109
|
-
if (t) {
|
|
110
|
-
let n = t[0], r = Je(n, t[3] || "", this.rules);
|
|
111
|
-
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
heading(e) {
|
|
115
|
-
let t = this.rules.block.heading.exec(e);
|
|
116
|
-
if (t) {
|
|
117
|
-
let n = t[2].trim();
|
|
118
|
-
if (this.rules.other.endingHash.test(n)) {
|
|
119
|
-
let r = z(n, "#");
|
|
120
|
-
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
121
|
-
}
|
|
122
|
-
return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
hr(e) {
|
|
126
|
-
let t = this.rules.block.hr.exec(e);
|
|
127
|
-
if (t) return { type: "hr", raw: z(t[0], `
|
|
128
|
-
`) };
|
|
129
|
-
}
|
|
130
|
-
blockquote(e) {
|
|
131
|
-
let t = this.rules.block.blockquote.exec(e);
|
|
132
|
-
if (t) {
|
|
133
|
-
let n = z(t[0], `
|
|
134
|
-
`).split(`
|
|
135
|
-
`), r = "", i = "", s = [];
|
|
136
|
-
for (; n.length > 0; ) {
|
|
137
|
-
let a = false, o = [], l;
|
|
138
|
-
for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) o.push(n[l]), a = true;
|
|
139
|
-
else if (!a) o.push(n[l]);
|
|
140
|
-
else break;
|
|
141
|
-
n = n.slice(l);
|
|
142
|
-
let p = o.join(`
|
|
143
|
-
`), c = p.replace(this.rules.other.blockquoteSetextReplace, `
|
|
144
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
145
|
-
r = r ? `${r}
|
|
146
|
-
${p}` : p, i = i ? `${i}
|
|
147
|
-
${c}` : c;
|
|
148
|
-
let g = this.lexer.state.top;
|
|
149
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0) break;
|
|
150
|
-
let h = s.at(-1);
|
|
151
|
-
if (h?.type === "code") break;
|
|
152
|
-
if (h?.type === "blockquote") {
|
|
153
|
-
let R = h, f = R.raw + `
|
|
154
|
-
` + n.join(`
|
|
155
|
-
`), O = this.blockquote(f);
|
|
156
|
-
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
157
|
-
break;
|
|
158
|
-
} else if (h?.type === "list") {
|
|
159
|
-
let R = h, f = R.raw + `
|
|
160
|
-
` + n.join(`
|
|
161
|
-
`), O = this.list(f);
|
|
162
|
-
s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
163
|
-
`);
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return { type: "blockquote", raw: r, tokens: s, text: i };
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
list(e) {
|
|
171
|
-
let t = this.rules.block.list.exec(e);
|
|
172
|
-
if (t) {
|
|
173
|
-
let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
|
|
174
|
-
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
175
|
-
let s = this.rules.other.listItemRegex(n), a = false;
|
|
176
|
-
for (; e; ) {
|
|
177
|
-
let l = false, p = "", c = "";
|
|
178
|
-
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
179
|
-
p = t[0], e = e.substring(p.length);
|
|
180
|
-
let g = t[2].split(`
|
|
181
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h = e.split(`
|
|
182
|
-
`, 1)[0], R = !g.trim(), f = 0;
|
|
183
|
-
if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
|
|
184
|
-
`, e = e.substring(h.length + 1), l = true), !l) {
|
|
185
|
-
let O = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
|
|
186
|
-
for (; e; ) {
|
|
187
|
-
let H = e.split(`
|
|
188
|
-
`, 1)[0], A;
|
|
189
|
-
if (h = H, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), Y.test(h) || ee.test(h) || fe.test(h) || O.test(h) || V.test(h)) break;
|
|
190
|
-
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) c += `
|
|
191
|
-
` + A.slice(f);
|
|
192
|
-
else {
|
|
193
|
-
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g)) break;
|
|
194
|
-
c += `
|
|
195
|
-
` + h;
|
|
196
|
-
}
|
|
197
|
-
!R && !h.trim() && (R = true), p += H + `
|
|
198
|
-
`, e = e.substring(H.length + 1), g = A.slice(f);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
|
|
202
|
-
}
|
|
203
|
-
let o = i.items.at(-1);
|
|
204
|
-
if (o) o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
205
|
-
else return;
|
|
206
|
-
i.raw = i.raw.trimEnd();
|
|
207
|
-
for (let l of i.items) {
|
|
208
|
-
if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
|
|
209
|
-
if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
|
|
210
|
-
l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
|
|
211
|
-
for (let c = this.lexer.inlineQueue.length - 1; c >= 0; c--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
|
|
212
|
-
this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
let p = this.rules.other.listTaskCheckbox.exec(l.raw);
|
|
217
|
-
if (p) {
|
|
218
|
-
let c = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
219
|
-
l.checked = c.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = c.raw + l.tokens[0].raw, l.tokens[0].text = c.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(c)) : l.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : l.tokens.unshift(c);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
if (!i.loose) {
|
|
223
|
-
let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
224
|
-
i.loose = c;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
if (i.loose) for (let l of i.items) {
|
|
228
|
-
l.loose = true;
|
|
229
|
-
for (let p of l.tokens) p.type === "text" && (p.type = "paragraph");
|
|
230
|
-
}
|
|
231
|
-
return i;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
html(e) {
|
|
235
|
-
let t = this.rules.block.html.exec(e);
|
|
236
|
-
if (t) return { type: "html", block: true, raw: t[0], pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: t[0] };
|
|
237
|
-
}
|
|
238
|
-
def(e) {
|
|
239
|
-
let t = this.rules.block.def.exec(e);
|
|
240
|
-
if (t) {
|
|
241
|
-
let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
242
|
-
return { type: "def", tag: n, raw: t[0], href: r, title: i };
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
table(e) {
|
|
246
|
-
let t = this.rules.block.table.exec(e);
|
|
247
|
-
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
248
|
-
let n = J(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
249
|
-
`) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
|
|
250
|
-
if (n.length === r.length) {
|
|
251
|
-
for (let a of r) this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
|
|
252
|
-
for (let a = 0; a < n.length; a++) s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
|
|
253
|
-
for (let a of i) s.rows.push(J(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
|
|
254
|
-
return s;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
lheading(e) {
|
|
258
|
-
let t = this.rules.block.lheading.exec(e);
|
|
259
|
-
if (t) return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: t[1], tokens: this.lexer.inline(t[1]) };
|
|
260
|
-
}
|
|
261
|
-
paragraph(e) {
|
|
262
|
-
let t = this.rules.block.paragraph.exec(e);
|
|
263
|
-
if (t) {
|
|
264
|
-
let n = t[1].charAt(t[1].length - 1) === `
|
|
265
|
-
` ? t[1].slice(0, -1) : t[1];
|
|
266
|
-
return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
text(e) {
|
|
270
|
-
let t = this.rules.block.text.exec(e);
|
|
271
|
-
if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
|
|
272
|
-
}
|
|
273
|
-
escape(e) {
|
|
274
|
-
let t = this.rules.inline.escape.exec(e);
|
|
275
|
-
if (t) return { type: "escape", raw: t[0], text: t[1] };
|
|
276
|
-
}
|
|
277
|
-
tag(e) {
|
|
278
|
-
let t = this.rules.inline.tag.exec(e);
|
|
279
|
-
if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t[0] };
|
|
280
|
-
}
|
|
281
|
-
link(e) {
|
|
282
|
-
let t = this.rules.inline.link.exec(e);
|
|
283
|
-
if (t) {
|
|
284
|
-
let n = t[2].trim();
|
|
285
|
-
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
286
|
-
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
287
|
-
let s = z(n.slice(0, -1), "\\");
|
|
288
|
-
if ((n.length - s.length) % 2 === 0) return;
|
|
289
|
-
} else {
|
|
290
|
-
let s = de(t[2], "()");
|
|
291
|
-
if (s === -2) return;
|
|
292
|
-
if (s > -1) {
|
|
293
|
-
let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
294
|
-
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
let r = t[2], i = "";
|
|
298
|
-
if (this.options.pedantic) {
|
|
299
|
-
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
300
|
-
s && (r = s[1], i = s[3]);
|
|
301
|
-
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
302
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ge(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
reflink(e, t) {
|
|
306
|
-
let n;
|
|
307
|
-
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
308
|
-
let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t[r.toLowerCase()];
|
|
309
|
-
if (!i) {
|
|
310
|
-
let s = n[0].charAt(0);
|
|
311
|
-
return { type: "text", raw: s, text: s };
|
|
312
|
-
}
|
|
313
|
-
return ge(n, i, n[0], this.lexer, this.rules);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
emStrong(e, t, n = "") {
|
|
317
|
-
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
318
|
-
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
319
|
-
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
320
|
-
let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
321
|
-
for (c.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = c.exec(t)) != null; ) {
|
|
322
|
-
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
|
|
323
|
-
if (o = [...a].length, r[3] || r[4]) {
|
|
324
|
-
l += o;
|
|
325
|
-
continue;
|
|
326
|
-
} else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
|
|
327
|
-
p += o;
|
|
328
|
-
continue;
|
|
329
|
-
}
|
|
330
|
-
if (l -= o, l > 0) continue;
|
|
331
|
-
o = Math.min(o, o + l + p);
|
|
332
|
-
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
|
|
333
|
-
if (Math.min(s, o) % 2) {
|
|
334
|
-
let f = h.slice(1, -1);
|
|
335
|
-
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
336
|
-
}
|
|
337
|
-
let R = h.slice(2, -2);
|
|
338
|
-
return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
codespan(e) {
|
|
343
|
-
let t = this.rules.inline.code.exec(e);
|
|
344
|
-
if (t) {
|
|
345
|
-
let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
346
|
-
return r && i && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
br(e) {
|
|
350
|
-
let t = this.rules.inline.br.exec(e);
|
|
351
|
-
if (t) return { type: "br", raw: t[0] };
|
|
352
|
-
}
|
|
353
|
-
del(e) {
|
|
354
|
-
let t = this.rules.inline.del.exec(e);
|
|
355
|
-
if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
|
|
356
|
-
}
|
|
357
|
-
autolink(e) {
|
|
358
|
-
let t = this.rules.inline.autolink.exec(e);
|
|
359
|
-
if (t) {
|
|
360
|
-
let n, r;
|
|
361
|
-
return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
url(e) {
|
|
365
|
-
let t;
|
|
366
|
-
if (t = this.rules.inline.url.exec(e)) {
|
|
367
|
-
let n, r;
|
|
368
|
-
if (t[2] === "@") n = t[0], r = "mailto:" + n;
|
|
369
|
-
else {
|
|
370
|
-
let i;
|
|
371
|
-
do
|
|
372
|
-
i = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
|
|
373
|
-
while (i !== t[0]);
|
|
374
|
-
n = t[0], t[1] === "www." ? r = "http://" + t[0] : r = t[0];
|
|
375
|
-
}
|
|
376
|
-
return { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
inlineText(e) {
|
|
380
|
-
let t = this.rules.inline.text.exec(e);
|
|
381
|
-
if (t) {
|
|
382
|
-
let n = this.lexer.state.inRawBlock;
|
|
383
|
-
return { type: "text", raw: t[0], text: t[0], escaped: n };
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
var x = class u {
|
|
388
|
-
tokens;
|
|
389
|
-
options;
|
|
390
|
-
state;
|
|
391
|
-
inlineQueue;
|
|
392
|
-
tokenizer;
|
|
393
|
-
constructor(e) {
|
|
394
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
395
|
-
let t = { other: m, block: E.normal, inline: M.normal };
|
|
396
|
-
this.options.pedantic ? (t.block = E.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
397
|
-
}
|
|
398
|
-
static get rules() {
|
|
399
|
-
return { block: E, inline: M };
|
|
400
|
-
}
|
|
401
|
-
static lex(e, t) {
|
|
402
|
-
return new u(t).lex(e);
|
|
403
|
-
}
|
|
404
|
-
static lexInline(e, t) {
|
|
405
|
-
return new u(t).inlineTokens(e);
|
|
406
|
-
}
|
|
407
|
-
lex(e) {
|
|
408
|
-
e = e.replace(m.carriageReturn, `
|
|
409
|
-
`), this.blockTokens(e, this.tokens);
|
|
410
|
-
for (let t = 0; t < this.inlineQueue.length; t++) {
|
|
411
|
-
let n = this.inlineQueue[t];
|
|
412
|
-
this.inlineTokens(n.src, n.tokens);
|
|
413
|
-
}
|
|
414
|
-
return this.inlineQueue = [], this.tokens;
|
|
415
|
-
}
|
|
416
|
-
blockTokens(e, t = [], n = false) {
|
|
417
|
-
for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, "")); e; ) {
|
|
418
|
-
let r;
|
|
419
|
-
if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), true) : false)) continue;
|
|
420
|
-
if (r = this.tokenizer.space(e)) {
|
|
421
|
-
e = e.substring(r.raw.length);
|
|
422
|
-
let s = t.at(-1);
|
|
423
|
-
r.raw.length === 1 && s !== void 0 ? s.raw += `
|
|
424
|
-
` : t.push(r);
|
|
425
|
-
continue;
|
|
426
|
-
}
|
|
427
|
-
if (r = this.tokenizer.code(e)) {
|
|
428
|
-
e = e.substring(r.raw.length);
|
|
429
|
-
let s = t.at(-1);
|
|
430
|
-
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
431
|
-
`) ? "" : `
|
|
432
|
-
`) + r.raw, s.text += `
|
|
433
|
-
` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
|
|
434
|
-
continue;
|
|
435
|
-
}
|
|
436
|
-
if (r = this.tokenizer.fences(e)) {
|
|
437
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
438
|
-
continue;
|
|
439
|
-
}
|
|
440
|
-
if (r = this.tokenizer.heading(e)) {
|
|
441
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
442
|
-
continue;
|
|
443
|
-
}
|
|
444
|
-
if (r = this.tokenizer.hr(e)) {
|
|
445
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
446
|
-
continue;
|
|
447
|
-
}
|
|
448
|
-
if (r = this.tokenizer.blockquote(e)) {
|
|
449
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
450
|
-
continue;
|
|
451
|
-
}
|
|
452
|
-
if (r = this.tokenizer.list(e)) {
|
|
453
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
if (r = this.tokenizer.html(e)) {
|
|
457
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
if (r = this.tokenizer.def(e)) {
|
|
461
|
-
e = e.substring(r.raw.length);
|
|
462
|
-
let s = t.at(-1);
|
|
463
|
-
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
464
|
-
`) ? "" : `
|
|
465
|
-
`) + r.raw, s.text += `
|
|
466
|
-
` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t.push(r));
|
|
467
|
-
continue;
|
|
468
|
-
}
|
|
469
|
-
if (r = this.tokenizer.table(e)) {
|
|
470
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
471
|
-
continue;
|
|
472
|
-
}
|
|
473
|
-
if (r = this.tokenizer.lheading(e)) {
|
|
474
|
-
e = e.substring(r.raw.length), t.push(r);
|
|
475
|
-
continue;
|
|
476
|
-
}
|
|
477
|
-
let i = e;
|
|
478
|
-
if (this.options.extensions?.startBlock) {
|
|
479
|
-
let s = 1 / 0, a = e.slice(1), o;
|
|
480
|
-
this.options.extensions.startBlock.forEach((l) => {
|
|
481
|
-
o = l.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
|
|
482
|
-
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
483
|
-
}
|
|
484
|
-
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
485
|
-
let s = t.at(-1);
|
|
486
|
-
n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
|
|
487
|
-
`) ? "" : `
|
|
488
|
-
`) + r.raw, s.text += `
|
|
489
|
-
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
if (r = this.tokenizer.text(e)) {
|
|
493
|
-
e = e.substring(r.raw.length);
|
|
494
|
-
let s = t.at(-1);
|
|
495
|
-
s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
496
|
-
`) ? "" : `
|
|
497
|
-
`) + r.raw, s.text += `
|
|
498
|
-
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
|
|
499
|
-
continue;
|
|
500
|
-
}
|
|
501
|
-
if (e) {
|
|
502
|
-
let s = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
503
|
-
if (this.options.silent) {
|
|
504
|
-
console.error(s);
|
|
505
|
-
break;
|
|
506
|
-
} else throw new Error(s);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
return this.state.top = true, t;
|
|
510
|
-
}
|
|
511
|
-
inline(e, t = []) {
|
|
512
|
-
return this.inlineQueue.push({ src: e, tokens: t }), t;
|
|
513
|
-
}
|
|
514
|
-
inlineTokens(e, t = []) {
|
|
515
|
-
let n = e, r = null;
|
|
516
|
-
if (this.tokens.links) {
|
|
517
|
-
let o = Object.keys(this.tokens.links);
|
|
518
|
-
if (o.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
519
|
-
}
|
|
520
|
-
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
521
|
-
let i;
|
|
522
|
-
for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
523
|
-
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
524
|
-
let s = false, a = "";
|
|
525
|
-
for (; e; ) {
|
|
526
|
-
s || (a = ""), s = false;
|
|
527
|
-
let o;
|
|
528
|
-
if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
|
|
529
|
-
if (o = this.tokenizer.escape(e)) {
|
|
530
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
if (o = this.tokenizer.tag(e)) {
|
|
534
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
535
|
-
continue;
|
|
536
|
-
}
|
|
537
|
-
if (o = this.tokenizer.link(e)) {
|
|
538
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
539
|
-
continue;
|
|
540
|
-
}
|
|
541
|
-
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
542
|
-
e = e.substring(o.raw.length);
|
|
543
|
-
let p = t.at(-1);
|
|
544
|
-
o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
|
|
545
|
-
continue;
|
|
546
|
-
}
|
|
547
|
-
if (o = this.tokenizer.emStrong(e, n, a)) {
|
|
548
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
549
|
-
continue;
|
|
550
|
-
}
|
|
551
|
-
if (o = this.tokenizer.codespan(e)) {
|
|
552
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
553
|
-
continue;
|
|
554
|
-
}
|
|
555
|
-
if (o = this.tokenizer.br(e)) {
|
|
556
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
557
|
-
continue;
|
|
558
|
-
}
|
|
559
|
-
if (o = this.tokenizer.del(e)) {
|
|
560
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
561
|
-
continue;
|
|
562
|
-
}
|
|
563
|
-
if (o = this.tokenizer.autolink(e)) {
|
|
564
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
565
|
-
continue;
|
|
566
|
-
}
|
|
567
|
-
if (!this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
568
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
569
|
-
continue;
|
|
570
|
-
}
|
|
571
|
-
let l = e;
|
|
572
|
-
if (this.options.extensions?.startInline) {
|
|
573
|
-
let p = 1 / 0, c = e.slice(1), g;
|
|
574
|
-
this.options.extensions.startInline.forEach((h) => {
|
|
575
|
-
g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
|
|
576
|
-
}), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
|
|
577
|
-
}
|
|
578
|
-
if (o = this.tokenizer.inlineText(l)) {
|
|
579
|
-
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
|
|
580
|
-
let p = t.at(-1);
|
|
581
|
-
p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
|
|
582
|
-
continue;
|
|
583
|
-
}
|
|
584
|
-
if (e) {
|
|
585
|
-
let p = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
586
|
-
if (this.options.silent) {
|
|
587
|
-
console.error(p);
|
|
588
|
-
break;
|
|
589
|
-
} else throw new Error(p);
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
return t;
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
var P = class {
|
|
596
|
-
options;
|
|
597
|
-
parser;
|
|
598
|
-
constructor(e) {
|
|
599
|
-
this.options = e || T;
|
|
600
|
-
}
|
|
601
|
-
space(e) {
|
|
602
|
-
return "";
|
|
603
|
-
}
|
|
604
|
-
code({ text: e, lang: t, escaped: n }) {
|
|
605
|
-
let r = (t || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
|
|
606
|
-
`;
|
|
607
|
-
return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
|
|
608
|
-
` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
|
|
609
|
-
`;
|
|
610
|
-
}
|
|
611
|
-
blockquote({ tokens: e }) {
|
|
612
|
-
return `<blockquote>
|
|
613
|
-
${this.parser.parse(e)}</blockquote>
|
|
614
|
-
`;
|
|
615
|
-
}
|
|
616
|
-
html({ text: e }) {
|
|
617
|
-
return e;
|
|
618
|
-
}
|
|
619
|
-
def(e) {
|
|
620
|
-
return "";
|
|
621
|
-
}
|
|
622
|
-
heading({ tokens: e, depth: t }) {
|
|
623
|
-
return `<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
624
|
-
`;
|
|
625
|
-
}
|
|
626
|
-
hr(e) {
|
|
627
|
-
return `<hr>
|
|
628
|
-
`;
|
|
629
|
-
}
|
|
630
|
-
list(e) {
|
|
631
|
-
let t = e.ordered, n = e.start, r = "";
|
|
632
|
-
for (let a = 0; a < e.items.length; a++) {
|
|
633
|
-
let o = e.items[a];
|
|
634
|
-
r += this.listitem(o);
|
|
635
|
-
}
|
|
636
|
-
let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
637
|
-
return "<" + i + s + `>
|
|
638
|
-
` + r + "</" + i + `>
|
|
639
|
-
`;
|
|
640
|
-
}
|
|
641
|
-
listitem(e) {
|
|
642
|
-
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
643
|
-
`;
|
|
644
|
-
}
|
|
645
|
-
checkbox({ checked: e }) {
|
|
646
|
-
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
647
|
-
}
|
|
648
|
-
paragraph({ tokens: e }) {
|
|
649
|
-
return `<p>${this.parser.parseInline(e)}</p>
|
|
650
|
-
`;
|
|
651
|
-
}
|
|
652
|
-
table(e) {
|
|
653
|
-
let t = "", n = "";
|
|
654
|
-
for (let i = 0; i < e.header.length; i++) n += this.tablecell(e.header[i]);
|
|
655
|
-
t += this.tablerow({ text: n });
|
|
656
|
-
let r = "";
|
|
657
|
-
for (let i = 0; i < e.rows.length; i++) {
|
|
658
|
-
let s = e.rows[i];
|
|
659
|
-
n = "";
|
|
660
|
-
for (let a = 0; a < s.length; a++) n += this.tablecell(s[a]);
|
|
661
|
-
r += this.tablerow({ text: n });
|
|
662
|
-
}
|
|
663
|
-
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
664
|
-
<thead>
|
|
665
|
-
` + t + `</thead>
|
|
666
|
-
` + r + `</table>
|
|
667
|
-
`;
|
|
668
|
-
}
|
|
669
|
-
tablerow({ text: e }) {
|
|
670
|
-
return `<tr>
|
|
671
|
-
${e}</tr>
|
|
672
|
-
`;
|
|
673
|
-
}
|
|
674
|
-
tablecell(e) {
|
|
675
|
-
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
676
|
-
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
|
|
677
|
-
`;
|
|
678
|
-
}
|
|
679
|
-
strong({ tokens: e }) {
|
|
680
|
-
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
681
|
-
}
|
|
682
|
-
em({ tokens: e }) {
|
|
683
|
-
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
684
|
-
}
|
|
685
|
-
codespan({ text: e }) {
|
|
686
|
-
return `<code>${w(e, true)}</code>`;
|
|
687
|
-
}
|
|
688
|
-
br(e) {
|
|
689
|
-
return "<br>";
|
|
690
|
-
}
|
|
691
|
-
del({ tokens: e }) {
|
|
692
|
-
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
693
|
-
}
|
|
694
|
-
link({ href: e, title: t, tokens: n }) {
|
|
695
|
-
let r = this.parser.parseInline(n), i = X(e);
|
|
696
|
-
if (i === null) return r;
|
|
697
|
-
e = i;
|
|
698
|
-
let s = '<a href="' + e + '"';
|
|
699
|
-
return t && (s += ' title="' + w(t) + '"'), s += ">" + r + "</a>", s;
|
|
700
|
-
}
|
|
701
|
-
image({ href: e, title: t, text: n, tokens: r }) {
|
|
702
|
-
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
703
|
-
let i = X(e);
|
|
704
|
-
if (i === null) return w(n);
|
|
705
|
-
e = i;
|
|
706
|
-
let s = `<img src="${e}" alt="${n}"`;
|
|
707
|
-
return t && (s += ` title="${w(t)}"`), s += ">", s;
|
|
708
|
-
}
|
|
709
|
-
text(e) {
|
|
710
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
|
|
711
|
-
}
|
|
712
|
-
};
|
|
713
|
-
var $ = class {
|
|
714
|
-
strong({ text: e }) {
|
|
715
|
-
return e;
|
|
716
|
-
}
|
|
717
|
-
em({ text: e }) {
|
|
718
|
-
return e;
|
|
719
|
-
}
|
|
720
|
-
codespan({ text: e }) {
|
|
721
|
-
return e;
|
|
722
|
-
}
|
|
723
|
-
del({ text: e }) {
|
|
724
|
-
return e;
|
|
725
|
-
}
|
|
726
|
-
html({ text: e }) {
|
|
727
|
-
return e;
|
|
728
|
-
}
|
|
729
|
-
text({ text: e }) {
|
|
730
|
-
return e;
|
|
731
|
-
}
|
|
732
|
-
link({ text: e }) {
|
|
733
|
-
return "" + e;
|
|
734
|
-
}
|
|
735
|
-
image({ text: e }) {
|
|
736
|
-
return "" + e;
|
|
737
|
-
}
|
|
738
|
-
br() {
|
|
739
|
-
return "";
|
|
740
|
-
}
|
|
741
|
-
checkbox({ raw: e }) {
|
|
742
|
-
return e;
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
var b = class u2 {
|
|
746
|
-
options;
|
|
747
|
-
renderer;
|
|
748
|
-
textRenderer;
|
|
749
|
-
constructor(e) {
|
|
750
|
-
this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
|
|
751
|
-
}
|
|
752
|
-
static parse(e, t) {
|
|
753
|
-
return new u2(t).parse(e);
|
|
754
|
-
}
|
|
755
|
-
static parseInline(e, t) {
|
|
756
|
-
return new u2(t).parseInline(e);
|
|
757
|
-
}
|
|
758
|
-
parse(e) {
|
|
759
|
-
let t = "";
|
|
760
|
-
for (let n = 0; n < e.length; n++) {
|
|
761
|
-
let r = e[n];
|
|
762
|
-
if (this.options.extensions?.renderers?.[r.type]) {
|
|
763
|
-
let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
764
|
-
if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
|
|
765
|
-
t += a || "";
|
|
766
|
-
continue;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
let i = r;
|
|
770
|
-
switch (i.type) {
|
|
771
|
-
case "space": {
|
|
772
|
-
t += this.renderer.space(i);
|
|
773
|
-
break;
|
|
774
|
-
}
|
|
775
|
-
case "hr": {
|
|
776
|
-
t += this.renderer.hr(i);
|
|
777
|
-
break;
|
|
778
|
-
}
|
|
779
|
-
case "heading": {
|
|
780
|
-
t += this.renderer.heading(i);
|
|
781
|
-
break;
|
|
782
|
-
}
|
|
783
|
-
case "code": {
|
|
784
|
-
t += this.renderer.code(i);
|
|
785
|
-
break;
|
|
786
|
-
}
|
|
787
|
-
case "table": {
|
|
788
|
-
t += this.renderer.table(i);
|
|
789
|
-
break;
|
|
790
|
-
}
|
|
791
|
-
case "blockquote": {
|
|
792
|
-
t += this.renderer.blockquote(i);
|
|
793
|
-
break;
|
|
794
|
-
}
|
|
795
|
-
case "list": {
|
|
796
|
-
t += this.renderer.list(i);
|
|
797
|
-
break;
|
|
798
|
-
}
|
|
799
|
-
case "checkbox": {
|
|
800
|
-
t += this.renderer.checkbox(i);
|
|
801
|
-
break;
|
|
802
|
-
}
|
|
803
|
-
case "html": {
|
|
804
|
-
t += this.renderer.html(i);
|
|
805
|
-
break;
|
|
806
|
-
}
|
|
807
|
-
case "def": {
|
|
808
|
-
t += this.renderer.def(i);
|
|
809
|
-
break;
|
|
810
|
-
}
|
|
811
|
-
case "paragraph": {
|
|
812
|
-
t += this.renderer.paragraph(i);
|
|
813
|
-
break;
|
|
814
|
-
}
|
|
815
|
-
case "text": {
|
|
816
|
-
t += this.renderer.text(i);
|
|
817
|
-
break;
|
|
818
|
-
}
|
|
819
|
-
default: {
|
|
820
|
-
let s = 'Token with "' + i.type + '" type was not found.';
|
|
821
|
-
if (this.options.silent) return console.error(s), "";
|
|
822
|
-
throw new Error(s);
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
return t;
|
|
827
|
-
}
|
|
828
|
-
parseInline(e, t = this.renderer) {
|
|
829
|
-
let n = "";
|
|
830
|
-
for (let r = 0; r < e.length; r++) {
|
|
831
|
-
let i = e[r];
|
|
832
|
-
if (this.options.extensions?.renderers?.[i.type]) {
|
|
833
|
-
let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
834
|
-
if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
835
|
-
n += a || "";
|
|
836
|
-
continue;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
let s = i;
|
|
840
|
-
switch (s.type) {
|
|
841
|
-
case "escape": {
|
|
842
|
-
n += t.text(s);
|
|
843
|
-
break;
|
|
844
|
-
}
|
|
845
|
-
case "html": {
|
|
846
|
-
n += t.html(s);
|
|
847
|
-
break;
|
|
848
|
-
}
|
|
849
|
-
case "link": {
|
|
850
|
-
n += t.link(s);
|
|
851
|
-
break;
|
|
852
|
-
}
|
|
853
|
-
case "image": {
|
|
854
|
-
n += t.image(s);
|
|
855
|
-
break;
|
|
856
|
-
}
|
|
857
|
-
case "checkbox": {
|
|
858
|
-
n += t.checkbox(s);
|
|
859
|
-
break;
|
|
860
|
-
}
|
|
861
|
-
case "strong": {
|
|
862
|
-
n += t.strong(s);
|
|
863
|
-
break;
|
|
864
|
-
}
|
|
865
|
-
case "em": {
|
|
866
|
-
n += t.em(s);
|
|
867
|
-
break;
|
|
868
|
-
}
|
|
869
|
-
case "codespan": {
|
|
870
|
-
n += t.codespan(s);
|
|
871
|
-
break;
|
|
872
|
-
}
|
|
873
|
-
case "br": {
|
|
874
|
-
n += t.br(s);
|
|
875
|
-
break;
|
|
876
|
-
}
|
|
877
|
-
case "del": {
|
|
878
|
-
n += t.del(s);
|
|
879
|
-
break;
|
|
880
|
-
}
|
|
881
|
-
case "text": {
|
|
882
|
-
n += t.text(s);
|
|
883
|
-
break;
|
|
884
|
-
}
|
|
885
|
-
default: {
|
|
886
|
-
let a = 'Token with "' + s.type + '" type was not found.';
|
|
887
|
-
if (this.options.silent) return console.error(a), "";
|
|
888
|
-
throw new Error(a);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
return n;
|
|
893
|
-
}
|
|
894
|
-
};
|
|
895
|
-
var S = class {
|
|
896
|
-
options;
|
|
897
|
-
block;
|
|
898
|
-
constructor(e) {
|
|
899
|
-
this.options = e || T;
|
|
900
|
-
}
|
|
901
|
-
static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
902
|
-
static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
903
|
-
preprocess(e) {
|
|
904
|
-
return e;
|
|
905
|
-
}
|
|
906
|
-
postprocess(e) {
|
|
907
|
-
return e;
|
|
908
|
-
}
|
|
909
|
-
processAllTokens(e) {
|
|
910
|
-
return e;
|
|
911
|
-
}
|
|
912
|
-
emStrongMask(e) {
|
|
913
|
-
return e;
|
|
914
|
-
}
|
|
915
|
-
provideLexer() {
|
|
916
|
-
return this.block ? x.lex : x.lexInline;
|
|
917
|
-
}
|
|
918
|
-
provideParser() {
|
|
919
|
-
return this.block ? b.parse : b.parseInline;
|
|
920
|
-
}
|
|
921
|
-
};
|
|
922
|
-
var B = class {
|
|
923
|
-
defaults = L();
|
|
924
|
-
options = this.setOptions;
|
|
925
|
-
parse = this.parseMarkdown(true);
|
|
926
|
-
parseInline = this.parseMarkdown(false);
|
|
927
|
-
Parser = b;
|
|
928
|
-
Renderer = P;
|
|
929
|
-
TextRenderer = $;
|
|
930
|
-
Lexer = x;
|
|
931
|
-
Tokenizer = y;
|
|
932
|
-
Hooks = S;
|
|
933
|
-
constructor(...e) {
|
|
934
|
-
this.use(...e);
|
|
935
|
-
}
|
|
936
|
-
walkTokens(e, t) {
|
|
937
|
-
let n = [];
|
|
938
|
-
for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
|
|
939
|
-
case "table": {
|
|
940
|
-
let i = r;
|
|
941
|
-
for (let s of i.header) n = n.concat(this.walkTokens(s.tokens, t));
|
|
942
|
-
for (let s of i.rows) for (let a of s) n = n.concat(this.walkTokens(a.tokens, t));
|
|
943
|
-
break;
|
|
944
|
-
}
|
|
945
|
-
case "list": {
|
|
946
|
-
let i = r;
|
|
947
|
-
n = n.concat(this.walkTokens(i.items, t));
|
|
948
|
-
break;
|
|
949
|
-
}
|
|
950
|
-
default: {
|
|
951
|
-
let i = r;
|
|
952
|
-
this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
|
|
953
|
-
let a = i[s].flat(1 / 0);
|
|
954
|
-
n = n.concat(this.walkTokens(a, t));
|
|
955
|
-
}) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
return n;
|
|
959
|
-
}
|
|
960
|
-
use(...e) {
|
|
961
|
-
let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
962
|
-
return e.forEach((n) => {
|
|
963
|
-
let r = { ...n };
|
|
964
|
-
if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
|
|
965
|
-
if (!i.name) throw new Error("extension name required");
|
|
966
|
-
if ("renderer" in i) {
|
|
967
|
-
let s = t.renderers[i.name];
|
|
968
|
-
s ? t.renderers[i.name] = function(...a) {
|
|
969
|
-
let o = i.renderer.apply(this, a);
|
|
970
|
-
return o === false && (o = s.apply(this, a)), o;
|
|
971
|
-
} : t.renderers[i.name] = i.renderer;
|
|
972
|
-
}
|
|
973
|
-
if ("tokenizer" in i) {
|
|
974
|
-
if (!i.level || i.level !== "block" && i.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
|
|
975
|
-
let s = t[i.level];
|
|
976
|
-
s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
|
|
977
|
-
}
|
|
978
|
-
"childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
|
|
979
|
-
}), r.extensions = t), n.renderer) {
|
|
980
|
-
let i = this.defaults.renderer || new P(this.defaults);
|
|
981
|
-
for (let s in n.renderer) {
|
|
982
|
-
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
983
|
-
if (["options", "parser"].includes(s)) continue;
|
|
984
|
-
let a = s, o = n.renderer[a], l = i[a];
|
|
985
|
-
i[a] = (...p) => {
|
|
986
|
-
let c = o.apply(i, p);
|
|
987
|
-
return c === false && (c = l.apply(i, p)), c || "";
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
r.renderer = i;
|
|
991
|
-
}
|
|
992
|
-
if (n.tokenizer) {
|
|
993
|
-
let i = this.defaults.tokenizer || new y(this.defaults);
|
|
994
|
-
for (let s in n.tokenizer) {
|
|
995
|
-
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
996
|
-
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
997
|
-
let a = s, o = n.tokenizer[a], l = i[a];
|
|
998
|
-
i[a] = (...p) => {
|
|
999
|
-
let c = o.apply(i, p);
|
|
1000
|
-
return c === false && (c = l.apply(i, p)), c;
|
|
1001
|
-
};
|
|
1002
|
-
}
|
|
1003
|
-
r.tokenizer = i;
|
|
1004
|
-
}
|
|
1005
|
-
if (n.hooks) {
|
|
1006
|
-
let i = this.defaults.hooks || new S();
|
|
1007
|
-
for (let s in n.hooks) {
|
|
1008
|
-
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
1009
|
-
if (["options", "block"].includes(s)) continue;
|
|
1010
|
-
let a = s, o = n.hooks[a], l = i[a];
|
|
1011
|
-
S.passThroughHooks.has(s) ? i[a] = (p) => {
|
|
1012
|
-
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
1013
|
-
let g = await o.call(i, p);
|
|
1014
|
-
return l.call(i, g);
|
|
1015
|
-
})();
|
|
1016
|
-
let c = o.call(i, p);
|
|
1017
|
-
return l.call(i, c);
|
|
1018
|
-
} : i[a] = (...p) => {
|
|
1019
|
-
if (this.defaults.async) return (async () => {
|
|
1020
|
-
let g = await o.apply(i, p);
|
|
1021
|
-
return g === false && (g = await l.apply(i, p)), g;
|
|
1022
|
-
})();
|
|
1023
|
-
let c = o.apply(i, p);
|
|
1024
|
-
return c === false && (c = l.apply(i, p)), c;
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
r.hooks = i;
|
|
1028
|
-
}
|
|
1029
|
-
if (n.walkTokens) {
|
|
1030
|
-
let i = this.defaults.walkTokens, s = n.walkTokens;
|
|
1031
|
-
r.walkTokens = function(a) {
|
|
1032
|
-
let o = [];
|
|
1033
|
-
return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
|
|
1034
|
-
};
|
|
1035
|
-
}
|
|
1036
|
-
this.defaults = { ...this.defaults, ...r };
|
|
1037
|
-
}), this;
|
|
1038
|
-
}
|
|
1039
|
-
setOptions(e) {
|
|
1040
|
-
return this.defaults = { ...this.defaults, ...e }, this;
|
|
1041
|
-
}
|
|
1042
|
-
lexer(e, t) {
|
|
1043
|
-
return x.lex(e, t ?? this.defaults);
|
|
1044
|
-
}
|
|
1045
|
-
parser(e, t) {
|
|
1046
|
-
return b.parse(e, t ?? this.defaults);
|
|
1047
|
-
}
|
|
1048
|
-
parseMarkdown(e) {
|
|
1049
|
-
return (n, r) => {
|
|
1050
|
-
let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
|
|
1051
|
-
if (this.defaults.async === true && i.async === false) return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1052
|
-
if (typeof n > "u" || n === null) return a(new Error("marked(): input parameter is undefined or null"));
|
|
1053
|
-
if (typeof n != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
1054
|
-
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
1055
|
-
let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
|
|
1056
|
-
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
1057
|
-
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
|
|
1058
|
-
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
1059
|
-
})().catch(a);
|
|
1060
|
-
try {
|
|
1061
|
-
s.hooks && (n = s.hooks.preprocess(n));
|
|
1062
|
-
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
1063
|
-
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
1064
|
-
let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
1065
|
-
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
1066
|
-
} catch (o) {
|
|
1067
|
-
return a(o);
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
onError(e, t) {
|
|
1072
|
-
return (n) => {
|
|
1073
|
-
if (n.message += `
|
|
1074
|
-
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
1075
|
-
let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
|
|
1076
|
-
return t ? Promise.resolve(r) : r;
|
|
1077
|
-
}
|
|
1078
|
-
if (t) return Promise.reject(n);
|
|
1079
|
-
throw n;
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
};
|
|
1083
|
-
var _ = new B();
|
|
1084
|
-
function d(u3, e) {
|
|
1085
|
-
return _.parse(u3, e);
|
|
1086
|
-
}
|
|
1087
|
-
d.options = d.setOptions = function(u3) {
|
|
1088
|
-
return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
1089
|
-
};
|
|
1090
|
-
d.getDefaults = L;
|
|
1091
|
-
d.defaults = T;
|
|
1092
|
-
d.use = function(...u3) {
|
|
1093
|
-
return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
1094
|
-
};
|
|
1095
|
-
d.walkTokens = function(u3, e) {
|
|
1096
|
-
return _.walkTokens(u3, e);
|
|
1097
|
-
};
|
|
1098
|
-
d.parseInline = _.parseInline;
|
|
1099
|
-
d.Parser = b;
|
|
1100
|
-
d.parser = b.parse;
|
|
1101
|
-
d.Renderer = P;
|
|
1102
|
-
d.TextRenderer = $;
|
|
1103
|
-
d.Lexer = x;
|
|
1104
|
-
d.lexer = x.lex;
|
|
1105
|
-
d.Tokenizer = y;
|
|
1106
|
-
d.Hooks = S;
|
|
1107
|
-
d.parse = d;
|
|
1108
|
-
d.options;
|
|
1109
|
-
d.setOptions;
|
|
1110
|
-
d.use;
|
|
1111
|
-
d.walkTokens;
|
|
1112
|
-
d.parseInline;
|
|
1113
|
-
b.parse;
|
|
1114
|
-
x.lex;
|
|
1115
|
-
export {
|
|
1116
|
-
S as Hooks,
|
|
1117
|
-
x as Lexer,
|
|
1118
|
-
B as Marked,
|
|
1119
|
-
b as Parser,
|
|
1120
|
-
P as Renderer,
|
|
1121
|
-
$ as TextRenderer,
|
|
1122
|
-
y as Tokenizer,
|
|
1123
|
-
T as defaults,
|
|
1124
|
-
L as getDefaults,
|
|
1125
|
-
d as marked
|
|
1126
|
-
};
|