@ootc/markdown 0.1.0 → 0.2.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/README.md +63 -9
- package/dist/CodeBlock-BquZ4WRk.cjs +2 -0
- package/dist/CodeBlock-DSwq2gw5.js +74 -0
- package/dist/MarkdownPreview-CMvzqhTd.js +7592 -0
- package/dist/MarkdownPreview-DfDx-wep.cjs +29 -0
- package/dist/code.cjs +1 -1
- package/dist/code.js +1 -1
- package/dist/components/code-block/CodeBlock.d.ts +7 -1
- package/dist/components/markdown/MarkdownPreview.d.ts +8 -2
- package/dist/components/markdown-editor/MarkdownEditor.d.ts +4 -1
- package/dist/css/MarkdownPreview.css +1 -1
- package/dist/css/plugin-mermaid.css +1 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.js +24 -22
- package/dist/index-BJZhyxD_.cjs +9 -0
- package/dist/index-DWVMYNE4.js +800 -0
- package/dist/index-HmBYTPyZ.js +1179 -0
- package/dist/index-jsnhzgIQ.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/jsx-runtime-DXgJBoQh.js +264 -0
- package/dist/jsx-runtime-nZSsnGb7.cjs +6 -0
- package/dist/plugin-highlight.cjs +1 -0
- package/dist/plugin-highlight.d.ts +3 -0
- package/dist/plugin-highlight.js +20 -0
- package/dist/plugin-katex.cjs +1 -0
- package/dist/plugin-katex.d.ts +3 -0
- package/dist/plugin-katex.js +12 -0
- package/dist/plugin-mermaid.cjs +1 -0
- package/dist/plugin-mermaid.css +1 -0
- package/dist/plugin-mermaid.d.ts +3 -0
- package/dist/plugin-mermaid.js +266 -0
- package/dist/plugins/highlight/index.d.ts +9 -0
- package/dist/plugins/katex/index.d.ts +12 -0
- package/dist/plugins/mermaid/MermaidDiagram.d.ts +7 -0
- package/dist/plugins/mermaid/index.d.ts +11 -0
- package/dist/plugins/types.d.ts +38 -0
- package/dist/preview.cjs +1 -1
- package/dist/preview.js +2 -2
- package/dist/style.css +1 -0
- package/package.json +49 -9
- package/dist/CodeBlock-B_Wu_RsD.cjs +0 -15
- package/dist/CodeBlock-BdSjKnRY.js +0 -2320
- package/dist/MarkdownPreview-CcTDfsgR.js +0 -20425
- package/dist/MarkdownPreview-imz9Sn8T.cjs +0 -295
- package/dist/_baseUniq-CmzFJAby.js +0 -477
- package/dist/_baseUniq-DTl9zLUk.cjs +0 -1
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +0 -1
- package/dist/arc-CLsgE_FO.cjs +0 -1
- package/dist/arc-DN0J6orD.js +0 -83
- package/dist/architectureDiagram-VXUJARFQ-C0Ox22_L.cjs +0 -36
- package/dist/architectureDiagram-VXUJARFQ-DD1WVkEB.js +0 -4662
- package/dist/blockDiagram-VD42YOAC-CXFrXgPY.cjs +0 -122
- package/dist/blockDiagram-VD42YOAC-DzX-b-6d.js +0 -2256
- package/dist/c4Diagram-YG6GDRKO-8tK3jTST.cjs +0 -10
- package/dist/c4Diagram-YG6GDRKO-CBo9Z0K5.js +0 -1580
- package/dist/channel-BWUNfmCm.js +0 -5
- package/dist/channel-MPm5yYgZ.cjs +0 -1
- package/dist/chunk-4BX2VUAB-BC2JrFPv.js +0 -8
- package/dist/chunk-4BX2VUAB-CVibkmL0.cjs +0 -1
- package/dist/chunk-55IACEB6-CzZUDZ70.js +0 -8
- package/dist/chunk-55IACEB6-DZnx2f_C.cjs +0 -1
- package/dist/chunk-B4BG7PRW-D0a_-7vE.cjs +0 -165
- package/dist/chunk-B4BG7PRW-DU2I6H4s.js +0 -1375
- package/dist/chunk-DI55MBZ5-BuXMX149.js +0 -1370
- package/dist/chunk-DI55MBZ5-Dr1JJdkm.cjs +0 -220
- package/dist/chunk-FMBD7UC4-DekHPa2I.cjs +0 -15
- package/dist/chunk-FMBD7UC4-RBUwxloo.js +0 -19
- package/dist/chunk-QN33PNHL-B6FGlZxV.js +0 -19
- package/dist/chunk-QN33PNHL-C1YRBk0j.cjs +0 -1
- package/dist/chunk-QZHKN3VN-BspjB43V.cjs +0 -1
- package/dist/chunk-QZHKN3VN-DR_oy1P1.js +0 -15
- package/dist/chunk-TZMSLE5B-BRck7Be7.cjs +0 -1
- package/dist/chunk-TZMSLE5B-pyixj0XE.js +0 -64
- package/dist/classDiagram-2ON5EDUG-Bvw7buPq.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-DK3Yvqrk.js +0 -16
- package/dist/classDiagram-v2-WZHVMYZB-Bvw7buPq.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-DK3Yvqrk.js +0 -16
- package/dist/clone-D2V_3-x6.cjs +0 -1
- package/dist/clone-O816pP2i.js +0 -8
- package/dist/cose-bilkent-S5V4N54A-Bu3r2cA0.js +0 -2609
- package/dist/cose-bilkent-S5V4N54A-vz9hoE-P.cjs +0 -1
- package/dist/cytoscape.esm-CNUX3VTg.cjs +0 -321
- package/dist/cytoscape.esm-Cvf3sx9F.js +0 -18704
- package/dist/dagre-6UL2VRFP-D2UBESo6.cjs +0 -4
- package/dist/dagre-6UL2VRFP-DiBRZkX2.js +0 -443
- package/dist/defaultLocale-D7EN2tov.js +0 -171
- package/dist/defaultLocale-DIVzfLaQ.cjs +0 -1
- package/dist/diagram-PSM6KHXK-CUF6rC_5.js +0 -531
- package/dist/diagram-PSM6KHXK-uKXJz4r1.cjs +0 -24
- package/dist/diagram-QEK2KX5R-Da150Pqe.js +0 -217
- package/dist/diagram-QEK2KX5R-kQTDsG_x.cjs +0 -43
- package/dist/diagram-S2PKOQOG-C5ATPkHT.cjs +0 -24
- package/dist/diagram-S2PKOQOG-DA2RxLrC.js +0 -142
- package/dist/erDiagram-Q2GNP2WA-BsCdOw62.cjs +0 -60
- package/dist/erDiagram-Q2GNP2WA-YfCaUJjx.js +0 -841
- package/dist/flowDiagram-NV44I4VS-BG0KW3ec.cjs +0 -162
- package/dist/flowDiagram-NV44I4VS-D7WLCw1w.js +0 -1620
- package/dist/fonts/font-00b26ac8.woff2 +0 -0
- package/dist/fonts/font-036d4e95.woff2 +0 -0
- package/dist/fonts/font-07d8e303.ttf +0 -0
- package/dist/fonts/font-08ce98e5.ttf +0 -0
- package/dist/fonts/font-0cdd387c.woff2 +0 -0
- package/dist/fonts/font-0d85ae7c.ttf +0 -0
- package/dist/fonts/font-0f60d1b8.woff2 +0 -0
- package/dist/fonts/font-11e4dc8a.woff +0 -0
- package/dist/fonts/font-138ac28d.ttf +0 -0
- package/dist/fonts/font-1ae6bd74.woff +0 -0
- package/dist/fonts/font-1c67f068.ttf +0 -0
- package/dist/fonts/font-1e6f9579.ttf +0 -0
- package/dist/fonts/font-1ece03f7.ttf +0 -0
- package/dist/fonts/font-2014c523.woff +0 -0
- package/dist/fonts/font-30da91e8.woff +0 -0
- package/dist/fonts/font-3398dd02.woff +0 -0
- package/dist/fonts/font-3931dd81.ttf +0 -0
- package/dist/fonts/font-500e04d5.ttf +0 -0
- package/dist/fonts/font-51814d27.woff2 +0 -0
- package/dist/fonts/font-5d53e70a.woff2 +0 -0
- package/dist/fonts/font-5e28753b.woff +0 -0
- package/dist/fonts/font-68534840.ttf +0 -0
- package/dist/fonts/font-68e8c73e.woff2 +0 -0
- package/dist/fonts/font-6ab6b62e.woff +0 -0
- package/dist/fonts/font-6b47c401.woff2 +0 -0
- package/dist/fonts/font-70ee1f64.ttf +0 -0
- package/dist/fonts/font-71d517d6.woff2 +0 -0
- package/dist/fonts/font-73d59127.woff2 +0 -0
- package/dist/fonts/font-74444efd.woff2 +0 -0
- package/dist/fonts/font-7af58c5e.woff2 +0 -0
- package/dist/fonts/font-850c0af5.woff +0 -0
- package/dist/fonts/font-8a8d2445.woff +0 -0
- package/dist/fonts/font-9163df9c.ttf +0 -0
- package/dist/fonts/font-91ee6750.woff +0 -0
- package/dist/fonts/font-95b6d2f1.ttf +0 -0
- package/dist/fonts/font-97479ca6.woff2 +0 -0
- package/dist/fonts/font-99cd42a3.woff2 +0 -0
- package/dist/fonts/font-99f9c675.woff +0 -0
- package/dist/fonts/font-9be7ceb8.woff +0 -0
- package/dist/fonts/font-a4af7d41.woff2 +0 -0
- package/dist/fonts/font-a6b2099f.ttf +0 -0
- package/dist/fonts/font-a6f7ec0d.woff +0 -0
- package/dist/fonts/font-c2342cd8.woff2 +0 -0
- package/dist/fonts/font-c6368d87.woff +0 -0
- package/dist/fonts/font-c647367d.ttf +0 -0
- package/dist/fonts/font-c76c5d69.woff +0 -0
- package/dist/fonts/font-c943cc98.woff +0 -0
- package/dist/fonts/font-d0332f52.ttf +0 -0
- package/dist/fonts/font-d04c5421.woff2 +0 -0
- package/dist/fonts/font-d96cdf2b.woff +0 -0
- package/dist/fonts/font-dc47344d.woff2 +0 -0
- package/dist/fonts/font-de7701e4.woff2 +0 -0
- package/dist/fonts/font-e14fed02.woff +0 -0
- package/dist/fonts/font-e99ae511.woff2 +0 -0
- package/dist/fonts/font-ece03cfd.woff +0 -0
- package/dist/fonts/font-ed0b7437.ttf +0 -0
- package/dist/fonts/font-f01f3e87.ttf +0 -0
- package/dist/fonts/font-f1d6ef86.woff +0 -0
- package/dist/fonts/font-f36ea897.ttf +0 -0
- package/dist/fonts/font-f9377ab0.ttf +0 -0
- package/dist/ganttDiagram-JELNMOA3-BUA8njzO.cjs +0 -267
- package/dist/ganttDiagram-JELNMOA3-DSi9nt2I.js +0 -2671
- package/dist/gitGraphDiagram-NY62KEGX-C_9BbRSY.cjs +0 -65
- package/dist/gitGraphDiagram-NY62KEGX-Dr7HXTzE.js +0 -699
- package/dist/graph-Bd_3fIRG.cjs +0 -1
- package/dist/graph-DKQwyqwf.js +0 -381
- package/dist/index-BCrgOJjI.js +0 -38514
- package/dist/index-CPmaHYSB.cjs +0 -3920
- package/dist/infoDiagram-WHAUD3N6-LqpiKtaK.cjs +0 -2
- package/dist/infoDiagram-WHAUD3N6-cs5PUkbs.js +0 -24
- package/dist/init-CHZsXQcr.cjs +0 -1
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/journeyDiagram-XKPGCS4Q-Uzzobun-.cjs +0 -139
- package/dist/journeyDiagram-XKPGCS4Q-Xh1PuBF3.js +0 -834
- package/dist/kanban-definition-3W4ZIXB7-BGNcniUS.cjs +0 -89
- package/dist/kanban-definition-3W4ZIXB7-BrCevkcy.js +0 -719
- package/dist/layout-C1JPMjBE.cjs +0 -1
- package/dist/layout-DCT3c1G0.js +0 -1441
- package/dist/linear-1V2v3HAv.js +0 -259
- package/dist/linear-BguQgdYO.cjs +0 -1
- package/dist/mermaid.core-B7U3vlPn.js +0 -15269
- package/dist/mermaid.core-Bi8BVJjR.cjs +0 -249
- package/dist/min-DxTpsh5w.js +0 -38
- package/dist/min-IWR7y697.cjs +0 -1
- package/dist/mindmap-definition-VGOIOE7T-Bo_AaB3S.cjs +0 -68
- package/dist/mindmap-definition-VGOIOE7T-y7MJRkKb.js +0 -784
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/ordinal-CagbB1m8.cjs +0 -1
- package/dist/pieDiagram-ADFJNKIX-B3MwEiQQ.cjs +0 -30
- package/dist/pieDiagram-ADFJNKIX-Dat2qDxW.js +0 -161
- package/dist/quadrantDiagram-AYHSOK5B-BPI6p5FS.js +0 -1022
- package/dist/quadrantDiagram-AYHSOK5B-DJPxR-7E.cjs +0 -7
- package/dist/requirementDiagram-UZGBJVZJ-BjJSqttW.js +0 -850
- package/dist/requirementDiagram-UZGBJVZJ-CmIwuHrt.cjs +0 -64
- package/dist/sankeyDiagram-TZEHDZUN-CLroAHms.cjs +0 -10
- package/dist/sankeyDiagram-TZEHDZUN-jMmEhl5n.js +0 -810
- package/dist/sequenceDiagram-WL72ISMW-BVZMWdMT.cjs +0 -145
- package/dist/sequenceDiagram-WL72ISMW-CqGWWpuM.js +0 -2511
- package/dist/stateDiagram-FKZM4ZOC-DYHXgEjX.cjs +0 -1
- package/dist/stateDiagram-FKZM4ZOC-h1ovMUWJ.js +0 -263
- package/dist/stateDiagram-v2-4FDKWEC3-Di23ehqW.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-GGpuzcKb.js +0 -16
- package/dist/timeline-definition-IT6M3QCI-DC_axTKs.js +0 -795
- package/dist/timeline-definition-IT6M3QCI-DYx-RdCk.cjs +0 -61
- package/dist/treemap-KMMF4GRG-B-9lqUoG.js +0 -14192
- package/dist/treemap-KMMF4GRG-EXqF5Yz1.cjs +0 -128
- package/dist/xychartDiagram-PRI3JC2R-CedpkbBs.cjs +0 -7
- package/dist/xychartDiagram-PRI3JC2R-gFwsBSHN.js +0 -1340
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
import { w as y, s as O, f as D, a as T, b as P, c as x, h as U } from "./index-HmBYTPyZ.js";
|
|
2
|
+
const C = {}.hasOwnProperty;
|
|
3
|
+
function j(a, n) {
|
|
4
|
+
const t = n || {};
|
|
5
|
+
function e(r, ...s) {
|
|
6
|
+
let i = e.invalid;
|
|
7
|
+
const o = e.handlers;
|
|
8
|
+
if (r && C.call(r, a)) {
|
|
9
|
+
const l = String(r[a]);
|
|
10
|
+
i = C.call(o, l) ? o[l] : e.unknown;
|
|
11
|
+
}
|
|
12
|
+
if (i)
|
|
13
|
+
return i.call(this, r, ...s);
|
|
14
|
+
}
|
|
15
|
+
return e.handlers = t.handlers || {}, e.invalid = t.invalid, e.unknown = t.unknown, e;
|
|
16
|
+
}
|
|
17
|
+
const k = [
|
|
18
|
+
"area",
|
|
19
|
+
"base",
|
|
20
|
+
"basefont",
|
|
21
|
+
"bgsound",
|
|
22
|
+
"br",
|
|
23
|
+
"col",
|
|
24
|
+
"command",
|
|
25
|
+
"embed",
|
|
26
|
+
"frame",
|
|
27
|
+
"hr",
|
|
28
|
+
"image",
|
|
29
|
+
"img",
|
|
30
|
+
"input",
|
|
31
|
+
"keygen",
|
|
32
|
+
"link",
|
|
33
|
+
"meta",
|
|
34
|
+
"param",
|
|
35
|
+
"source",
|
|
36
|
+
"track",
|
|
37
|
+
"wbr"
|
|
38
|
+
], F = /["&'<>`]/g, $ = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, z = (
|
|
39
|
+
// eslint-disable-next-line no-control-regex, unicorn/no-hex-escape
|
|
40
|
+
/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g
|
|
41
|
+
), B = /[|\\{}()[\]^$+*?.]/g, A = /* @__PURE__ */ new WeakMap();
|
|
42
|
+
function H(a, n) {
|
|
43
|
+
if (a = a.replace(
|
|
44
|
+
n.subset ? I(n.subset) : F,
|
|
45
|
+
e
|
|
46
|
+
), n.subset || n.escapeOnly)
|
|
47
|
+
return a;
|
|
48
|
+
return a.replace($, t).replace(z, e);
|
|
49
|
+
function t(r, s, i) {
|
|
50
|
+
return n.format(
|
|
51
|
+
(r.charCodeAt(0) - 55296) * 1024 + r.charCodeAt(1) - 56320 + 65536,
|
|
52
|
+
i.charCodeAt(s + 2),
|
|
53
|
+
n
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function e(r, s, i) {
|
|
57
|
+
return n.format(
|
|
58
|
+
r.charCodeAt(0),
|
|
59
|
+
i.charCodeAt(s + 1),
|
|
60
|
+
n
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function I(a) {
|
|
65
|
+
let n = A.get(a);
|
|
66
|
+
return n || (n = L(a), A.set(a, n)), n;
|
|
67
|
+
}
|
|
68
|
+
function L(a) {
|
|
69
|
+
const n = [];
|
|
70
|
+
let t = -1;
|
|
71
|
+
for (; ++t < a.length; )
|
|
72
|
+
n.push(a[t].replace(B, "\\$&"));
|
|
73
|
+
return new RegExp("(?:" + n.join("|") + ")", "g");
|
|
74
|
+
}
|
|
75
|
+
const Y = /[\dA-Fa-f]/;
|
|
76
|
+
function G(a, n, t) {
|
|
77
|
+
const e = "&#x" + a.toString(16).toUpperCase();
|
|
78
|
+
return t && n && !Y.test(String.fromCharCode(n)) ? e : e + ";";
|
|
79
|
+
}
|
|
80
|
+
const M = /\d/;
|
|
81
|
+
function Z(a, n, t) {
|
|
82
|
+
const e = "&#" + String(a);
|
|
83
|
+
return t && n && !M.test(String.fromCharCode(n)) ? e : e + ";";
|
|
84
|
+
}
|
|
85
|
+
const K = [
|
|
86
|
+
"AElig",
|
|
87
|
+
"AMP",
|
|
88
|
+
"Aacute",
|
|
89
|
+
"Acirc",
|
|
90
|
+
"Agrave",
|
|
91
|
+
"Aring",
|
|
92
|
+
"Atilde",
|
|
93
|
+
"Auml",
|
|
94
|
+
"COPY",
|
|
95
|
+
"Ccedil",
|
|
96
|
+
"ETH",
|
|
97
|
+
"Eacute",
|
|
98
|
+
"Ecirc",
|
|
99
|
+
"Egrave",
|
|
100
|
+
"Euml",
|
|
101
|
+
"GT",
|
|
102
|
+
"Iacute",
|
|
103
|
+
"Icirc",
|
|
104
|
+
"Igrave",
|
|
105
|
+
"Iuml",
|
|
106
|
+
"LT",
|
|
107
|
+
"Ntilde",
|
|
108
|
+
"Oacute",
|
|
109
|
+
"Ocirc",
|
|
110
|
+
"Ograve",
|
|
111
|
+
"Oslash",
|
|
112
|
+
"Otilde",
|
|
113
|
+
"Ouml",
|
|
114
|
+
"QUOT",
|
|
115
|
+
"REG",
|
|
116
|
+
"THORN",
|
|
117
|
+
"Uacute",
|
|
118
|
+
"Ucirc",
|
|
119
|
+
"Ugrave",
|
|
120
|
+
"Uuml",
|
|
121
|
+
"Yacute",
|
|
122
|
+
"aacute",
|
|
123
|
+
"acirc",
|
|
124
|
+
"acute",
|
|
125
|
+
"aelig",
|
|
126
|
+
"agrave",
|
|
127
|
+
"amp",
|
|
128
|
+
"aring",
|
|
129
|
+
"atilde",
|
|
130
|
+
"auml",
|
|
131
|
+
"brvbar",
|
|
132
|
+
"ccedil",
|
|
133
|
+
"cedil",
|
|
134
|
+
"cent",
|
|
135
|
+
"copy",
|
|
136
|
+
"curren",
|
|
137
|
+
"deg",
|
|
138
|
+
"divide",
|
|
139
|
+
"eacute",
|
|
140
|
+
"ecirc",
|
|
141
|
+
"egrave",
|
|
142
|
+
"eth",
|
|
143
|
+
"euml",
|
|
144
|
+
"frac12",
|
|
145
|
+
"frac14",
|
|
146
|
+
"frac34",
|
|
147
|
+
"gt",
|
|
148
|
+
"iacute",
|
|
149
|
+
"icirc",
|
|
150
|
+
"iexcl",
|
|
151
|
+
"igrave",
|
|
152
|
+
"iquest",
|
|
153
|
+
"iuml",
|
|
154
|
+
"laquo",
|
|
155
|
+
"lt",
|
|
156
|
+
"macr",
|
|
157
|
+
"micro",
|
|
158
|
+
"middot",
|
|
159
|
+
"nbsp",
|
|
160
|
+
"not",
|
|
161
|
+
"ntilde",
|
|
162
|
+
"oacute",
|
|
163
|
+
"ocirc",
|
|
164
|
+
"ograve",
|
|
165
|
+
"ordf",
|
|
166
|
+
"ordm",
|
|
167
|
+
"oslash",
|
|
168
|
+
"otilde",
|
|
169
|
+
"ouml",
|
|
170
|
+
"para",
|
|
171
|
+
"plusmn",
|
|
172
|
+
"pound",
|
|
173
|
+
"quot",
|
|
174
|
+
"raquo",
|
|
175
|
+
"reg",
|
|
176
|
+
"sect",
|
|
177
|
+
"shy",
|
|
178
|
+
"sup1",
|
|
179
|
+
"sup2",
|
|
180
|
+
"sup3",
|
|
181
|
+
"szlig",
|
|
182
|
+
"thorn",
|
|
183
|
+
"times",
|
|
184
|
+
"uacute",
|
|
185
|
+
"ucirc",
|
|
186
|
+
"ugrave",
|
|
187
|
+
"uml",
|
|
188
|
+
"uuml",
|
|
189
|
+
"yacute",
|
|
190
|
+
"yen",
|
|
191
|
+
"yuml"
|
|
192
|
+
], d = {
|
|
193
|
+
nbsp: " ",
|
|
194
|
+
iexcl: "¡",
|
|
195
|
+
cent: "¢",
|
|
196
|
+
pound: "£",
|
|
197
|
+
curren: "¤",
|
|
198
|
+
yen: "¥",
|
|
199
|
+
brvbar: "¦",
|
|
200
|
+
sect: "§",
|
|
201
|
+
uml: "¨",
|
|
202
|
+
copy: "©",
|
|
203
|
+
ordf: "ª",
|
|
204
|
+
laquo: "«",
|
|
205
|
+
not: "¬",
|
|
206
|
+
shy: "",
|
|
207
|
+
reg: "®",
|
|
208
|
+
macr: "¯",
|
|
209
|
+
deg: "°",
|
|
210
|
+
plusmn: "±",
|
|
211
|
+
sup2: "²",
|
|
212
|
+
sup3: "³",
|
|
213
|
+
acute: "´",
|
|
214
|
+
micro: "µ",
|
|
215
|
+
para: "¶",
|
|
216
|
+
middot: "·",
|
|
217
|
+
cedil: "¸",
|
|
218
|
+
sup1: "¹",
|
|
219
|
+
ordm: "º",
|
|
220
|
+
raquo: "»",
|
|
221
|
+
frac14: "¼",
|
|
222
|
+
frac12: "½",
|
|
223
|
+
frac34: "¾",
|
|
224
|
+
iquest: "¿",
|
|
225
|
+
Agrave: "À",
|
|
226
|
+
Aacute: "Á",
|
|
227
|
+
Acirc: "Â",
|
|
228
|
+
Atilde: "Ã",
|
|
229
|
+
Auml: "Ä",
|
|
230
|
+
Aring: "Å",
|
|
231
|
+
AElig: "Æ",
|
|
232
|
+
Ccedil: "Ç",
|
|
233
|
+
Egrave: "È",
|
|
234
|
+
Eacute: "É",
|
|
235
|
+
Ecirc: "Ê",
|
|
236
|
+
Euml: "Ë",
|
|
237
|
+
Igrave: "Ì",
|
|
238
|
+
Iacute: "Í",
|
|
239
|
+
Icirc: "Î",
|
|
240
|
+
Iuml: "Ï",
|
|
241
|
+
ETH: "Ð",
|
|
242
|
+
Ntilde: "Ñ",
|
|
243
|
+
Ograve: "Ò",
|
|
244
|
+
Oacute: "Ó",
|
|
245
|
+
Ocirc: "Ô",
|
|
246
|
+
Otilde: "Õ",
|
|
247
|
+
Ouml: "Ö",
|
|
248
|
+
times: "×",
|
|
249
|
+
Oslash: "Ø",
|
|
250
|
+
Ugrave: "Ù",
|
|
251
|
+
Uacute: "Ú",
|
|
252
|
+
Ucirc: "Û",
|
|
253
|
+
Uuml: "Ü",
|
|
254
|
+
Yacute: "Ý",
|
|
255
|
+
THORN: "Þ",
|
|
256
|
+
szlig: "ß",
|
|
257
|
+
agrave: "à",
|
|
258
|
+
aacute: "á",
|
|
259
|
+
acirc: "â",
|
|
260
|
+
atilde: "ã",
|
|
261
|
+
auml: "ä",
|
|
262
|
+
aring: "å",
|
|
263
|
+
aelig: "æ",
|
|
264
|
+
ccedil: "ç",
|
|
265
|
+
egrave: "è",
|
|
266
|
+
eacute: "é",
|
|
267
|
+
ecirc: "ê",
|
|
268
|
+
euml: "ë",
|
|
269
|
+
igrave: "ì",
|
|
270
|
+
iacute: "í",
|
|
271
|
+
icirc: "î",
|
|
272
|
+
iuml: "ï",
|
|
273
|
+
eth: "ð",
|
|
274
|
+
ntilde: "ñ",
|
|
275
|
+
ograve: "ò",
|
|
276
|
+
oacute: "ó",
|
|
277
|
+
ocirc: "ô",
|
|
278
|
+
otilde: "õ",
|
|
279
|
+
ouml: "ö",
|
|
280
|
+
divide: "÷",
|
|
281
|
+
oslash: "ø",
|
|
282
|
+
ugrave: "ù",
|
|
283
|
+
uacute: "ú",
|
|
284
|
+
ucirc: "û",
|
|
285
|
+
uuml: "ü",
|
|
286
|
+
yacute: "ý",
|
|
287
|
+
thorn: "þ",
|
|
288
|
+
yuml: "ÿ",
|
|
289
|
+
fnof: "ƒ",
|
|
290
|
+
Alpha: "Α",
|
|
291
|
+
Beta: "Β",
|
|
292
|
+
Gamma: "Γ",
|
|
293
|
+
Delta: "Δ",
|
|
294
|
+
Epsilon: "Ε",
|
|
295
|
+
Zeta: "Ζ",
|
|
296
|
+
Eta: "Η",
|
|
297
|
+
Theta: "Θ",
|
|
298
|
+
Iota: "Ι",
|
|
299
|
+
Kappa: "Κ",
|
|
300
|
+
Lambda: "Λ",
|
|
301
|
+
Mu: "Μ",
|
|
302
|
+
Nu: "Ν",
|
|
303
|
+
Xi: "Ξ",
|
|
304
|
+
Omicron: "Ο",
|
|
305
|
+
Pi: "Π",
|
|
306
|
+
Rho: "Ρ",
|
|
307
|
+
Sigma: "Σ",
|
|
308
|
+
Tau: "Τ",
|
|
309
|
+
Upsilon: "Υ",
|
|
310
|
+
Phi: "Φ",
|
|
311
|
+
Chi: "Χ",
|
|
312
|
+
Psi: "Ψ",
|
|
313
|
+
Omega: "Ω",
|
|
314
|
+
alpha: "α",
|
|
315
|
+
beta: "β",
|
|
316
|
+
gamma: "γ",
|
|
317
|
+
delta: "δ",
|
|
318
|
+
epsilon: "ε",
|
|
319
|
+
zeta: "ζ",
|
|
320
|
+
eta: "η",
|
|
321
|
+
theta: "θ",
|
|
322
|
+
iota: "ι",
|
|
323
|
+
kappa: "κ",
|
|
324
|
+
lambda: "λ",
|
|
325
|
+
mu: "μ",
|
|
326
|
+
nu: "ν",
|
|
327
|
+
xi: "ξ",
|
|
328
|
+
omicron: "ο",
|
|
329
|
+
pi: "π",
|
|
330
|
+
rho: "ρ",
|
|
331
|
+
sigmaf: "ς",
|
|
332
|
+
sigma: "σ",
|
|
333
|
+
tau: "τ",
|
|
334
|
+
upsilon: "υ",
|
|
335
|
+
phi: "φ",
|
|
336
|
+
chi: "χ",
|
|
337
|
+
psi: "ψ",
|
|
338
|
+
omega: "ω",
|
|
339
|
+
thetasym: "ϑ",
|
|
340
|
+
upsih: "ϒ",
|
|
341
|
+
piv: "ϖ",
|
|
342
|
+
bull: "•",
|
|
343
|
+
hellip: "…",
|
|
344
|
+
prime: "′",
|
|
345
|
+
Prime: "″",
|
|
346
|
+
oline: "‾",
|
|
347
|
+
frasl: "⁄",
|
|
348
|
+
weierp: "℘",
|
|
349
|
+
image: "ℑ",
|
|
350
|
+
real: "ℜ",
|
|
351
|
+
trade: "™",
|
|
352
|
+
alefsym: "ℵ",
|
|
353
|
+
larr: "←",
|
|
354
|
+
uarr: "↑",
|
|
355
|
+
rarr: "→",
|
|
356
|
+
darr: "↓",
|
|
357
|
+
harr: "↔",
|
|
358
|
+
crarr: "↵",
|
|
359
|
+
lArr: "⇐",
|
|
360
|
+
uArr: "⇑",
|
|
361
|
+
rArr: "⇒",
|
|
362
|
+
dArr: "⇓",
|
|
363
|
+
hArr: "⇔",
|
|
364
|
+
forall: "∀",
|
|
365
|
+
part: "∂",
|
|
366
|
+
exist: "∃",
|
|
367
|
+
empty: "∅",
|
|
368
|
+
nabla: "∇",
|
|
369
|
+
isin: "∈",
|
|
370
|
+
notin: "∉",
|
|
371
|
+
ni: "∋",
|
|
372
|
+
prod: "∏",
|
|
373
|
+
sum: "∑",
|
|
374
|
+
minus: "−",
|
|
375
|
+
lowast: "∗",
|
|
376
|
+
radic: "√",
|
|
377
|
+
prop: "∝",
|
|
378
|
+
infin: "∞",
|
|
379
|
+
ang: "∠",
|
|
380
|
+
and: "∧",
|
|
381
|
+
or: "∨",
|
|
382
|
+
cap: "∩",
|
|
383
|
+
cup: "∪",
|
|
384
|
+
int: "∫",
|
|
385
|
+
there4: "∴",
|
|
386
|
+
sim: "∼",
|
|
387
|
+
cong: "≅",
|
|
388
|
+
asymp: "≈",
|
|
389
|
+
ne: "≠",
|
|
390
|
+
equiv: "≡",
|
|
391
|
+
le: "≤",
|
|
392
|
+
ge: "≥",
|
|
393
|
+
sub: "⊂",
|
|
394
|
+
sup: "⊃",
|
|
395
|
+
nsub: "⊄",
|
|
396
|
+
sube: "⊆",
|
|
397
|
+
supe: "⊇",
|
|
398
|
+
oplus: "⊕",
|
|
399
|
+
otimes: "⊗",
|
|
400
|
+
perp: "⊥",
|
|
401
|
+
sdot: "⋅",
|
|
402
|
+
lceil: "⌈",
|
|
403
|
+
rceil: "⌉",
|
|
404
|
+
lfloor: "⌊",
|
|
405
|
+
rfloor: "⌋",
|
|
406
|
+
lang: "〈",
|
|
407
|
+
rang: "〉",
|
|
408
|
+
loz: "◊",
|
|
409
|
+
spades: "♠",
|
|
410
|
+
clubs: "♣",
|
|
411
|
+
hearts: "♥",
|
|
412
|
+
diams: "♦",
|
|
413
|
+
quot: '"',
|
|
414
|
+
amp: "&",
|
|
415
|
+
lt: "<",
|
|
416
|
+
gt: ">",
|
|
417
|
+
OElig: "Œ",
|
|
418
|
+
oelig: "œ",
|
|
419
|
+
Scaron: "Š",
|
|
420
|
+
scaron: "š",
|
|
421
|
+
Yuml: "Ÿ",
|
|
422
|
+
circ: "ˆ",
|
|
423
|
+
tilde: "˜",
|
|
424
|
+
ensp: " ",
|
|
425
|
+
emsp: " ",
|
|
426
|
+
thinsp: " ",
|
|
427
|
+
zwnj: "",
|
|
428
|
+
zwj: "",
|
|
429
|
+
lrm: "",
|
|
430
|
+
rlm: "",
|
|
431
|
+
ndash: "–",
|
|
432
|
+
mdash: "—",
|
|
433
|
+
lsquo: "‘",
|
|
434
|
+
rsquo: "’",
|
|
435
|
+
sbquo: "‚",
|
|
436
|
+
ldquo: "“",
|
|
437
|
+
rdquo: "”",
|
|
438
|
+
bdquo: "„",
|
|
439
|
+
dagger: "†",
|
|
440
|
+
Dagger: "‡",
|
|
441
|
+
permil: "‰",
|
|
442
|
+
lsaquo: "‹",
|
|
443
|
+
rsaquo: "›",
|
|
444
|
+
euro: "€"
|
|
445
|
+
}, Q = [
|
|
446
|
+
"cent",
|
|
447
|
+
"copy",
|
|
448
|
+
"divide",
|
|
449
|
+
"gt",
|
|
450
|
+
"lt",
|
|
451
|
+
"not",
|
|
452
|
+
"para",
|
|
453
|
+
"times"
|
|
454
|
+
], S = {}.hasOwnProperty, h = {};
|
|
455
|
+
let g;
|
|
456
|
+
for (g in d)
|
|
457
|
+
S.call(d, g) && (h[d[g]] = g);
|
|
458
|
+
const V = /[^\dA-Za-z]/;
|
|
459
|
+
function W(a, n, t, e) {
|
|
460
|
+
const r = String.fromCharCode(a);
|
|
461
|
+
if (S.call(h, r)) {
|
|
462
|
+
const s = h[r], i = "&" + s;
|
|
463
|
+
return t && K.includes(s) && !Q.includes(s) && (!e || n && n !== 61 && V.test(String.fromCharCode(n))) ? i : i + ";";
|
|
464
|
+
}
|
|
465
|
+
return "";
|
|
466
|
+
}
|
|
467
|
+
function X(a, n, t) {
|
|
468
|
+
let e = G(a, n, t.omitOptionalSemicolons), r;
|
|
469
|
+
if ((t.useNamedReferences || t.useShortestReferences) && (r = W(
|
|
470
|
+
a,
|
|
471
|
+
n,
|
|
472
|
+
t.omitOptionalSemicolons,
|
|
473
|
+
t.attribute
|
|
474
|
+
)), (t.useShortestReferences || !r) && t.useShortestReferences) {
|
|
475
|
+
const s = Z(a, n, t.omitOptionalSemicolons);
|
|
476
|
+
s.length < e.length && (e = s);
|
|
477
|
+
}
|
|
478
|
+
return r && (!t.useShortestReferences || r.length < e.length) ? r : e;
|
|
479
|
+
}
|
|
480
|
+
function u(a, n) {
|
|
481
|
+
return H(a, Object.assign({ format: X }, n));
|
|
482
|
+
}
|
|
483
|
+
const J = /^>|^->|<!--|-->|--!>|<!-$/g, ee = [">"], te = ["<", ">"];
|
|
484
|
+
function ne(a, n, t, e) {
|
|
485
|
+
return e.settings.bogusComments ? "<?" + u(
|
|
486
|
+
a.value,
|
|
487
|
+
Object.assign({}, e.settings.characterReferences, {
|
|
488
|
+
subset: ee
|
|
489
|
+
})
|
|
490
|
+
) + ">" : "<!--" + a.value.replace(J, r) + "-->";
|
|
491
|
+
function r(s) {
|
|
492
|
+
return u(
|
|
493
|
+
s,
|
|
494
|
+
Object.assign({}, e.settings.characterReferences, {
|
|
495
|
+
subset: te
|
|
496
|
+
})
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function ae(a, n, t, e) {
|
|
501
|
+
return "<!" + (e.settings.upperDoctype ? "DOCTYPE" : "doctype") + (e.settings.tightDoctype ? "" : " ") + "html>";
|
|
502
|
+
}
|
|
503
|
+
const c = q(1), v = q(-1), re = [];
|
|
504
|
+
function q(a) {
|
|
505
|
+
return n;
|
|
506
|
+
function n(t, e, r) {
|
|
507
|
+
const s = t ? t.children : re;
|
|
508
|
+
let i = (e || 0) + a, o = s[i];
|
|
509
|
+
if (!r)
|
|
510
|
+
for (; o && y(o); )
|
|
511
|
+
i += a, o = s[i];
|
|
512
|
+
return o;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
const se = {}.hasOwnProperty;
|
|
516
|
+
function R(a) {
|
|
517
|
+
return n;
|
|
518
|
+
function n(t, e, r) {
|
|
519
|
+
return se.call(a, t.tagName) && a[t.tagName](t, e, r);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
const N = R({
|
|
523
|
+
body: oe,
|
|
524
|
+
caption: p,
|
|
525
|
+
colgroup: p,
|
|
526
|
+
dd: me,
|
|
527
|
+
dt: ue,
|
|
528
|
+
head: p,
|
|
529
|
+
html: ie,
|
|
530
|
+
li: le,
|
|
531
|
+
optgroup: ge,
|
|
532
|
+
option: fe,
|
|
533
|
+
p: ce,
|
|
534
|
+
rp: E,
|
|
535
|
+
rt: E,
|
|
536
|
+
tbody: pe,
|
|
537
|
+
td: w,
|
|
538
|
+
tfoot: he,
|
|
539
|
+
th: w,
|
|
540
|
+
thead: de,
|
|
541
|
+
tr: ye
|
|
542
|
+
});
|
|
543
|
+
function p(a, n, t) {
|
|
544
|
+
const e = c(t, n, !0);
|
|
545
|
+
return !e || e.type !== "comment" && !(e.type === "text" && y(e.value.charAt(0)));
|
|
546
|
+
}
|
|
547
|
+
function ie(a, n, t) {
|
|
548
|
+
const e = c(t, n);
|
|
549
|
+
return !e || e.type !== "comment";
|
|
550
|
+
}
|
|
551
|
+
function oe(a, n, t) {
|
|
552
|
+
const e = c(t, n);
|
|
553
|
+
return !e || e.type !== "comment";
|
|
554
|
+
}
|
|
555
|
+
function ce(a, n, t) {
|
|
556
|
+
const e = c(t, n);
|
|
557
|
+
return e ? e.type === "element" && (e.tagName === "address" || e.tagName === "article" || e.tagName === "aside" || e.tagName === "blockquote" || e.tagName === "details" || e.tagName === "div" || e.tagName === "dl" || e.tagName === "fieldset" || e.tagName === "figcaption" || e.tagName === "figure" || e.tagName === "footer" || e.tagName === "form" || e.tagName === "h1" || e.tagName === "h2" || e.tagName === "h3" || e.tagName === "h4" || e.tagName === "h5" || e.tagName === "h6" || e.tagName === "header" || e.tagName === "hgroup" || e.tagName === "hr" || e.tagName === "main" || e.tagName === "menu" || e.tagName === "nav" || e.tagName === "ol" || e.tagName === "p" || e.tagName === "pre" || e.tagName === "section" || e.tagName === "table" || e.tagName === "ul") : !t || // Confusing parent.
|
|
558
|
+
!(t.type === "element" && (t.tagName === "a" || t.tagName === "audio" || t.tagName === "del" || t.tagName === "ins" || t.tagName === "map" || t.tagName === "noscript" || t.tagName === "video"));
|
|
559
|
+
}
|
|
560
|
+
function le(a, n, t) {
|
|
561
|
+
const e = c(t, n);
|
|
562
|
+
return !e || e.type === "element" && e.tagName === "li";
|
|
563
|
+
}
|
|
564
|
+
function ue(a, n, t) {
|
|
565
|
+
const e = c(t, n);
|
|
566
|
+
return !!(e && e.type === "element" && (e.tagName === "dt" || e.tagName === "dd"));
|
|
567
|
+
}
|
|
568
|
+
function me(a, n, t) {
|
|
569
|
+
const e = c(t, n);
|
|
570
|
+
return !e || e.type === "element" && (e.tagName === "dt" || e.tagName === "dd");
|
|
571
|
+
}
|
|
572
|
+
function E(a, n, t) {
|
|
573
|
+
const e = c(t, n);
|
|
574
|
+
return !e || e.type === "element" && (e.tagName === "rp" || e.tagName === "rt");
|
|
575
|
+
}
|
|
576
|
+
function ge(a, n, t) {
|
|
577
|
+
const e = c(t, n);
|
|
578
|
+
return !e || e.type === "element" && e.tagName === "optgroup";
|
|
579
|
+
}
|
|
580
|
+
function fe(a, n, t) {
|
|
581
|
+
const e = c(t, n);
|
|
582
|
+
return !e || e.type === "element" && (e.tagName === "option" || e.tagName === "optgroup");
|
|
583
|
+
}
|
|
584
|
+
function de(a, n, t) {
|
|
585
|
+
const e = c(t, n);
|
|
586
|
+
return !!(e && e.type === "element" && (e.tagName === "tbody" || e.tagName === "tfoot"));
|
|
587
|
+
}
|
|
588
|
+
function pe(a, n, t) {
|
|
589
|
+
const e = c(t, n);
|
|
590
|
+
return !e || e.type === "element" && (e.tagName === "tbody" || e.tagName === "tfoot");
|
|
591
|
+
}
|
|
592
|
+
function he(a, n, t) {
|
|
593
|
+
return !c(t, n);
|
|
594
|
+
}
|
|
595
|
+
function ye(a, n, t) {
|
|
596
|
+
const e = c(t, n);
|
|
597
|
+
return !e || e.type === "element" && e.tagName === "tr";
|
|
598
|
+
}
|
|
599
|
+
function w(a, n, t) {
|
|
600
|
+
const e = c(t, n);
|
|
601
|
+
return !e || e.type === "element" && (e.tagName === "td" || e.tagName === "th");
|
|
602
|
+
}
|
|
603
|
+
const Ne = R({
|
|
604
|
+
body: Ce,
|
|
605
|
+
colgroup: Ae,
|
|
606
|
+
head: xe,
|
|
607
|
+
html: be,
|
|
608
|
+
tbody: Ee
|
|
609
|
+
});
|
|
610
|
+
function be(a) {
|
|
611
|
+
const n = c(a, -1);
|
|
612
|
+
return !n || n.type !== "comment";
|
|
613
|
+
}
|
|
614
|
+
function xe(a) {
|
|
615
|
+
const n = /* @__PURE__ */ new Set();
|
|
616
|
+
for (const e of a.children)
|
|
617
|
+
if (e.type === "element" && (e.tagName === "base" || e.tagName === "title")) {
|
|
618
|
+
if (n.has(e.tagName)) return !1;
|
|
619
|
+
n.add(e.tagName);
|
|
620
|
+
}
|
|
621
|
+
const t = a.children[0];
|
|
622
|
+
return !t || t.type === "element";
|
|
623
|
+
}
|
|
624
|
+
function Ce(a) {
|
|
625
|
+
const n = c(a, -1, !0);
|
|
626
|
+
return !n || n.type !== "comment" && !(n.type === "text" && y(n.value.charAt(0))) && !(n.type === "element" && (n.tagName === "meta" || n.tagName === "link" || n.tagName === "script" || n.tagName === "style" || n.tagName === "template"));
|
|
627
|
+
}
|
|
628
|
+
function Ae(a, n, t) {
|
|
629
|
+
const e = v(t, n), r = c(a, -1, !0);
|
|
630
|
+
return t && e && e.type === "element" && e.tagName === "colgroup" && N(e, t.children.indexOf(e), t) ? !1 : !!(r && r.type === "element" && r.tagName === "col");
|
|
631
|
+
}
|
|
632
|
+
function Ee(a, n, t) {
|
|
633
|
+
const e = v(t, n), r = c(a, -1);
|
|
634
|
+
return t && e && e.type === "element" && (e.tagName === "thead" || e.tagName === "tbody") && N(e, t.children.indexOf(e), t) ? !1 : !!(r && r.type === "element" && r.tagName === "tr");
|
|
635
|
+
}
|
|
636
|
+
const f = {
|
|
637
|
+
// See: <https://html.spec.whatwg.org/#attribute-name-state>.
|
|
638
|
+
name: [
|
|
639
|
+
[`
|
|
640
|
+
\f\r &/=>`.split(""), `
|
|
641
|
+
\f\r "&'/=>\``.split("")],
|
|
642
|
+
[`\0
|
|
643
|
+
\f\r "&'/<=>`.split(""), `\0
|
|
644
|
+
\f\r "&'/<=>\``.split("")]
|
|
645
|
+
],
|
|
646
|
+
// See: <https://html.spec.whatwg.org/#attribute-value-(unquoted)-state>.
|
|
647
|
+
unquoted: [
|
|
648
|
+
[`
|
|
649
|
+
\f\r &>`.split(""), `\0
|
|
650
|
+
\f\r "&'<=>\``.split("")],
|
|
651
|
+
[`\0
|
|
652
|
+
\f\r "&'<=>\``.split(""), `\0
|
|
653
|
+
\f\r "&'<=>\``.split("")]
|
|
654
|
+
],
|
|
655
|
+
// See: <https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state>.
|
|
656
|
+
single: [
|
|
657
|
+
["&'".split(""), "\"&'`".split("")],
|
|
658
|
+
["\0&'".split(""), "\0\"&'`".split("")]
|
|
659
|
+
],
|
|
660
|
+
// See: <https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state>.
|
|
661
|
+
double: [
|
|
662
|
+
['"&'.split(""), "\"&'`".split("")],
|
|
663
|
+
['\0"&'.split(""), "\0\"&'`".split("")]
|
|
664
|
+
]
|
|
665
|
+
};
|
|
666
|
+
function we(a, n, t, e) {
|
|
667
|
+
const r = e.schema, s = r.space === "svg" ? !1 : e.settings.omitOptionalTags;
|
|
668
|
+
let i = r.space === "svg" ? e.settings.closeEmptyElements : e.settings.voids.includes(a.tagName.toLowerCase());
|
|
669
|
+
const o = [];
|
|
670
|
+
let l;
|
|
671
|
+
r.space === "html" && a.tagName === "svg" && (e.schema = O);
|
|
672
|
+
const m = Oe(e, a.properties), b = e.all(
|
|
673
|
+
r.space === "html" && a.tagName === "template" ? a.content : a
|
|
674
|
+
);
|
|
675
|
+
return e.schema = r, b && (i = !1), (m || !s || !Ne(a, n, t)) && (o.push("<", a.tagName, m ? " " + m : ""), i && (r.space === "svg" || e.settings.closeSelfClosing) && (l = m.charAt(m.length - 1), (!e.settings.tightSelfClosing || l === "/" || l && l !== '"' && l !== "'") && o.push(" "), o.push("/")), o.push(">")), o.push(b), !i && (!s || !N(a, n, t)) && o.push("</" + a.tagName + ">"), o.join("");
|
|
676
|
+
}
|
|
677
|
+
function Oe(a, n) {
|
|
678
|
+
const t = [];
|
|
679
|
+
let e = -1, r;
|
|
680
|
+
if (n) {
|
|
681
|
+
for (r in n)
|
|
682
|
+
if (n[r] !== null && n[r] !== void 0) {
|
|
683
|
+
const s = Se(a, r, n[r]);
|
|
684
|
+
s && t.push(s);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
for (; ++e < t.length; ) {
|
|
688
|
+
const s = a.settings.tightAttributes ? t[e].charAt(t[e].length - 1) : void 0;
|
|
689
|
+
e !== t.length - 1 && s !== '"' && s !== "'" && (t[e] += " ");
|
|
690
|
+
}
|
|
691
|
+
return t.join("");
|
|
692
|
+
}
|
|
693
|
+
function Se(a, n, t) {
|
|
694
|
+
const e = D(a.schema, n), r = a.settings.allowParseErrors && a.schema.space === "html" ? 0 : 1, s = a.settings.allowDangerousCharacters ? 0 : 1;
|
|
695
|
+
let i = a.quote, o;
|
|
696
|
+
if (e.overloadedBoolean && (t === e.attribute || t === "") ? t = !0 : (e.boolean || e.overloadedBoolean) && (typeof t != "string" || t === e.attribute || t === "") && (t = !!t), t == null || t === !1 || typeof t == "number" && Number.isNaN(t))
|
|
697
|
+
return "";
|
|
698
|
+
const l = u(
|
|
699
|
+
e.attribute,
|
|
700
|
+
Object.assign({}, a.settings.characterReferences, {
|
|
701
|
+
// Always encode without parse errors in non-HTML.
|
|
702
|
+
subset: f.name[r][s]
|
|
703
|
+
})
|
|
704
|
+
);
|
|
705
|
+
return t === !0 || (t = Array.isArray(t) ? (e.commaSeparated ? T : P)(t, {
|
|
706
|
+
padLeft: !a.settings.tightCommaSeparatedLists
|
|
707
|
+
}) : String(t), a.settings.collapseEmptyAttributes && !t) ? l : (a.settings.preferUnquoted && (o = u(
|
|
708
|
+
t,
|
|
709
|
+
Object.assign({}, a.settings.characterReferences, {
|
|
710
|
+
attribute: !0,
|
|
711
|
+
subset: f.unquoted[r][s]
|
|
712
|
+
})
|
|
713
|
+
)), o !== t && (a.settings.quoteSmart && x(t, i) > x(t, a.alternative) && (i = a.alternative), o = i + u(
|
|
714
|
+
t,
|
|
715
|
+
Object.assign({}, a.settings.characterReferences, {
|
|
716
|
+
// Always encode without parse errors in non-HTML.
|
|
717
|
+
subset: (i === "'" ? f.single : f.double)[r][s],
|
|
718
|
+
attribute: !0
|
|
719
|
+
})
|
|
720
|
+
) + i), l + (o && "=" + o));
|
|
721
|
+
}
|
|
722
|
+
const ve = ["<", "&"];
|
|
723
|
+
function _(a, n, t, e) {
|
|
724
|
+
return t && t.type === "element" && (t.tagName === "script" || t.tagName === "style") ? a.value : u(
|
|
725
|
+
a.value,
|
|
726
|
+
Object.assign({}, e.settings.characterReferences, {
|
|
727
|
+
subset: ve
|
|
728
|
+
})
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
function qe(a, n, t, e) {
|
|
732
|
+
return e.settings.allowDangerousHtml ? a.value : _(a, n, t, e);
|
|
733
|
+
}
|
|
734
|
+
function Re(a, n, t, e) {
|
|
735
|
+
return e.all(a);
|
|
736
|
+
}
|
|
737
|
+
const _e = j("type", {
|
|
738
|
+
invalid: De,
|
|
739
|
+
unknown: Te,
|
|
740
|
+
handlers: { comment: ne, doctype: ae, element: we, raw: qe, root: Re, text: _ }
|
|
741
|
+
});
|
|
742
|
+
function De(a) {
|
|
743
|
+
throw new Error("Expected node, not `" + a + "`");
|
|
744
|
+
}
|
|
745
|
+
function Te(a) {
|
|
746
|
+
const n = (
|
|
747
|
+
/** @type {Nodes} */
|
|
748
|
+
a
|
|
749
|
+
);
|
|
750
|
+
throw new Error("Cannot compile unknown node `" + n.type + "`");
|
|
751
|
+
}
|
|
752
|
+
const Pe = {}, Ue = {}, je = [];
|
|
753
|
+
function ze(a, n) {
|
|
754
|
+
const t = n || Pe, e = t.quote || '"', r = e === '"' ? "'" : '"';
|
|
755
|
+
if (e !== '"' && e !== "'")
|
|
756
|
+
throw new Error("Invalid quote `" + e + "`, expected `'` or `\"`");
|
|
757
|
+
return {
|
|
758
|
+
one: ke,
|
|
759
|
+
all: Fe,
|
|
760
|
+
settings: {
|
|
761
|
+
omitOptionalTags: t.omitOptionalTags || !1,
|
|
762
|
+
allowParseErrors: t.allowParseErrors || !1,
|
|
763
|
+
allowDangerousCharacters: t.allowDangerousCharacters || !1,
|
|
764
|
+
quoteSmart: t.quoteSmart || !1,
|
|
765
|
+
preferUnquoted: t.preferUnquoted || !1,
|
|
766
|
+
tightAttributes: t.tightAttributes || !1,
|
|
767
|
+
upperDoctype: t.upperDoctype || !1,
|
|
768
|
+
tightDoctype: t.tightDoctype || !1,
|
|
769
|
+
bogusComments: t.bogusComments || !1,
|
|
770
|
+
tightCommaSeparatedLists: t.tightCommaSeparatedLists || !1,
|
|
771
|
+
tightSelfClosing: t.tightSelfClosing || !1,
|
|
772
|
+
collapseEmptyAttributes: t.collapseEmptyAttributes || !1,
|
|
773
|
+
allowDangerousHtml: t.allowDangerousHtml || !1,
|
|
774
|
+
voids: t.voids || k,
|
|
775
|
+
characterReferences: t.characterReferences || Ue,
|
|
776
|
+
closeSelfClosing: t.closeSelfClosing || !1,
|
|
777
|
+
closeEmptyElements: t.closeEmptyElements || !1
|
|
778
|
+
},
|
|
779
|
+
schema: t.space === "svg" ? O : U,
|
|
780
|
+
quote: e,
|
|
781
|
+
alternative: r
|
|
782
|
+
}.one(
|
|
783
|
+
Array.isArray(a) ? { type: "root", children: a } : a,
|
|
784
|
+
void 0,
|
|
785
|
+
void 0
|
|
786
|
+
);
|
|
787
|
+
}
|
|
788
|
+
function ke(a, n, t) {
|
|
789
|
+
return _e(a, n, t, this);
|
|
790
|
+
}
|
|
791
|
+
function Fe(a) {
|
|
792
|
+
const n = [], t = a && a.children || je;
|
|
793
|
+
let e = -1;
|
|
794
|
+
for (; ++e < t.length; )
|
|
795
|
+
n[e] = this.one(t[e], e, a);
|
|
796
|
+
return n.join("");
|
|
797
|
+
}
|
|
798
|
+
export {
|
|
799
|
+
ze as toHtml
|
|
800
|
+
};
|