@rcarls/rc-markdown-editor 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +211 -0
- package/README.md +8 -0
- package/dist/custom-elements.json +220 -39
- package/dist/{rc-editor-toolbar-QnCEnJ2R.js → rc-editor-toolbar-DZHqoNun.js} +1113 -1323
- package/dist/{rc-editor-toolbar-QnCEnJ2R.js.map → rc-editor-toolbar-DZHqoNun.js.map} +1 -1
- package/dist/rc-markdown-editor-define.js +1 -1
- package/dist/rc-markdown-editor-define.js.map +1 -1
- package/dist/rc-markdown-editor.js +1 -1
- package/dist/types/packages/rc-markdown-editor/src/formatting.d.ts +3 -3
- package/dist/types/packages/rc-markdown-editor/src/icons.d.ts +11 -11
- package/dist/types/packages/rc-markdown-editor/src/rc-editor-toolbar.d.ts +46 -8
- package/dist/types/packages/rc-markdown-editor/src/rc-markdown-editor.d.ts +82 -22
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { property as U, query as
|
|
1
|
+
import { css as Hn, LitElement as nn, nothing as $e, html as Me, svg as he } from "lit";
|
|
2
|
+
import { property as U, query as De, state as _t } from "lit/decorators.js";
|
|
3
|
+
import { MessagesController as rn, cssZoom as Vn, isPhysicalReversed as qn, resolveFlow as Un, numberFormat as Wn } from "@rcarls/rc-common";
|
|
3
4
|
import "@rcarls/rc-button/define";
|
|
4
|
-
import "@rcarls/rc-select/define";
|
|
5
5
|
import "@rcarls/rc-toolbar/define";
|
|
6
6
|
const Pt = document.createElement("i");
|
|
7
7
|
function Je(e) {
|
|
@@ -10,7 +10,7 @@ function Je(e) {
|
|
|
10
10
|
const n = Pt.textContent;
|
|
11
11
|
return n.charCodeAt(n.length - 1) === 59 && e !== "semi" || n === t ? !1 : n;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function se(e, t, n, r) {
|
|
14
14
|
const o = e.length;
|
|
15
15
|
let i = 0, a;
|
|
16
16
|
if (t < 0 ? t = -t > o ? 0 : o + t : t = t > o ? o : t, n = n > 0 ? n : 0, r.length < 1e4)
|
|
@@ -20,17 +20,17 @@ function ue(e, t, n, r) {
|
|
|
20
20
|
a = r.slice(i, i + 1e4), a.unshift(t, 0), e.splice(...a), i += 1e4, t += 1e4;
|
|
21
21
|
}
|
|
22
22
|
function Y(e, t) {
|
|
23
|
-
return e.length > 0 ? (
|
|
23
|
+
return e.length > 0 ? (se(e, e.length, 0, t), e) : t;
|
|
24
24
|
}
|
|
25
25
|
const kt = {}.hasOwnProperty;
|
|
26
|
-
function
|
|
26
|
+
function jn(e) {
|
|
27
27
|
const t = {};
|
|
28
28
|
let n = -1;
|
|
29
29
|
for (; ++n < e.length; )
|
|
30
|
-
|
|
30
|
+
Qn(t, e[n]);
|
|
31
31
|
return t;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Qn(e, t) {
|
|
34
34
|
let n;
|
|
35
35
|
for (n in t) {
|
|
36
36
|
const o = (kt.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n];
|
|
@@ -39,7 +39,7 @@ function Vn(e, t) {
|
|
|
39
39
|
for (a in i) {
|
|
40
40
|
kt.call(o, a) || (o[a] = []);
|
|
41
41
|
const l = i[a];
|
|
42
|
-
|
|
42
|
+
Kn(
|
|
43
43
|
// @ts-expect-error Looks like a list.
|
|
44
44
|
o[a],
|
|
45
45
|
Array.isArray(l) ? l : l ? [l] : []
|
|
@@ -47,21 +47,21 @@ function Vn(e, t) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Kn(e, t) {
|
|
51
51
|
let n = -1;
|
|
52
52
|
const r = [];
|
|
53
53
|
for (; ++n < t.length; )
|
|
54
54
|
(t[n].add === "after" ? e : r).push(t[n]);
|
|
55
|
-
|
|
55
|
+
se(e, 0, 0, r);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Yn(e) {
|
|
58
58
|
const t = {};
|
|
59
59
|
let n = -1;
|
|
60
60
|
for (; ++n < e.length; )
|
|
61
|
-
|
|
61
|
+
Gn(t, e[n]);
|
|
62
62
|
return t;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Gn(e, t) {
|
|
65
65
|
let n;
|
|
66
66
|
for (n in t) {
|
|
67
67
|
const o = (kt.call(e, n) ? e[n] : void 0) || (e[n] = {}), i = t[n];
|
|
@@ -71,7 +71,7 @@ function Wn(e, t) {
|
|
|
71
71
|
o[a] = i[a];
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function vt(e, t) {
|
|
75
75
|
const n = Number.parseInt(e, t);
|
|
76
76
|
return (
|
|
77
77
|
// C0 except for HT, LF, FF, CR, space.
|
|
@@ -84,29 +84,29 @@ function wt(e, t) {
|
|
|
84
84
|
n > 1114111 ? "�" : String.fromCodePoint(n)
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
|
-
const
|
|
88
|
-
function
|
|
87
|
+
const Xn = { '"': "quot", "&": "amp", "<": "lt", ">": "gt" };
|
|
88
|
+
function on(e) {
|
|
89
89
|
return e.replace(/["&<>]/g, t);
|
|
90
90
|
function t(n) {
|
|
91
|
-
return "&" +
|
|
91
|
+
return "&" + Xn[
|
|
92
92
|
/** @type {keyof typeof characterReferences} */
|
|
93
93
|
n
|
|
94
94
|
] + ";";
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Ie(e) {
|
|
98
98
|
return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
function
|
|
100
|
+
const Se = Ae(/[A-Za-z]/), ue = Ae(/[\dA-Za-z]/), Zn = Ae(/[#-'*+\--9=?A-Z^-~]/);
|
|
101
|
+
function bt(e) {
|
|
102
102
|
return (
|
|
103
103
|
// Special whitespace codes (which have negative values), C0 and Control
|
|
104
104
|
// character DEL
|
|
105
105
|
e !== null && (e < 32 || e === 127)
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
108
|
+
const xt = Ae(/\d/), Jn = Ae(/[\dA-Fa-f]/), er = Ae(/[!-/:-@[-`{-~]/);
|
|
109
|
+
function L(e) {
|
|
110
110
|
return e !== null && e < -2;
|
|
111
111
|
}
|
|
112
112
|
function ne(e) {
|
|
@@ -115,15 +115,15 @@ function ne(e) {
|
|
|
115
115
|
function F(e) {
|
|
116
116
|
return e === -2 || e === -1 || e === 32;
|
|
117
117
|
}
|
|
118
|
-
const
|
|
118
|
+
const tr = Ae(new RegExp("\\p{P}|\\p{S}", "u")), nr = Ae(/\s/);
|
|
119
119
|
function Ae(e) {
|
|
120
120
|
return t;
|
|
121
121
|
function t(n) {
|
|
122
122
|
return n !== null && n > -1 && e.test(String.fromCharCode(n));
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const n =
|
|
125
|
+
function Qe(e, t) {
|
|
126
|
+
const n = on(rr(e || ""));
|
|
127
127
|
if (!t)
|
|
128
128
|
return n;
|
|
129
129
|
const r = n.indexOf(":"), o = n.indexOf("?"), i = n.indexOf("#"), a = n.indexOf("/");
|
|
@@ -134,13 +134,13 @@ function je(e, t) {
|
|
|
134
134
|
t.test(n.slice(0, r)) ? n : ""
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function rr(e) {
|
|
138
138
|
const t = [];
|
|
139
139
|
let n = -1, r = 0, o = 0;
|
|
140
140
|
for (; ++n < e.length; ) {
|
|
141
141
|
const i = e.charCodeAt(n);
|
|
142
142
|
let a = "";
|
|
143
|
-
if (i === 37 &&
|
|
143
|
+
if (i === 37 && ue(e.charCodeAt(n + 1)) && ue(e.charCodeAt(n + 2)))
|
|
144
144
|
o = 2;
|
|
145
145
|
else if (i < 128)
|
|
146
146
|
/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i)) || (a = String.fromCharCode(i));
|
|
@@ -153,35 +153,35 @@ function Zn(e) {
|
|
|
153
153
|
}
|
|
154
154
|
return t.join("") + e.slice(r);
|
|
155
155
|
}
|
|
156
|
-
const Ot = {}.hasOwnProperty,
|
|
157
|
-
function
|
|
156
|
+
const Ot = {}.hasOwnProperty, $t = /^(https?|ircs?|mailto|xmpp)$/i, ir = /^https?$/i;
|
|
157
|
+
function or(e) {
|
|
158
158
|
const t = e || {};
|
|
159
159
|
let n = !0;
|
|
160
160
|
const r = {}, o = [[]], i = [], a = [], s = (
|
|
161
161
|
/** @type {NormalizedHtmlExtension} */
|
|
162
|
-
|
|
162
|
+
Yn([{
|
|
163
163
|
enter: {
|
|
164
164
|
blockQuote: R,
|
|
165
165
|
codeFenced: de,
|
|
166
166
|
codeFencedFenceInfo: A,
|
|
167
167
|
codeFencedFenceMeta: A,
|
|
168
168
|
codeIndented: fe,
|
|
169
|
-
codeText:
|
|
170
|
-
content:
|
|
169
|
+
codeText: Z,
|
|
170
|
+
content: je,
|
|
171
171
|
definition: it,
|
|
172
|
-
definitionDestinationString:
|
|
172
|
+
definitionDestinationString: qe,
|
|
173
173
|
definitionLabelString: A,
|
|
174
174
|
definitionTitleString: A,
|
|
175
|
-
emphasis:
|
|
176
|
-
htmlFlow:
|
|
175
|
+
emphasis: Be,
|
|
176
|
+
htmlFlow: le,
|
|
177
177
|
htmlText: ce,
|
|
178
|
-
image:
|
|
178
|
+
image: ae,
|
|
179
179
|
label: A,
|
|
180
180
|
link: _e,
|
|
181
181
|
listItemMarker: T,
|
|
182
|
-
listItemValue:
|
|
182
|
+
listItemValue: N,
|
|
183
183
|
listOrdered: q,
|
|
184
|
-
listUnordered:
|
|
184
|
+
listUnordered: $,
|
|
185
185
|
paragraph: W,
|
|
186
186
|
reference: A,
|
|
187
187
|
resource: Ce,
|
|
@@ -193,51 +193,51 @@ function er(e) {
|
|
|
193
193
|
exit: {
|
|
194
194
|
atxHeading: st,
|
|
195
195
|
atxHeadingSequence: at,
|
|
196
|
-
autolinkEmail:
|
|
196
|
+
autolinkEmail: Dn,
|
|
197
197
|
autolinkProtocol: Nn,
|
|
198
198
|
blockQuote: Q,
|
|
199
199
|
characterEscapeValue: y,
|
|
200
|
-
characterReferenceMarkerHexadecimal:
|
|
201
|
-
characterReferenceMarkerNumeric:
|
|
202
|
-
characterReferenceValue:
|
|
200
|
+
characterReferenceMarkerHexadecimal: Bt,
|
|
201
|
+
characterReferenceMarkerNumeric: Bt,
|
|
202
|
+
characterReferenceValue: $n,
|
|
203
203
|
codeFenced: d,
|
|
204
|
-
codeFencedFence:
|
|
204
|
+
codeFencedFence: oe,
|
|
205
205
|
codeFencedFenceInfo: h,
|
|
206
206
|
codeFencedFenceMeta: M,
|
|
207
|
-
codeFlowValue:
|
|
207
|
+
codeFlowValue: B,
|
|
208
208
|
codeIndented: d,
|
|
209
209
|
codeText: Te,
|
|
210
210
|
codeTextData: y,
|
|
211
211
|
data: y,
|
|
212
|
-
definition:
|
|
213
|
-
definitionDestinationString:
|
|
214
|
-
definitionLabelString:
|
|
212
|
+
definition: We,
|
|
213
|
+
definitionDestinationString: Ue,
|
|
214
|
+
definitionLabelString: Ve,
|
|
215
215
|
definitionTitleString: ot,
|
|
216
216
|
emphasis: pe,
|
|
217
217
|
hardBreakEscape: P,
|
|
218
218
|
hardBreakTrailing: P,
|
|
219
|
-
htmlFlow:
|
|
219
|
+
htmlFlow: xe,
|
|
220
220
|
htmlFlowData: y,
|
|
221
|
-
htmlText:
|
|
221
|
+
htmlText: xe,
|
|
222
222
|
htmlTextData: y,
|
|
223
|
-
image:
|
|
224
|
-
label:
|
|
223
|
+
image: He,
|
|
224
|
+
label: ze,
|
|
225
225
|
labelText: j,
|
|
226
|
-
lineEnding:
|
|
227
|
-
link:
|
|
226
|
+
lineEnding: I,
|
|
227
|
+
link: He,
|
|
228
228
|
listOrdered: E,
|
|
229
229
|
listUnordered: D,
|
|
230
|
-
paragraph:
|
|
230
|
+
paragraph: ie,
|
|
231
231
|
reference: M,
|
|
232
|
-
referenceString:
|
|
232
|
+
referenceString: be,
|
|
233
233
|
resource: M,
|
|
234
234
|
resourceDestinationString: Fe,
|
|
235
235
|
resourceTitleString: rt,
|
|
236
236
|
setextHeading: m,
|
|
237
237
|
setextHeadingLineSequence: ct,
|
|
238
238
|
setextHeadingText: ut,
|
|
239
|
-
strong:
|
|
240
|
-
thematicBreak:
|
|
239
|
+
strong: Pn,
|
|
240
|
+
thematicBreak: On
|
|
241
241
|
}
|
|
242
242
|
}, ...t.htmlExtensions || []])
|
|
243
243
|
), u = {
|
|
@@ -246,145 +246,145 @@ function er(e) {
|
|
|
246
246
|
}, f = {
|
|
247
247
|
buffer: A,
|
|
248
248
|
encode: k,
|
|
249
|
-
getData:
|
|
250
|
-
lineEndingIfNeeded:
|
|
249
|
+
getData: v,
|
|
250
|
+
lineEndingIfNeeded: z,
|
|
251
251
|
options: t,
|
|
252
252
|
raw: _,
|
|
253
|
-
resume:
|
|
254
|
-
setData:
|
|
255
|
-
tag:
|
|
253
|
+
resume: b,
|
|
254
|
+
setData: x,
|
|
255
|
+
tag: S
|
|
256
256
|
};
|
|
257
257
|
let p = t.defaultLineEnding;
|
|
258
258
|
return g;
|
|
259
|
-
function g(
|
|
259
|
+
function g(w) {
|
|
260
260
|
let C = -1, K = 0;
|
|
261
261
|
const ge = [];
|
|
262
|
-
let ye = [],
|
|
263
|
-
for (; ++C <
|
|
264
|
-
!p && (
|
|
265
|
-
|
|
266
|
-
ye = Y(ye,
|
|
267
|
-
const
|
|
268
|
-
for (s.enter.null && s.enter.null.call(f); ++C <
|
|
269
|
-
const Rt = s[
|
|
262
|
+
let ye = [], ve = [];
|
|
263
|
+
for (; ++C < w.length; )
|
|
264
|
+
!p && (w[C][1].type === "lineEnding" || w[C][1].type === "lineEndingBlank") && (p = /** @type {LineEnding} */
|
|
265
|
+
w[C][2].sliceSerialize(w[C][1])), (w[C][1].type === "listOrdered" || w[C][1].type === "listUnordered") && (w[C][0] === "enter" ? ge.push(C) : c(w.slice(ge.pop(), C))), w[C][1].type === "definition" && (w[C][0] === "enter" ? (ve = Y(ve, w.slice(K, C)), K = C) : (ye = Y(ye, w.slice(K, C + 1)), K = C + 1));
|
|
266
|
+
ye = Y(ye, ve), ye = Y(ye, w.slice(K)), C = -1;
|
|
267
|
+
const we = ye;
|
|
268
|
+
for (s.enter.null && s.enter.null.call(f); ++C < w.length; ) {
|
|
269
|
+
const Rt = s[we[C][0]], Mt = we[C][1].type, Ft = Rt[Mt];
|
|
270
270
|
Ot.call(Rt, Mt) && Ft && Ft.call({
|
|
271
|
-
sliceSerialize:
|
|
271
|
+
sliceSerialize: we[C][2].sliceSerialize,
|
|
272
272
|
...f
|
|
273
|
-
},
|
|
273
|
+
}, we[C][1]);
|
|
274
274
|
}
|
|
275
275
|
return s.exit.null && s.exit.null.call(f), o[0].join("");
|
|
276
276
|
}
|
|
277
|
-
function c(
|
|
278
|
-
const C =
|
|
279
|
-
let K = 0, ge = 0, ye = !1,
|
|
277
|
+
function c(w) {
|
|
278
|
+
const C = w.length;
|
|
279
|
+
let K = 0, ge = 0, ye = !1, ve;
|
|
280
280
|
for (; ++K < C; ) {
|
|
281
|
-
const
|
|
282
|
-
if (
|
|
283
|
-
|
|
284
|
-
else switch (
|
|
281
|
+
const we = w[K];
|
|
282
|
+
if (we[1]._container)
|
|
283
|
+
ve = void 0, we[0] === "enter" ? ge++ : ge--;
|
|
284
|
+
else switch (we[1].type) {
|
|
285
285
|
case "listItemPrefix": {
|
|
286
|
-
|
|
286
|
+
we[0] === "exit" && (ve = !0);
|
|
287
287
|
break;
|
|
288
288
|
}
|
|
289
289
|
case "linePrefix":
|
|
290
290
|
break;
|
|
291
291
|
case "lineEndingBlank": {
|
|
292
|
-
|
|
292
|
+
we[0] === "enter" && !ge && (ve ? ve = void 0 : ye = !0);
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
295
|
default:
|
|
296
|
-
|
|
296
|
+
ve = void 0;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
w[0][1]._loose = ye;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
u[
|
|
301
|
+
function x(w, C) {
|
|
302
|
+
u[w] = C;
|
|
303
303
|
}
|
|
304
|
-
function w
|
|
305
|
-
return u[
|
|
304
|
+
function v(w) {
|
|
305
|
+
return u[w];
|
|
306
306
|
}
|
|
307
307
|
function A() {
|
|
308
308
|
o.push([]);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function b() {
|
|
311
311
|
return o.pop().join("");
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
n && (
|
|
313
|
+
function S(w) {
|
|
314
|
+
n && (x("lastWasTag", !0), o[o.length - 1].push(w));
|
|
315
315
|
}
|
|
316
|
-
function _(
|
|
317
|
-
|
|
316
|
+
function _(w) {
|
|
317
|
+
x("lastWasTag"), o[o.length - 1].push(w);
|
|
318
318
|
}
|
|
319
319
|
function O() {
|
|
320
320
|
_(p || `
|
|
321
321
|
`);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
const
|
|
323
|
+
function z() {
|
|
324
|
+
const w = o[o.length - 1], C = w[w.length - 1], K = C ? C.charCodeAt(C.length - 1) : null;
|
|
325
325
|
K === 10 || K === 13 || K === null || O();
|
|
326
326
|
}
|
|
327
|
-
function k(
|
|
328
|
-
return
|
|
327
|
+
function k(w) {
|
|
328
|
+
return v("ignoreEncode") ? w : on(w);
|
|
329
329
|
}
|
|
330
330
|
function M() {
|
|
331
|
-
|
|
331
|
+
b();
|
|
332
332
|
}
|
|
333
|
-
function q(
|
|
334
|
-
a.push(!
|
|
333
|
+
function q(w) {
|
|
334
|
+
a.push(!w._loose), z(), S("<ol"), x("expectFirstItem", !0);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
a.push(!
|
|
336
|
+
function $(w) {
|
|
337
|
+
a.push(!w._loose), z(), S("<ul"), x("expectFirstItem", !0);
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
if (
|
|
341
|
-
const C = Number.parseInt(this.sliceSerialize(
|
|
342
|
-
C !== 1 &&
|
|
339
|
+
function N(w) {
|
|
340
|
+
if (v("expectFirstItem")) {
|
|
341
|
+
const C = Number.parseInt(this.sliceSerialize(w), 10);
|
|
342
|
+
C !== 1 && S(' start="' + k(String(C)) + '"');
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
function T() {
|
|
346
|
-
|
|
346
|
+
v("expectFirstItem") ? S(">") : V(), z(), S("<li>"), x("expectFirstItem"), x("lastWasTag");
|
|
347
347
|
}
|
|
348
348
|
function E() {
|
|
349
|
-
V(), a.pop(), O(),
|
|
349
|
+
V(), a.pop(), O(), S("</ol>");
|
|
350
350
|
}
|
|
351
351
|
function D() {
|
|
352
|
-
V(), a.pop(), O(),
|
|
352
|
+
V(), a.pop(), O(), S("</ul>");
|
|
353
353
|
}
|
|
354
354
|
function V() {
|
|
355
|
-
|
|
355
|
+
v("lastWasTag") && !v("slurpAllLineEndings") && z(), S("</li>"), x("slurpAllLineEndings");
|
|
356
356
|
}
|
|
357
357
|
function R() {
|
|
358
|
-
a.push(!1),
|
|
358
|
+
a.push(!1), z(), S("<blockquote>");
|
|
359
359
|
}
|
|
360
360
|
function Q() {
|
|
361
|
-
a.pop(),
|
|
361
|
+
a.pop(), z(), S("</blockquote>"), x("slurpAllLineEndings");
|
|
362
362
|
}
|
|
363
363
|
function W() {
|
|
364
|
-
a[a.length - 1] || (
|
|
364
|
+
a[a.length - 1] || (z(), S("<p>")), x("slurpAllLineEndings");
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
a[a.length - 1] ?
|
|
366
|
+
function ie() {
|
|
367
|
+
a[a.length - 1] ? x("slurpAllLineEndings", !0) : S("</p>");
|
|
368
368
|
}
|
|
369
369
|
function de() {
|
|
370
|
-
|
|
370
|
+
z(), S("<pre><code"), x("fencesCount", 0);
|
|
371
371
|
}
|
|
372
372
|
function h() {
|
|
373
|
-
const
|
|
374
|
-
|
|
373
|
+
const w = b();
|
|
374
|
+
S(' class="language-' + w + '"');
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
const
|
|
378
|
-
|
|
376
|
+
function oe() {
|
|
377
|
+
const w = v("fencesCount") || 0;
|
|
378
|
+
w || (S(">"), x("slurpOneLineEnding", !0)), x("fencesCount", w + 1);
|
|
379
379
|
}
|
|
380
380
|
function fe() {
|
|
381
|
-
|
|
381
|
+
z(), S("<pre><code>");
|
|
382
382
|
}
|
|
383
383
|
function d() {
|
|
384
|
-
const
|
|
385
|
-
|
|
384
|
+
const w = v("fencesCount");
|
|
385
|
+
w !== void 0 && w < 2 && u.tightStack.length > 0 && !v("lastWasTag") && O(), v("flowCodeSeenData") && z(), S("</code></pre>"), w !== void 0 && w < 2 && z(), x("flowCodeSeenData"), x("fencesCount"), x("slurpOneLineEnding");
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function ae() {
|
|
388
388
|
i.push({
|
|
389
389
|
image: !0
|
|
390
390
|
}), n = void 0;
|
|
@@ -392,147 +392,147 @@ function er(e) {
|
|
|
392
392
|
function _e() {
|
|
393
393
|
i.push({});
|
|
394
394
|
}
|
|
395
|
-
function j(
|
|
396
|
-
i[i.length - 1].labelId = this.sliceSerialize(
|
|
395
|
+
function j(w) {
|
|
396
|
+
i[i.length - 1].labelId = this.sliceSerialize(w);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
i[i.length - 1].label =
|
|
398
|
+
function ze() {
|
|
399
|
+
i[i.length - 1].label = b();
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
i[i.length - 1].referenceId = this.sliceSerialize(
|
|
401
|
+
function be(w) {
|
|
402
|
+
i[i.length - 1].referenceId = this.sliceSerialize(w);
|
|
403
403
|
}
|
|
404
404
|
function Ce() {
|
|
405
405
|
A(), i[i.length - 1].destination = "";
|
|
406
406
|
}
|
|
407
407
|
function Ee() {
|
|
408
|
-
A(),
|
|
408
|
+
A(), x("ignoreEncode", !0);
|
|
409
409
|
}
|
|
410
410
|
function Fe() {
|
|
411
|
-
i[i.length - 1].destination =
|
|
411
|
+
i[i.length - 1].destination = b(), x("ignoreEncode");
|
|
412
412
|
}
|
|
413
413
|
function rt() {
|
|
414
|
-
i[i.length - 1].title =
|
|
414
|
+
i[i.length - 1].title = b();
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
let
|
|
418
|
-
const C = i[
|
|
419
|
-
for (n = !0;
|
|
420
|
-
if (i[
|
|
416
|
+
function He() {
|
|
417
|
+
let w = i.length - 1;
|
|
418
|
+
const C = i[w], K = C.referenceId || C.labelId, ge = C.destination === void 0 ? r[Ie(K)] : C;
|
|
419
|
+
for (n = !0; w--; )
|
|
420
|
+
if (i[w].image) {
|
|
421
421
|
n = void 0;
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
|
-
C.image ? (
|
|
424
|
+
C.image ? (S('<img src="' + Qe(ge.destination, t.allowDangerousProtocol ? void 0 : ir) + '" alt="'), _(C.label), S('"')) : S('<a href="' + Qe(ge.destination, t.allowDangerousProtocol ? void 0 : $t) + '"'), S(ge.title ? ' title="' + ge.title + '"' : ""), C.image ? S(" />") : (S(">"), _(C.label), S("</a>")), i.pop();
|
|
425
425
|
}
|
|
426
426
|
function it() {
|
|
427
427
|
A(), i.push({});
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
|
|
431
|
-
}
|
|
432
|
-
function Ve() {
|
|
433
|
-
A(), b("ignoreEncode", !0);
|
|
429
|
+
function Ve(w) {
|
|
430
|
+
b(), i[i.length - 1].labelId = this.sliceSerialize(w);
|
|
434
431
|
}
|
|
435
432
|
function qe() {
|
|
436
|
-
|
|
437
|
-
}
|
|
438
|
-
function ot() {
|
|
439
|
-
i[i.length - 1].title = x();
|
|
433
|
+
A(), x("ignoreEncode", !0);
|
|
440
434
|
}
|
|
441
435
|
function Ue() {
|
|
442
|
-
|
|
443
|
-
|
|
436
|
+
i[i.length - 1].destination = b(), x("ignoreEncode");
|
|
437
|
+
}
|
|
438
|
+
function ot() {
|
|
439
|
+
i[i.length - 1].title = b();
|
|
444
440
|
}
|
|
445
441
|
function We() {
|
|
446
|
-
|
|
442
|
+
const w = i[i.length - 1], C = Ie(w.labelId);
|
|
443
|
+
b(), Ot.call(r, C) || (r[C] = i[i.length - 1]), i.pop();
|
|
444
|
+
}
|
|
445
|
+
function je() {
|
|
446
|
+
x("slurpAllLineEndings", !0);
|
|
447
447
|
}
|
|
448
|
-
function at(
|
|
449
|
-
|
|
448
|
+
function at(w) {
|
|
449
|
+
v("headingRank") || (x("headingRank", this.sliceSerialize(w).length), z(), S("<h" + v("headingRank") + ">"));
|
|
450
450
|
}
|
|
451
451
|
function lt() {
|
|
452
|
-
A(),
|
|
452
|
+
A(), x("slurpAllLineEndings");
|
|
453
453
|
}
|
|
454
454
|
function ut() {
|
|
455
|
-
|
|
455
|
+
x("slurpAllLineEndings", !0);
|
|
456
456
|
}
|
|
457
457
|
function st() {
|
|
458
|
-
|
|
458
|
+
S("</h" + v("headingRank") + ">"), x("headingRank");
|
|
459
459
|
}
|
|
460
|
-
function ct(
|
|
461
|
-
|
|
460
|
+
function ct(w) {
|
|
461
|
+
x("headingRank", this.sliceSerialize(w).charCodeAt(0) === 61 ? 1 : 2);
|
|
462
462
|
}
|
|
463
463
|
function m() {
|
|
464
|
-
const
|
|
465
|
-
|
|
464
|
+
const w = b();
|
|
465
|
+
z(), S("<h" + v("headingRank") + ">"), _(w), S("</h" + v("headingRank") + ">"), x("slurpAllLineEndings"), x("headingRank");
|
|
466
466
|
}
|
|
467
|
-
function y(
|
|
468
|
-
_(k(this.sliceSerialize(
|
|
467
|
+
function y(w) {
|
|
468
|
+
_(k(this.sliceSerialize(w)));
|
|
469
469
|
}
|
|
470
|
-
function
|
|
471
|
-
if (!
|
|
472
|
-
if (
|
|
473
|
-
|
|
470
|
+
function I(w) {
|
|
471
|
+
if (!v("slurpAllLineEndings")) {
|
|
472
|
+
if (v("slurpOneLineEnding")) {
|
|
473
|
+
x("slurpOneLineEnding");
|
|
474
474
|
return;
|
|
475
475
|
}
|
|
476
|
-
if (
|
|
476
|
+
if (v("inCodeText")) {
|
|
477
477
|
_(" ");
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
|
-
_(k(this.sliceSerialize(
|
|
480
|
+
_(k(this.sliceSerialize(w)));
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
_(k(this.sliceSerialize(
|
|
483
|
+
function B(w) {
|
|
484
|
+
_(k(this.sliceSerialize(w))), x("flowCodeSeenData", !0);
|
|
485
485
|
}
|
|
486
486
|
function P() {
|
|
487
|
-
|
|
487
|
+
S("<br />");
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
|
|
489
|
+
function le() {
|
|
490
|
+
z(), ce();
|
|
491
491
|
}
|
|
492
|
-
function
|
|
493
|
-
|
|
492
|
+
function xe() {
|
|
493
|
+
x("ignoreEncode");
|
|
494
494
|
}
|
|
495
495
|
function ce() {
|
|
496
|
-
t.allowDangerousHtml &&
|
|
496
|
+
t.allowDangerousHtml && x("ignoreEncode", !0);
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
|
|
498
|
+
function Be() {
|
|
499
|
+
S("<em>");
|
|
500
500
|
}
|
|
501
501
|
function Re() {
|
|
502
|
-
|
|
502
|
+
S("<strong>");
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
|
|
504
|
+
function Z() {
|
|
505
|
+
x("inCodeText", !0), S("<code>");
|
|
506
506
|
}
|
|
507
507
|
function Te() {
|
|
508
|
-
|
|
508
|
+
x("inCodeText"), S("</code>");
|
|
509
509
|
}
|
|
510
510
|
function pe() {
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
function Fn() {
|
|
514
|
-
v("</strong>");
|
|
511
|
+
S("</em>");
|
|
515
512
|
}
|
|
516
513
|
function Pn() {
|
|
517
|
-
|
|
514
|
+
S("</strong>");
|
|
515
|
+
}
|
|
516
|
+
function On() {
|
|
517
|
+
z(), S("<hr />");
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
519
|
+
function Bt(w) {
|
|
520
|
+
x("characterReferenceType", w.type);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
const C = this.sliceSerialize(
|
|
522
|
+
function $n(w) {
|
|
523
|
+
const C = this.sliceSerialize(w), K = v("characterReferenceType") ? vt(C, v("characterReferenceType") === "characterReferenceMarkerNumeric" ? 10 : 16) : Je(C);
|
|
524
524
|
_(k(
|
|
525
525
|
/** @type {string} */
|
|
526
526
|
K
|
|
527
|
-
)),
|
|
527
|
+
)), x("characterReferenceType");
|
|
528
528
|
}
|
|
529
|
-
function Nn(
|
|
530
|
-
const C = this.sliceSerialize(
|
|
531
|
-
|
|
529
|
+
function Nn(w) {
|
|
530
|
+
const C = this.sliceSerialize(w);
|
|
531
|
+
S('<a href="' + Qe(C, t.allowDangerousProtocol ? void 0 : $t) + '">'), _(k(C)), S("</a>");
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const C = this.sliceSerialize(
|
|
535
|
-
|
|
533
|
+
function Dn(w) {
|
|
534
|
+
const C = this.sliceSerialize(w);
|
|
535
|
+
S('<a href="' + Qe("mailto:" + C) + '">'), _(k(C)), S("</a>");
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
function H(e, t, n, r) {
|
|
@@ -546,10 +546,10 @@ function H(e, t, n, r) {
|
|
|
546
546
|
return F(s) && i++ < o ? (e.consume(s), l) : (e.exit(n), t(s));
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
const
|
|
550
|
-
tokenize:
|
|
549
|
+
const ar = {
|
|
550
|
+
tokenize: lr
|
|
551
551
|
};
|
|
552
|
-
function
|
|
552
|
+
function lr(e) {
|
|
553
553
|
const t = e.attempt(this.parser.constructs.contentInitial, r, o);
|
|
554
554
|
let n;
|
|
555
555
|
return t;
|
|
@@ -575,15 +575,15 @@ function nr(e) {
|
|
|
575
575
|
e.exit("chunkText"), e.exit("paragraph"), e.consume(l);
|
|
576
576
|
return;
|
|
577
577
|
}
|
|
578
|
-
return
|
|
578
|
+
return L(l) ? (e.consume(l), e.exit("chunkText"), i) : (e.consume(l), a);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
const
|
|
582
|
-
tokenize:
|
|
583
|
-
},
|
|
584
|
-
tokenize:
|
|
581
|
+
const ur = {
|
|
582
|
+
tokenize: sr
|
|
583
|
+
}, Nt = {
|
|
584
|
+
tokenize: cr
|
|
585
585
|
};
|
|
586
|
-
function
|
|
586
|
+
function sr(e) {
|
|
587
587
|
const t = this, n = [];
|
|
588
588
|
let r = 0, o, i, a;
|
|
589
589
|
return l;
|
|
@@ -596,21 +596,21 @@ function ir(e) {
|
|
|
596
596
|
}
|
|
597
597
|
function s(_) {
|
|
598
598
|
if (r++, t.containerState._closeFlow) {
|
|
599
|
-
t.containerState._closeFlow = void 0, o &&
|
|
599
|
+
t.containerState._closeFlow = void 0, o && S();
|
|
600
600
|
const O = t.events.length;
|
|
601
|
-
let
|
|
602
|
-
for (;
|
|
603
|
-
if (t.events[
|
|
604
|
-
k = t.events[
|
|
601
|
+
let z = O, k;
|
|
602
|
+
for (; z--; )
|
|
603
|
+
if (t.events[z][0] === "exit" && t.events[z][1].type === "chunkFlow") {
|
|
604
|
+
k = t.events[z][1].end;
|
|
605
605
|
break;
|
|
606
606
|
}
|
|
607
|
-
|
|
607
|
+
b(r);
|
|
608
608
|
let M = O;
|
|
609
609
|
for (; M < t.events.length; )
|
|
610
610
|
t.events[M][1].end = {
|
|
611
611
|
...k
|
|
612
612
|
}, M++;
|
|
613
|
-
return
|
|
613
|
+
return se(t.events, z + 1, 0, t.events.slice(O)), t.events.length = M, u(_);
|
|
614
614
|
}
|
|
615
615
|
return l(_);
|
|
616
616
|
}
|
|
@@ -619,44 +619,44 @@ function ir(e) {
|
|
|
619
619
|
if (!o)
|
|
620
620
|
return g(_);
|
|
621
621
|
if (o.currentConstruct && o.currentConstruct.concrete)
|
|
622
|
-
return
|
|
622
|
+
return x(_);
|
|
623
623
|
t.interrupt = !!(o.currentConstruct && !o._gfmTableDynamicInterruptHack);
|
|
624
624
|
}
|
|
625
|
-
return t.containerState = {}, e.check(
|
|
625
|
+
return t.containerState = {}, e.check(Nt, f, p)(_);
|
|
626
626
|
}
|
|
627
627
|
function f(_) {
|
|
628
|
-
return o &&
|
|
628
|
+
return o && S(), b(r), g(_);
|
|
629
629
|
}
|
|
630
630
|
function p(_) {
|
|
631
|
-
return t.parser.lazy[t.now().line] = r !== n.length, a = t.now().offset,
|
|
631
|
+
return t.parser.lazy[t.now().line] = r !== n.length, a = t.now().offset, x(_);
|
|
632
632
|
}
|
|
633
633
|
function g(_) {
|
|
634
|
-
return t.containerState = {}, e.attempt(
|
|
634
|
+
return t.containerState = {}, e.attempt(Nt, c, x)(_);
|
|
635
635
|
}
|
|
636
636
|
function c(_) {
|
|
637
637
|
return r++, n.push([t.currentConstruct, t.containerState]), g(_);
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function x(_) {
|
|
640
640
|
if (_ === null) {
|
|
641
|
-
o &&
|
|
641
|
+
o && S(), b(0), e.consume(_);
|
|
642
642
|
return;
|
|
643
643
|
}
|
|
644
644
|
return o = o || t.parser.flow(t.now()), e.enter("chunkFlow", {
|
|
645
645
|
_tokenizer: o,
|
|
646
646
|
contentType: "flow",
|
|
647
647
|
previous: i
|
|
648
|
-
}),
|
|
648
|
+
}), v(_);
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function v(_) {
|
|
651
651
|
if (_ === null) {
|
|
652
|
-
A(e.exit("chunkFlow"), !0),
|
|
652
|
+
A(e.exit("chunkFlow"), !0), b(0), e.consume(_);
|
|
653
653
|
return;
|
|
654
654
|
}
|
|
655
|
-
return
|
|
655
|
+
return L(_) ? (e.consume(_), A(e.exit("chunkFlow")), r = 0, t.interrupt = void 0, l) : (e.consume(_), v);
|
|
656
656
|
}
|
|
657
657
|
function A(_, O) {
|
|
658
|
-
const
|
|
659
|
-
if (O &&
|
|
658
|
+
const z = t.sliceStream(_);
|
|
659
|
+
if (O && z.push(null), _.previous = i, i && (i.next = _), i = _, o.defineSkip(_.start), o.write(z), t.parser.lazy[_.start.line]) {
|
|
660
660
|
let k = o.events.length;
|
|
661
661
|
for (; k--; )
|
|
662
662
|
if (
|
|
@@ -667,41 +667,41 @@ function ir(e) {
|
|
|
667
667
|
)
|
|
668
668
|
return;
|
|
669
669
|
const M = t.events.length;
|
|
670
|
-
let q = M, N
|
|
670
|
+
let q = M, $, N;
|
|
671
671
|
for (; q--; )
|
|
672
672
|
if (t.events[q][0] === "exit" && t.events[q][1].type === "chunkFlow") {
|
|
673
|
-
if (
|
|
674
|
-
|
|
673
|
+
if ($) {
|
|
674
|
+
N = t.events[q][1].end;
|
|
675
675
|
break;
|
|
676
676
|
}
|
|
677
|
-
|
|
677
|
+
$ = !0;
|
|
678
678
|
}
|
|
679
|
-
for (
|
|
679
|
+
for (b(r), k = M; k < t.events.length; )
|
|
680
680
|
t.events[k][1].end = {
|
|
681
|
-
|
|
681
|
+
...N
|
|
682
682
|
}, k++;
|
|
683
|
-
|
|
683
|
+
se(t.events, q + 1, 0, t.events.slice(M)), t.events.length = k;
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function b(_) {
|
|
687
687
|
let O = n.length;
|
|
688
688
|
for (; O-- > _; ) {
|
|
689
|
-
const
|
|
690
|
-
t.containerState =
|
|
689
|
+
const z = n[O];
|
|
690
|
+
t.containerState = z[1], z[0].exit.call(t, e);
|
|
691
691
|
}
|
|
692
692
|
n.length = _;
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function S() {
|
|
695
695
|
o.write([null]), i = void 0, o = void 0, t.containerState._closeFlow = void 0;
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function cr(e, t, n) {
|
|
699
699
|
return H(e, e.attempt(this.parser.constructs.document, t, n), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
|
|
700
700
|
}
|
|
701
701
|
function Ge(e) {
|
|
702
|
-
if (e === null || ne(e) ||
|
|
702
|
+
if (e === null || ne(e) || nr(e))
|
|
703
703
|
return 1;
|
|
704
|
-
if (
|
|
704
|
+
if (tr(e))
|
|
705
705
|
return 2;
|
|
706
706
|
}
|
|
707
707
|
function et(e, t, n) {
|
|
@@ -715,10 +715,10 @@ function et(e, t, n) {
|
|
|
715
715
|
}
|
|
716
716
|
const yt = {
|
|
717
717
|
name: "attention",
|
|
718
|
-
resolveAll:
|
|
719
|
-
tokenize:
|
|
718
|
+
resolveAll: hr,
|
|
719
|
+
tokenize: dr
|
|
720
720
|
};
|
|
721
|
-
function
|
|
721
|
+
function hr(e, t) {
|
|
722
722
|
let n = -1, r, o, i, a, l, s, u, f;
|
|
723
723
|
for (; ++n < e.length; )
|
|
724
724
|
if (e[n][0] === "enter" && e[n][1].type === "attentionSequence" && e[n][1]._close) {
|
|
@@ -765,7 +765,7 @@ function ar(e, t) {
|
|
|
765
765
|
...a.start
|
|
766
766
|
}, e[n][1].start = {
|
|
767
767
|
...l.end
|
|
768
|
-
}, u = [], e[r][1].end.offset - e[r][1].start.offset && (u = Y(u, [["enter", e[r][1], t], ["exit", e[r][1], t]])), u = Y(u, [["enter", o, t], ["enter", a, t], ["exit", a, t], ["enter", i, t]]), u = Y(u, et(t.parser.constructs.insideSpan.null, e.slice(r + 1, n), t)), u = Y(u, [["exit", i, t], ["enter", l, t], ["exit", l, t], ["exit", o, t]]), e[n][1].end.offset - e[n][1].start.offset ? (f = 2, u = Y(u, [["enter", e[n][1], t], ["exit", e[n][1], t]])) : f = 0,
|
|
768
|
+
}, u = [], e[r][1].end.offset - e[r][1].start.offset && (u = Y(u, [["enter", e[r][1], t], ["exit", e[r][1], t]])), u = Y(u, [["enter", o, t], ["enter", a, t], ["exit", a, t], ["enter", i, t]]), u = Y(u, et(t.parser.constructs.insideSpan.null, e.slice(r + 1, n), t)), u = Y(u, [["exit", i, t], ["enter", l, t], ["exit", l, t], ["exit", o, t]]), e[n][1].end.offset - e[n][1].start.offset ? (f = 2, u = Y(u, [["enter", e[n][1], t], ["exit", e[n][1], t]])) : f = 0, se(e, r - 1, n - r + 3, u), n = r + u.length - f - 2;
|
|
769
769
|
break;
|
|
770
770
|
}
|
|
771
771
|
}
|
|
@@ -773,7 +773,7 @@ function ar(e, t) {
|
|
|
773
773
|
e[n][1].type === "attentionSequence" && (e[n][1].type = "data");
|
|
774
774
|
return e;
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function dr(e, t) {
|
|
777
777
|
const n = this.parser.constructs.attentionMarkers.null, r = this.previous, o = Ge(r);
|
|
778
778
|
let i;
|
|
779
779
|
return a;
|
|
@@ -790,67 +790,67 @@ function lr(e, t) {
|
|
|
790
790
|
function Dt(e, t) {
|
|
791
791
|
e.column += t, e.offset += t, e._bufferIndex += t;
|
|
792
792
|
}
|
|
793
|
-
const
|
|
793
|
+
const fr = {
|
|
794
794
|
name: "autolink",
|
|
795
|
-
tokenize:
|
|
795
|
+
tokenize: pr
|
|
796
796
|
};
|
|
797
|
-
function
|
|
797
|
+
function pr(e, t, n) {
|
|
798
798
|
let r = 0;
|
|
799
799
|
return o;
|
|
800
800
|
function o(c) {
|
|
801
801
|
return e.enter("autolink"), e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.enter("autolinkProtocol"), i;
|
|
802
802
|
}
|
|
803
803
|
function i(c) {
|
|
804
|
-
return
|
|
804
|
+
return Se(c) ? (e.consume(c), a) : c === 64 ? n(c) : u(c);
|
|
805
805
|
}
|
|
806
806
|
function a(c) {
|
|
807
|
-
return c === 43 || c === 45 || c === 46 ||
|
|
807
|
+
return c === 43 || c === 45 || c === 46 || ue(c) ? (r = 1, l(c)) : u(c);
|
|
808
808
|
}
|
|
809
809
|
function l(c) {
|
|
810
|
-
return c === 58 ? (e.consume(c), r = 0, s) : (c === 43 || c === 45 || c === 46 ||
|
|
810
|
+
return c === 58 ? (e.consume(c), r = 0, s) : (c === 43 || c === 45 || c === 46 || ue(c)) && r++ < 32 ? (e.consume(c), l) : (r = 0, u(c));
|
|
811
811
|
}
|
|
812
812
|
function s(c) {
|
|
813
|
-
return c === 62 ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.exit("autolink"), t) : c === null || c === 32 || c === 60 ||
|
|
813
|
+
return c === 62 ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.exit("autolink"), t) : c === null || c === 32 || c === 60 || bt(c) ? n(c) : (e.consume(c), s);
|
|
814
814
|
}
|
|
815
815
|
function u(c) {
|
|
816
|
-
return c === 64 ? (e.consume(c), f) :
|
|
816
|
+
return c === 64 ? (e.consume(c), f) : Zn(c) ? (e.consume(c), u) : n(c);
|
|
817
817
|
}
|
|
818
818
|
function f(c) {
|
|
819
|
-
return
|
|
819
|
+
return ue(c) ? p(c) : n(c);
|
|
820
820
|
}
|
|
821
821
|
function p(c) {
|
|
822
822
|
return c === 46 ? (e.consume(c), r = 0, f) : c === 62 ? (e.exit("autolinkProtocol").type = "autolinkEmail", e.enter("autolinkMarker"), e.consume(c), e.exit("autolinkMarker"), e.exit("autolink"), t) : g(c);
|
|
823
823
|
}
|
|
824
824
|
function g(c) {
|
|
825
|
-
if ((c === 45 ||
|
|
826
|
-
const
|
|
827
|
-
return e.consume(c),
|
|
825
|
+
if ((c === 45 || ue(c)) && r++ < 63) {
|
|
826
|
+
const x = c === 45 ? g : p;
|
|
827
|
+
return e.consume(c), x;
|
|
828
828
|
}
|
|
829
829
|
return n(c);
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
832
|
const tt = {
|
|
833
833
|
partial: !0,
|
|
834
|
-
tokenize:
|
|
834
|
+
tokenize: gr
|
|
835
835
|
};
|
|
836
|
-
function
|
|
836
|
+
function gr(e, t, n) {
|
|
837
837
|
return r;
|
|
838
838
|
function r(i) {
|
|
839
839
|
return F(i) ? H(e, o, "linePrefix")(i) : o(i);
|
|
840
840
|
}
|
|
841
841
|
function o(i) {
|
|
842
|
-
return i === null ||
|
|
842
|
+
return i === null || L(i) ? t(i) : n(i);
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
const
|
|
845
|
+
const an = {
|
|
846
846
|
continuation: {
|
|
847
|
-
tokenize:
|
|
847
|
+
tokenize: kr
|
|
848
848
|
},
|
|
849
|
-
exit:
|
|
849
|
+
exit: br,
|
|
850
850
|
name: "blockQuote",
|
|
851
|
-
tokenize:
|
|
851
|
+
tokenize: mr
|
|
852
852
|
};
|
|
853
|
-
function
|
|
853
|
+
function mr(e, t, n) {
|
|
854
854
|
const r = this;
|
|
855
855
|
return o;
|
|
856
856
|
function o(a) {
|
|
@@ -866,37 +866,37 @@ function hr(e, t, n) {
|
|
|
866
866
|
return F(a) ? (e.enter("blockQuotePrefixWhitespace"), e.consume(a), e.exit("blockQuotePrefixWhitespace"), e.exit("blockQuotePrefix"), t) : (e.exit("blockQuotePrefix"), t(a));
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function kr(e, t, n) {
|
|
870
870
|
const r = this;
|
|
871
871
|
return o;
|
|
872
872
|
function o(a) {
|
|
873
873
|
return F(a) ? H(e, i, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a) : i(a);
|
|
874
874
|
}
|
|
875
875
|
function i(a) {
|
|
876
|
-
return e.attempt(
|
|
876
|
+
return e.attempt(an, t, n)(a);
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function br(e) {
|
|
880
880
|
e.exit("blockQuote");
|
|
881
881
|
}
|
|
882
|
-
const
|
|
882
|
+
const ln = {
|
|
883
883
|
name: "characterEscape",
|
|
884
|
-
tokenize:
|
|
884
|
+
tokenize: xr
|
|
885
885
|
};
|
|
886
|
-
function
|
|
886
|
+
function xr(e, t, n) {
|
|
887
887
|
return r;
|
|
888
888
|
function r(i) {
|
|
889
889
|
return e.enter("characterEscape"), e.enter("escapeMarker"), e.consume(i), e.exit("escapeMarker"), o;
|
|
890
890
|
}
|
|
891
891
|
function o(i) {
|
|
892
|
-
return
|
|
892
|
+
return er(i) ? (e.enter("characterEscapeValue"), e.consume(i), e.exit("characterEscapeValue"), e.exit("characterEscape"), t) : n(i);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
|
-
const
|
|
895
|
+
const un = {
|
|
896
896
|
name: "characterReference",
|
|
897
|
-
tokenize:
|
|
897
|
+
tokenize: yr
|
|
898
898
|
};
|
|
899
|
-
function
|
|
899
|
+
function yr(e, t, n) {
|
|
900
900
|
const r = this;
|
|
901
901
|
let o = 0, i, a;
|
|
902
902
|
return l;
|
|
@@ -904,31 +904,31 @@ function gr(e, t, n) {
|
|
|
904
904
|
return e.enter("characterReference"), e.enter("characterReferenceMarker"), e.consume(p), e.exit("characterReferenceMarker"), s;
|
|
905
905
|
}
|
|
906
906
|
function s(p) {
|
|
907
|
-
return p === 35 ? (e.enter("characterReferenceMarkerNumeric"), e.consume(p), e.exit("characterReferenceMarkerNumeric"), u) : (e.enter("characterReferenceValue"), i = 31, a =
|
|
907
|
+
return p === 35 ? (e.enter("characterReferenceMarkerNumeric"), e.consume(p), e.exit("characterReferenceMarkerNumeric"), u) : (e.enter("characterReferenceValue"), i = 31, a = ue, f(p));
|
|
908
908
|
}
|
|
909
909
|
function u(p) {
|
|
910
|
-
return p === 88 || p === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(p), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), i = 6, a =
|
|
910
|
+
return p === 88 || p === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(p), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), i = 6, a = Jn, f) : (e.enter("characterReferenceValue"), i = 7, a = xt, f(p));
|
|
911
911
|
}
|
|
912
912
|
function f(p) {
|
|
913
913
|
if (p === 59 && o) {
|
|
914
914
|
const g = e.exit("characterReferenceValue");
|
|
915
|
-
return a ===
|
|
915
|
+
return a === ue && !Je(r.sliceSerialize(g)) ? n(p) : (e.enter("characterReferenceMarker"), e.consume(p), e.exit("characterReferenceMarker"), e.exit("characterReference"), t);
|
|
916
916
|
}
|
|
917
917
|
return a(p) && o++ < i ? (e.consume(p), f) : n(p);
|
|
918
918
|
}
|
|
919
919
|
}
|
|
920
920
|
const Ht = {
|
|
921
921
|
partial: !0,
|
|
922
|
-
tokenize:
|
|
922
|
+
tokenize: Sr
|
|
923
923
|
}, Vt = {
|
|
924
924
|
concrete: !0,
|
|
925
925
|
name: "codeFenced",
|
|
926
|
-
tokenize:
|
|
926
|
+
tokenize: wr
|
|
927
927
|
};
|
|
928
|
-
function
|
|
928
|
+
function wr(e, t, n) {
|
|
929
929
|
const r = this, o = {
|
|
930
930
|
partial: !0,
|
|
931
|
-
tokenize:
|
|
931
|
+
tokenize: z
|
|
932
932
|
};
|
|
933
933
|
let i = 0, a = 0, l;
|
|
934
934
|
return s;
|
|
@@ -943,43 +943,43 @@ function mr(e, t, n) {
|
|
|
943
943
|
return k === l ? (a++, e.consume(k), f) : a < 3 ? n(k) : (e.exit("codeFencedFenceSequence"), F(k) ? H(e, p, "whitespace")(k) : p(k));
|
|
944
944
|
}
|
|
945
945
|
function p(k) {
|
|
946
|
-
return k === null ||
|
|
946
|
+
return k === null || L(k) ? (e.exit("codeFencedFence"), r.interrupt ? t(k) : e.check(Ht, v, O)(k)) : (e.enter("codeFencedFenceInfo"), e.enter("chunkString", {
|
|
947
947
|
contentType: "string"
|
|
948
948
|
}), g(k));
|
|
949
949
|
}
|
|
950
950
|
function g(k) {
|
|
951
|
-
return k === null ||
|
|
951
|
+
return k === null || L(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), p(k)) : F(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceInfo"), H(e, c, "whitespace")(k)) : k === 96 && k === l ? n(k) : (e.consume(k), g);
|
|
952
952
|
}
|
|
953
953
|
function c(k) {
|
|
954
|
-
return k === null ||
|
|
954
|
+
return k === null || L(k) ? p(k) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
|
|
955
955
|
contentType: "string"
|
|
956
|
-
}),
|
|
956
|
+
}), x(k));
|
|
957
957
|
}
|
|
958
|
-
function
|
|
959
|
-
return k === null ||
|
|
958
|
+
function x(k) {
|
|
959
|
+
return k === null || L(k) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(k)) : k === 96 && k === l ? n(k) : (e.consume(k), x);
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function v(k) {
|
|
962
962
|
return e.attempt(o, O, A)(k);
|
|
963
963
|
}
|
|
964
964
|
function A(k) {
|
|
965
|
-
return e.enter("lineEnding"), e.consume(k), e.exit("lineEnding"),
|
|
965
|
+
return e.enter("lineEnding"), e.consume(k), e.exit("lineEnding"), b;
|
|
966
966
|
}
|
|
967
|
-
function
|
|
968
|
-
return i > 0 && F(k) ? H(e,
|
|
967
|
+
function b(k) {
|
|
968
|
+
return i > 0 && F(k) ? H(e, S, "linePrefix", i + 1)(k) : S(k);
|
|
969
969
|
}
|
|
970
|
-
function
|
|
971
|
-
return k === null ||
|
|
970
|
+
function S(k) {
|
|
971
|
+
return k === null || L(k) ? e.check(Ht, v, O)(k) : (e.enter("codeFlowValue"), _(k));
|
|
972
972
|
}
|
|
973
973
|
function _(k) {
|
|
974
|
-
return k === null ||
|
|
974
|
+
return k === null || L(k) ? (e.exit("codeFlowValue"), S(k)) : (e.consume(k), _);
|
|
975
975
|
}
|
|
976
976
|
function O(k) {
|
|
977
977
|
return e.exit("codeFenced"), t(k);
|
|
978
978
|
}
|
|
979
|
-
function
|
|
980
|
-
let
|
|
981
|
-
return
|
|
982
|
-
function
|
|
979
|
+
function z(k, M, q) {
|
|
980
|
+
let $ = 0;
|
|
981
|
+
return N;
|
|
982
|
+
function N(R) {
|
|
983
983
|
return k.enter("lineEnding"), k.consume(R), k.exit("lineEnding"), T;
|
|
984
984
|
}
|
|
985
985
|
function T(R) {
|
|
@@ -989,14 +989,14 @@ function mr(e, t, n) {
|
|
|
989
989
|
return R === l ? (k.enter("codeFencedFenceSequence"), D(R)) : q(R);
|
|
990
990
|
}
|
|
991
991
|
function D(R) {
|
|
992
|
-
return R === l ? (
|
|
992
|
+
return R === l ? ($++, k.consume(R), D) : $ >= a ? (k.exit("codeFencedFenceSequence"), F(R) ? H(k, V, "whitespace")(R) : V(R)) : q(R);
|
|
993
993
|
}
|
|
994
994
|
function V(R) {
|
|
995
|
-
return R === null ||
|
|
995
|
+
return R === null || L(R) ? (k.exit("codeFencedFence"), M(R)) : q(R);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Sr(e, t, n) {
|
|
1000
1000
|
const r = this;
|
|
1001
1001
|
return o;
|
|
1002
1002
|
function o(a) {
|
|
@@ -1008,12 +1008,12 @@ function kr(e, t, n) {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
const ht = {
|
|
1010
1010
|
name: "codeIndented",
|
|
1011
|
-
tokenize:
|
|
1012
|
-
},
|
|
1011
|
+
tokenize: vr
|
|
1012
|
+
}, _r = {
|
|
1013
1013
|
partial: !0,
|
|
1014
|
-
tokenize:
|
|
1014
|
+
tokenize: Cr
|
|
1015
1015
|
};
|
|
1016
|
-
function
|
|
1016
|
+
function vr(e, t, n) {
|
|
1017
1017
|
const r = this;
|
|
1018
1018
|
return o;
|
|
1019
1019
|
function o(u) {
|
|
@@ -1024,33 +1024,33 @@ function br(e, t, n) {
|
|
|
1024
1024
|
return f && f[1].type === "linePrefix" && f[2].sliceSerialize(f[1], !0).length >= 4 ? a(u) : n(u);
|
|
1025
1025
|
}
|
|
1026
1026
|
function a(u) {
|
|
1027
|
-
return u === null ? s(u) :
|
|
1027
|
+
return u === null ? s(u) : L(u) ? e.attempt(_r, a, s)(u) : (e.enter("codeFlowValue"), l(u));
|
|
1028
1028
|
}
|
|
1029
1029
|
function l(u) {
|
|
1030
|
-
return u === null ||
|
|
1030
|
+
return u === null || L(u) ? (e.exit("codeFlowValue"), a(u)) : (e.consume(u), l);
|
|
1031
1031
|
}
|
|
1032
1032
|
function s(u) {
|
|
1033
1033
|
return e.exit("codeIndented"), t(u);
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function Cr(e, t, n) {
|
|
1037
1037
|
const r = this;
|
|
1038
1038
|
return o;
|
|
1039
1039
|
function o(a) {
|
|
1040
|
-
return r.parser.lazy[r.now().line] ? n(a) :
|
|
1040
|
+
return r.parser.lazy[r.now().line] ? n(a) : L(a) ? (e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), o) : H(e, i, "linePrefix", 5)(a);
|
|
1041
1041
|
}
|
|
1042
1042
|
function i(a) {
|
|
1043
1043
|
const l = r.events[r.events.length - 1];
|
|
1044
|
-
return l && l[1].type === "linePrefix" && l[2].sliceSerialize(l[1], !0).length >= 4 ? t(a) :
|
|
1044
|
+
return l && l[1].type === "linePrefix" && l[2].sliceSerialize(l[1], !0).length >= 4 ? t(a) : L(a) ? o(a) : n(a);
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
const
|
|
1047
|
+
const Er = {
|
|
1048
1048
|
name: "codeText",
|
|
1049
|
-
previous:
|
|
1050
|
-
resolve:
|
|
1051
|
-
tokenize:
|
|
1049
|
+
previous: Lr,
|
|
1050
|
+
resolve: Tr,
|
|
1051
|
+
tokenize: Ir
|
|
1052
1052
|
};
|
|
1053
|
-
function
|
|
1053
|
+
function Tr(e) {
|
|
1054
1054
|
let t = e.length - 4, n = 3, r, o;
|
|
1055
1055
|
if ((e[n][1].type === "lineEnding" || e[n][1].type === "space") && (e[t][1].type === "lineEnding" || e[t][1].type === "space")) {
|
|
1056
1056
|
for (r = n; ++r < t; )
|
|
@@ -1063,10 +1063,10 @@ function vr(e) {
|
|
|
1063
1063
|
o === void 0 ? r !== t && e[r][1].type !== "lineEnding" && (o = r) : (r === t || e[r][1].type === "lineEnding") && (e[o][1].type = "codeTextData", r !== o + 2 && (e[o][1].end = e[r - 1][1].end, e.splice(o + 2, r - o - 2), t -= r - o - 2, r = o + 2), o = void 0);
|
|
1064
1064
|
return e;
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function Lr(e) {
|
|
1067
1067
|
return e !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1069
|
+
function Ir(e, t, n) {
|
|
1070
1070
|
let r = 0, o, i;
|
|
1071
1071
|
return a;
|
|
1072
1072
|
function a(p) {
|
|
@@ -1076,16 +1076,16 @@ function wr(e, t, n) {
|
|
|
1076
1076
|
return p === 96 ? (e.consume(p), r++, l) : (e.exit("codeTextSequence"), s(p));
|
|
1077
1077
|
}
|
|
1078
1078
|
function s(p) {
|
|
1079
|
-
return p === null ? n(p) : p === 32 ? (e.enter("space"), e.consume(p), e.exit("space"), s) : p === 96 ? (i = e.enter("codeTextSequence"), o = 0, f(p)) :
|
|
1079
|
+
return p === null ? n(p) : p === 32 ? (e.enter("space"), e.consume(p), e.exit("space"), s) : p === 96 ? (i = e.enter("codeTextSequence"), o = 0, f(p)) : L(p) ? (e.enter("lineEnding"), e.consume(p), e.exit("lineEnding"), s) : (e.enter("codeTextData"), u(p));
|
|
1080
1080
|
}
|
|
1081
1081
|
function u(p) {
|
|
1082
|
-
return p === null || p === 32 || p === 96 ||
|
|
1082
|
+
return p === null || p === 32 || p === 96 || L(p) ? (e.exit("codeTextData"), s(p)) : (e.consume(p), u);
|
|
1083
1083
|
}
|
|
1084
1084
|
function f(p) {
|
|
1085
1085
|
return p === 96 ? (e.consume(p), o++, f) : o === r ? (e.exit("codeTextSequence"), e.exit("codeText"), t(p)) : (i.type = "codeTextData", u(p));
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
|
-
class
|
|
1088
|
+
class Ar {
|
|
1089
1089
|
/**
|
|
1090
1090
|
* @param {ReadonlyArray<T> | null | undefined} [initial]
|
|
1091
1091
|
* Initial items (optional).
|
|
@@ -1257,10 +1257,10 @@ function Oe(e, t) {
|
|
|
1257
1257
|
for (; n < t.length; )
|
|
1258
1258
|
e.push(...t.slice(n, n + 1e4)), n += 1e4;
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function sn(e) {
|
|
1261
1261
|
const t = {};
|
|
1262
1262
|
let n = -1, r, o, i, a, l, s, u;
|
|
1263
|
-
const f = new
|
|
1263
|
+
const f = new Ar(e);
|
|
1264
1264
|
for (; ++n < f.length; ) {
|
|
1265
1265
|
for (; n in t; )
|
|
1266
1266
|
n = t[n];
|
|
@@ -1268,7 +1268,7 @@ function un(e) {
|
|
|
1268
1268
|
for (; ++i < s.length && s[i][1].type !== "content"; )
|
|
1269
1269
|
s[i][1].type === "chunkText" && (s[i][1]._isInFirstContentOfListItem = !0, i++);
|
|
1270
1270
|
if (r[0] === "enter")
|
|
1271
|
-
r[1].contentType && (Object.assign(t,
|
|
1271
|
+
r[1].contentType && (Object.assign(t, zr(f, n)), n = t[n], u = !0);
|
|
1272
1272
|
else if (r[1]._container) {
|
|
1273
1273
|
for (i = n, o = void 0; i--; )
|
|
1274
1274
|
if (a = f.get(i), a[1].type === "lineEnding" || a[1].type === "lineEndingBlank")
|
|
@@ -1279,17 +1279,17 @@ function un(e) {
|
|
|
1279
1279
|
}, l = f.slice(o, n), l.unshift(r), f.splice(o, n - o + 1, l));
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
|
-
return
|
|
1282
|
+
return se(e, 0, Number.POSITIVE_INFINITY, f.slice(0)), !u;
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function zr(e, t) {
|
|
1285
1285
|
const n = e.get(t)[1], r = e.get(t)[2];
|
|
1286
1286
|
let o = t - 1;
|
|
1287
1287
|
const i = [];
|
|
1288
1288
|
let a = n._tokenizer;
|
|
1289
1289
|
a || (a = r.parser[n.contentType](n.start), n._contentTypeTextTrailing && (a._contentTypeTextTrailing = !0));
|
|
1290
1290
|
const l = a.events, s = [], u = {};
|
|
1291
|
-
let f, p, g = -1, c = n,
|
|
1292
|
-
const A = [
|
|
1291
|
+
let f, p, g = -1, c = n, x = 0, v = 0;
|
|
1292
|
+
const A = [v];
|
|
1293
1293
|
for (; c; ) {
|
|
1294
1294
|
for (; e.get(++o)[1] !== c; )
|
|
1295
1295
|
;
|
|
@@ -1297,26 +1297,26 @@ function Er(e, t) {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
for (c = n; ++g < l.length; )
|
|
1299
1299
|
// Find a void token that includes a break.
|
|
1300
|
-
l[g][0] === "exit" && l[g - 1][0] === "enter" && l[g][1].type === l[g - 1][1].type && l[g][1].start.line !== l[g][1].end.line && (
|
|
1300
|
+
l[g][0] === "exit" && l[g - 1][0] === "enter" && l[g][1].type === l[g - 1][1].type && l[g][1].start.line !== l[g][1].end.line && (v = g + 1, A.push(v), c._tokenizer = void 0, c.previous = void 0, c = c.next);
|
|
1301
1301
|
for (a.events = [], c ? (c._tokenizer = void 0, c.previous = void 0) : A.pop(), g = A.length; g--; ) {
|
|
1302
|
-
const
|
|
1303
|
-
s.push([
|
|
1302
|
+
const b = l.slice(A[g], A[g + 1]), S = i.pop();
|
|
1303
|
+
s.push([S, S + b.length - 1]), e.splice(S, 2, b);
|
|
1304
1304
|
}
|
|
1305
1305
|
for (s.reverse(), g = -1; ++g < s.length; )
|
|
1306
|
-
u[
|
|
1306
|
+
u[x + s[g][0]] = x + s[g][1], x += s[g][1] - s[g][0] - 1;
|
|
1307
1307
|
return u;
|
|
1308
1308
|
}
|
|
1309
|
-
const
|
|
1310
|
-
resolve:
|
|
1311
|
-
tokenize:
|
|
1312
|
-
},
|
|
1309
|
+
const Br = {
|
|
1310
|
+
resolve: Mr,
|
|
1311
|
+
tokenize: Fr
|
|
1312
|
+
}, Rr = {
|
|
1313
1313
|
partial: !0,
|
|
1314
|
-
tokenize:
|
|
1314
|
+
tokenize: Pr
|
|
1315
1315
|
};
|
|
1316
|
-
function
|
|
1317
|
-
return
|
|
1316
|
+
function Mr(e) {
|
|
1317
|
+
return sn(e), e;
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1319
|
+
function Fr(e, t) {
|
|
1320
1320
|
let n;
|
|
1321
1321
|
return r;
|
|
1322
1322
|
function r(l) {
|
|
@@ -1325,7 +1325,7 @@ function Ar(e, t) {
|
|
|
1325
1325
|
}), o(l);
|
|
1326
1326
|
}
|
|
1327
1327
|
function o(l) {
|
|
1328
|
-
return l === null ? i(l) :
|
|
1328
|
+
return l === null ? i(l) : L(l) ? e.check(Rr, a, i)(l) : (e.consume(l), o);
|
|
1329
1329
|
}
|
|
1330
1330
|
function i(l) {
|
|
1331
1331
|
return e.exit("chunkContent"), e.exit("content"), t(l);
|
|
@@ -1337,47 +1337,47 @@ function Ar(e, t) {
|
|
|
1337
1337
|
}), n = n.next, o;
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function Pr(e, t, n) {
|
|
1341
1341
|
const r = this;
|
|
1342
1342
|
return o;
|
|
1343
1343
|
function o(a) {
|
|
1344
1344
|
return e.exit("chunkContent"), e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), H(e, i, "linePrefix");
|
|
1345
1345
|
}
|
|
1346
1346
|
function i(a) {
|
|
1347
|
-
if (a === null ||
|
|
1347
|
+
if (a === null || L(a))
|
|
1348
1348
|
return n(a);
|
|
1349
1349
|
const l = r.events[r.events.length - 1];
|
|
1350
1350
|
return !r.parser.constructs.disable.null.includes("codeIndented") && l && l[1].type === "linePrefix" && l[2].sliceSerialize(l[1], !0).length >= 4 ? t(a) : e.interrupt(r.parser.constructs.flow, n, t)(a);
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function cn(e, t, n, r, o, i, a, l, s) {
|
|
1354
1354
|
const u = s || Number.POSITIVE_INFINITY;
|
|
1355
1355
|
let f = 0;
|
|
1356
1356
|
return p;
|
|
1357
|
-
function p(
|
|
1358
|
-
return
|
|
1357
|
+
function p(b) {
|
|
1358
|
+
return b === 60 ? (e.enter(r), e.enter(o), e.enter(i), e.consume(b), e.exit(i), g) : b === null || b === 32 || b === 41 || bt(b) ? n(b) : (e.enter(r), e.enter(a), e.enter(l), e.enter("chunkString", {
|
|
1359
1359
|
contentType: "string"
|
|
1360
|
-
}),
|
|
1360
|
+
}), v(b));
|
|
1361
1361
|
}
|
|
1362
|
-
function g(
|
|
1363
|
-
return
|
|
1362
|
+
function g(b) {
|
|
1363
|
+
return b === 62 ? (e.enter(i), e.consume(b), e.exit(i), e.exit(o), e.exit(r), t) : (e.enter(l), e.enter("chunkString", {
|
|
1364
1364
|
contentType: "string"
|
|
1365
|
-
}), c(
|
|
1365
|
+
}), c(b));
|
|
1366
1366
|
}
|
|
1367
|
-
function c(
|
|
1368
|
-
return
|
|
1367
|
+
function c(b) {
|
|
1368
|
+
return b === 62 ? (e.exit("chunkString"), e.exit(l), g(b)) : b === null || b === 60 || L(b) ? n(b) : (e.consume(b), b === 92 ? x : c);
|
|
1369
1369
|
}
|
|
1370
|
-
function b
|
|
1371
|
-
return
|
|
1370
|
+
function x(b) {
|
|
1371
|
+
return b === 60 || b === 62 || b === 92 ? (e.consume(b), c) : c(b);
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1374
|
-
return !f && (
|
|
1373
|
+
function v(b) {
|
|
1374
|
+
return !f && (b === null || b === 41 || ne(b)) ? (e.exit("chunkString"), e.exit(l), e.exit(a), e.exit(r), t(b)) : f < u && b === 40 ? (e.consume(b), f++, v) : b === 41 ? (e.consume(b), f--, v) : b === null || b === 32 || b === 40 || bt(b) ? n(b) : (e.consume(b), b === 92 ? A : v);
|
|
1375
1375
|
}
|
|
1376
|
-
function A(
|
|
1377
|
-
return
|
|
1376
|
+
function A(b) {
|
|
1377
|
+
return b === 40 || b === 41 || b === 92 ? (e.consume(b), v) : v(b);
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
|
-
function
|
|
1380
|
+
function hn(e, t, n, r, o, i) {
|
|
1381
1381
|
const a = this;
|
|
1382
1382
|
let l = 0, s;
|
|
1383
1383
|
return u;
|
|
@@ -1390,18 +1390,18 @@ function cn(e, t, n, r, o, i) {
|
|
|
1390
1390
|
// which doesn’t need this.
|
|
1391
1391
|
// Hidden footnotes hook.
|
|
1392
1392
|
/* c8 ignore next 3 */
|
|
1393
|
-
c === 94 && !l && "_hiddenFootnoteSupport" in a.parser.constructs ? n(c) : c === 93 ? (e.exit(i), e.enter(o), e.consume(c), e.exit(o), e.exit(r), t) :
|
|
1393
|
+
c === 94 && !l && "_hiddenFootnoteSupport" in a.parser.constructs ? n(c) : c === 93 ? (e.exit(i), e.enter(o), e.consume(c), e.exit(o), e.exit(r), t) : L(c) ? (e.enter("lineEnding"), e.consume(c), e.exit("lineEnding"), f) : (e.enter("chunkString", {
|
|
1394
1394
|
contentType: "string"
|
|
1395
1395
|
}), p(c));
|
|
1396
1396
|
}
|
|
1397
1397
|
function p(c) {
|
|
1398
|
-
return c === null || c === 91 || c === 93 ||
|
|
1398
|
+
return c === null || c === 91 || c === 93 || L(c) || l++ > 999 ? (e.exit("chunkString"), f(c)) : (e.consume(c), s || (s = !F(c)), c === 92 ? g : p);
|
|
1399
1399
|
}
|
|
1400
1400
|
function g(c) {
|
|
1401
1401
|
return c === 91 || c === 92 || c === 93 ? (e.consume(c), l++, p) : p(c);
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
|
-
function
|
|
1404
|
+
function dn(e, t, n, r, o, i) {
|
|
1405
1405
|
let a;
|
|
1406
1406
|
return l;
|
|
1407
1407
|
function l(g) {
|
|
@@ -1411,12 +1411,12 @@ function hn(e, t, n, r, o, i) {
|
|
|
1411
1411
|
return g === a ? (e.enter(o), e.consume(g), e.exit(o), e.exit(r), t) : (e.enter(i), u(g));
|
|
1412
1412
|
}
|
|
1413
1413
|
function u(g) {
|
|
1414
|
-
return g === a ? (e.exit(i), s(a)) : g === null ? n(g) :
|
|
1414
|
+
return g === a ? (e.exit(i), s(a)) : g === null ? n(g) : L(g) ? (e.enter("lineEnding"), e.consume(g), e.exit("lineEnding"), H(e, u, "linePrefix")) : (e.enter("chunkString", {
|
|
1415
1415
|
contentType: "string"
|
|
1416
1416
|
}), f(g));
|
|
1417
1417
|
}
|
|
1418
1418
|
function f(g) {
|
|
1419
|
-
return g === a || g === null ||
|
|
1419
|
+
return g === a || g === null || L(g) ? (e.exit("chunkString"), u(g)) : (e.consume(g), g === 92 ? p : f);
|
|
1420
1420
|
}
|
|
1421
1421
|
function p(g) {
|
|
1422
1422
|
return g === a || g === 92 ? (e.consume(g), f) : f(g);
|
|
@@ -1426,17 +1426,17 @@ function Ne(e, t) {
|
|
|
1426
1426
|
let n;
|
|
1427
1427
|
return r;
|
|
1428
1428
|
function r(o) {
|
|
1429
|
-
return
|
|
1429
|
+
return L(o) ? (e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), n = !0, r) : F(o) ? H(e, r, n ? "linePrefix" : "lineSuffix")(o) : t(o);
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
|
-
const
|
|
1432
|
+
const Or = {
|
|
1433
1433
|
name: "definition",
|
|
1434
|
-
tokenize:
|
|
1435
|
-
},
|
|
1434
|
+
tokenize: Nr
|
|
1435
|
+
}, $r = {
|
|
1436
1436
|
partial: !0,
|
|
1437
|
-
tokenize:
|
|
1437
|
+
tokenize: Dr
|
|
1438
1438
|
};
|
|
1439
|
-
function
|
|
1439
|
+
function Nr(e, t, n) {
|
|
1440
1440
|
const r = this;
|
|
1441
1441
|
let o;
|
|
1442
1442
|
return i;
|
|
@@ -1444,7 +1444,7 @@ function Mr(e, t, n) {
|
|
|
1444
1444
|
return e.enter("definition"), a(c);
|
|
1445
1445
|
}
|
|
1446
1446
|
function a(c) {
|
|
1447
|
-
return
|
|
1447
|
+
return hn.call(
|
|
1448
1448
|
r,
|
|
1449
1449
|
e,
|
|
1450
1450
|
l,
|
|
@@ -1456,13 +1456,13 @@ function Mr(e, t, n) {
|
|
|
1456
1456
|
)(c);
|
|
1457
1457
|
}
|
|
1458
1458
|
function l(c) {
|
|
1459
|
-
return o =
|
|
1459
|
+
return o = Ie(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1)), c === 58 ? (e.enter("definitionMarker"), e.consume(c), e.exit("definitionMarker"), s) : n(c);
|
|
1460
1460
|
}
|
|
1461
1461
|
function s(c) {
|
|
1462
1462
|
return ne(c) ? Ne(e, u)(c) : u(c);
|
|
1463
1463
|
}
|
|
1464
1464
|
function u(c) {
|
|
1465
|
-
return
|
|
1465
|
+
return cn(
|
|
1466
1466
|
e,
|
|
1467
1467
|
f,
|
|
1468
1468
|
// Note: we don’t need to reset the way `markdown-rs` does.
|
|
@@ -1475,49 +1475,49 @@ function Mr(e, t, n) {
|
|
|
1475
1475
|
)(c);
|
|
1476
1476
|
}
|
|
1477
1477
|
function f(c) {
|
|
1478
|
-
return e.attempt(
|
|
1478
|
+
return e.attempt($r, p, p)(c);
|
|
1479
1479
|
}
|
|
1480
1480
|
function p(c) {
|
|
1481
1481
|
return F(c) ? H(e, g, "whitespace")(c) : g(c);
|
|
1482
1482
|
}
|
|
1483
1483
|
function g(c) {
|
|
1484
|
-
return c === null ||
|
|
1484
|
+
return c === null || L(c) ? (e.exit("definition"), r.parser.defined.push(o), t(c)) : n(c);
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function Dr(e, t, n) {
|
|
1488
1488
|
return r;
|
|
1489
1489
|
function r(l) {
|
|
1490
1490
|
return ne(l) ? Ne(e, o)(l) : n(l);
|
|
1491
1491
|
}
|
|
1492
1492
|
function o(l) {
|
|
1493
|
-
return
|
|
1493
|
+
return dn(e, i, n, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(l);
|
|
1494
1494
|
}
|
|
1495
1495
|
function i(l) {
|
|
1496
1496
|
return F(l) ? H(e, a, "whitespace")(l) : a(l);
|
|
1497
1497
|
}
|
|
1498
1498
|
function a(l) {
|
|
1499
|
-
return l === null ||
|
|
1499
|
+
return l === null || L(l) ? t(l) : n(l);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
|
-
const
|
|
1502
|
+
const Hr = {
|
|
1503
1503
|
name: "hardBreakEscape",
|
|
1504
|
-
tokenize:
|
|
1504
|
+
tokenize: Vr
|
|
1505
1505
|
};
|
|
1506
|
-
function
|
|
1506
|
+
function Vr(e, t, n) {
|
|
1507
1507
|
return r;
|
|
1508
1508
|
function r(i) {
|
|
1509
1509
|
return e.enter("hardBreakEscape"), e.consume(i), o;
|
|
1510
1510
|
}
|
|
1511
1511
|
function o(i) {
|
|
1512
|
-
return
|
|
1512
|
+
return L(i) ? (e.exit("hardBreakEscape"), t(i)) : n(i);
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
|
-
const
|
|
1515
|
+
const qr = {
|
|
1516
1516
|
name: "headingAtx",
|
|
1517
|
-
resolve:
|
|
1518
|
-
tokenize:
|
|
1517
|
+
resolve: Ur,
|
|
1518
|
+
tokenize: Wr
|
|
1519
1519
|
};
|
|
1520
|
-
function
|
|
1520
|
+
function Ur(e, t) {
|
|
1521
1521
|
let n = e.length - 2, r = 3, o, i;
|
|
1522
1522
|
return e[r][1].type === "whitespace" && (r += 2), n - 2 > r && e[n][1].type === "whitespace" && (n -= 2), e[n][1].type === "atxHeadingSequence" && (r === n - 1 || n - 4 > r && e[n - 2][1].type === "whitespace") && (n -= r + 1 === n ? 2 : 4), n > r && (o = {
|
|
1523
1523
|
type: "atxHeadingText",
|
|
@@ -1528,9 +1528,9 @@ function $r(e, t) {
|
|
|
1528
1528
|
start: e[r][1].start,
|
|
1529
1529
|
end: e[n][1].end,
|
|
1530
1530
|
contentType: "text"
|
|
1531
|
-
},
|
|
1531
|
+
}, se(e, r, n - r + 1, [["enter", o, t], ["enter", i, t], ["exit", i, t], ["exit", o, t]])), e;
|
|
1532
1532
|
}
|
|
1533
|
-
function
|
|
1533
|
+
function Wr(e, t, n) {
|
|
1534
1534
|
let r = 0;
|
|
1535
1535
|
return o;
|
|
1536
1536
|
function o(f) {
|
|
@@ -1543,7 +1543,7 @@ function Dr(e, t, n) {
|
|
|
1543
1543
|
return f === 35 && r++ < 6 ? (e.consume(f), a) : f === null || ne(f) ? (e.exit("atxHeadingSequence"), l(f)) : n(f);
|
|
1544
1544
|
}
|
|
1545
1545
|
function l(f) {
|
|
1546
|
-
return f === 35 ? (e.enter("atxHeadingSequence"), s(f)) : f === null ||
|
|
1546
|
+
return f === 35 ? (e.enter("atxHeadingSequence"), s(f)) : f === null || L(f) ? (e.exit("atxHeading"), t(f)) : F(f) ? H(e, l, "whitespace")(f) : (e.enter("atxHeadingText"), u(f));
|
|
1547
1547
|
}
|
|
1548
1548
|
function s(f) {
|
|
1549
1549
|
return f === 35 ? (e.consume(f), s) : (e.exit("atxHeadingSequence"), l(f));
|
|
@@ -1552,7 +1552,7 @@ function Dr(e, t, n) {
|
|
|
1552
1552
|
return f === null || f === 35 || ne(f) ? (e.exit("atxHeadingText"), l(f)) : (e.consume(f), u);
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
|
-
const
|
|
1555
|
+
const jr = [
|
|
1556
1556
|
"address",
|
|
1557
1557
|
"article",
|
|
1558
1558
|
"aside",
|
|
@@ -1615,25 +1615,25 @@ const Hr = [
|
|
|
1615
1615
|
"tr",
|
|
1616
1616
|
"track",
|
|
1617
1617
|
"ul"
|
|
1618
|
-
], qt = ["pre", "script", "style", "textarea"],
|
|
1618
|
+
], qt = ["pre", "script", "style", "textarea"], Qr = {
|
|
1619
1619
|
concrete: !0,
|
|
1620
1620
|
name: "htmlFlow",
|
|
1621
|
-
resolveTo:
|
|
1622
|
-
tokenize:
|
|
1623
|
-
},
|
|
1621
|
+
resolveTo: Gr,
|
|
1622
|
+
tokenize: Xr
|
|
1623
|
+
}, Kr = {
|
|
1624
1624
|
partial: !0,
|
|
1625
|
-
tokenize:
|
|
1626
|
-
},
|
|
1625
|
+
tokenize: Jr
|
|
1626
|
+
}, Yr = {
|
|
1627
1627
|
partial: !0,
|
|
1628
|
-
tokenize:
|
|
1628
|
+
tokenize: Zr
|
|
1629
1629
|
};
|
|
1630
|
-
function
|
|
1630
|
+
function Gr(e) {
|
|
1631
1631
|
let t = e.length;
|
|
1632
1632
|
for (; t-- && !(e[t][0] === "enter" && e[t][1].type === "htmlFlow"); )
|
|
1633
1633
|
;
|
|
1634
1634
|
return t > 1 && e[t - 2][1].type === "linePrefix" && (e[t][1].start = e[t - 2][1].start, e[t + 1][1].start = e[t - 2][1].start, e.splice(t - 2, 2)), e;
|
|
1635
1635
|
}
|
|
1636
|
-
function
|
|
1636
|
+
function Xr(e, t, n) {
|
|
1637
1637
|
const r = this;
|
|
1638
1638
|
let o, i, a, l, s;
|
|
1639
1639
|
return u;
|
|
@@ -1644,120 +1644,120 @@ function jr(e, t, n) {
|
|
|
1644
1644
|
return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(d), p;
|
|
1645
1645
|
}
|
|
1646
1646
|
function p(d) {
|
|
1647
|
-
return d === 33 ? (e.consume(d), g) : d === 47 ? (e.consume(d), i = !0,
|
|
1647
|
+
return d === 33 ? (e.consume(d), g) : d === 47 ? (e.consume(d), i = !0, v) : d === 63 ? (e.consume(d), o = 3, r.interrupt ? t : h) : Se(d) ? (e.consume(d), a = String.fromCharCode(d), A) : n(d);
|
|
1648
1648
|
}
|
|
1649
1649
|
function g(d) {
|
|
1650
|
-
return d === 45 ? (e.consume(d), o = 2, c) : d === 91 ? (e.consume(d), o = 5, l = 0,
|
|
1650
|
+
return d === 45 ? (e.consume(d), o = 2, c) : d === 91 ? (e.consume(d), o = 5, l = 0, x) : Se(d) ? (e.consume(d), o = 4, r.interrupt ? t : h) : n(d);
|
|
1651
1651
|
}
|
|
1652
1652
|
function c(d) {
|
|
1653
1653
|
return d === 45 ? (e.consume(d), r.interrupt ? t : h) : n(d);
|
|
1654
1654
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const
|
|
1657
|
-
return d ===
|
|
1655
|
+
function x(d) {
|
|
1656
|
+
const ae = "CDATA[";
|
|
1657
|
+
return d === ae.charCodeAt(l++) ? (e.consume(d), l === ae.length ? r.interrupt ? t : E : x) : n(d);
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1660
|
-
return
|
|
1659
|
+
function v(d) {
|
|
1660
|
+
return Se(d) ? (e.consume(d), a = String.fromCharCode(d), A) : n(d);
|
|
1661
1661
|
}
|
|
1662
1662
|
function A(d) {
|
|
1663
1663
|
if (d === null || d === 47 || d === 62 || ne(d)) {
|
|
1664
|
-
const
|
|
1665
|
-
return !
|
|
1664
|
+
const ae = d === 47, _e = a.toLowerCase();
|
|
1665
|
+
return !ae && !i && qt.includes(_e) ? (o = 1, r.interrupt ? t(d) : E(d)) : jr.includes(a.toLowerCase()) ? (o = 6, ae ? (e.consume(d), b) : r.interrupt ? t(d) : E(d)) : (o = 7, r.interrupt && !r.parser.lazy[r.now().line] ? n(d) : i ? S(d) : _(d));
|
|
1666
1666
|
}
|
|
1667
|
-
return d === 45 ||
|
|
1667
|
+
return d === 45 || ue(d) ? (e.consume(d), a += String.fromCharCode(d), A) : n(d);
|
|
1668
1668
|
}
|
|
1669
|
-
function
|
|
1669
|
+
function b(d) {
|
|
1670
1670
|
return d === 62 ? (e.consume(d), r.interrupt ? t : E) : n(d);
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1673
|
-
return F(d) ? (e.consume(d),
|
|
1672
|
+
function S(d) {
|
|
1673
|
+
return F(d) ? (e.consume(d), S) : N(d);
|
|
1674
1674
|
}
|
|
1675
1675
|
function _(d) {
|
|
1676
|
-
return d === 47 ? (e.consume(d),
|
|
1676
|
+
return d === 47 ? (e.consume(d), N) : d === 58 || d === 95 || Se(d) ? (e.consume(d), O) : F(d) ? (e.consume(d), _) : N(d);
|
|
1677
1677
|
}
|
|
1678
1678
|
function O(d) {
|
|
1679
|
-
return d === 45 || d === 46 || d === 58 || d === 95 ||
|
|
1679
|
+
return d === 45 || d === 46 || d === 58 || d === 95 || ue(d) ? (e.consume(d), O) : z(d);
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1682
|
-
return d === 61 ? (e.consume(d), k) : F(d) ? (e.consume(d),
|
|
1681
|
+
function z(d) {
|
|
1682
|
+
return d === 61 ? (e.consume(d), k) : F(d) ? (e.consume(d), z) : _(d);
|
|
1683
1683
|
}
|
|
1684
1684
|
function k(d) {
|
|
1685
1685
|
return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? n(d) : d === 34 || d === 39 ? (e.consume(d), s = d, M) : F(d) ? (e.consume(d), k) : q(d);
|
|
1686
1686
|
}
|
|
1687
1687
|
function M(d) {
|
|
1688
|
-
return d === s ? (e.consume(d), s = null,
|
|
1688
|
+
return d === s ? (e.consume(d), s = null, $) : d === null || L(d) ? n(d) : (e.consume(d), M);
|
|
1689
1689
|
}
|
|
1690
1690
|
function q(d) {
|
|
1691
|
-
return d === null || d === 34 || d === 39 || d === 47 || d === 60 || d === 61 || d === 62 || d === 96 || ne(d) ?
|
|
1691
|
+
return d === null || d === 34 || d === 39 || d === 47 || d === 60 || d === 61 || d === 62 || d === 96 || ne(d) ? z(d) : (e.consume(d), q);
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function $(d) {
|
|
1694
1694
|
return d === 47 || d === 62 || F(d) ? _(d) : n(d);
|
|
1695
1695
|
}
|
|
1696
|
-
function
|
|
1696
|
+
function N(d) {
|
|
1697
1697
|
return d === 62 ? (e.consume(d), T) : n(d);
|
|
1698
1698
|
}
|
|
1699
1699
|
function T(d) {
|
|
1700
|
-
return d === null ||
|
|
1700
|
+
return d === null || L(d) ? E(d) : F(d) ? (e.consume(d), T) : n(d);
|
|
1701
1701
|
}
|
|
1702
1702
|
function E(d) {
|
|
1703
|
-
return d === 45 && o === 2 ? (e.consume(d), Q) : d === 60 && o === 1 ? (e.consume(d), W) : d === 62 && o === 4 ? (e.consume(d),
|
|
1703
|
+
return d === 45 && o === 2 ? (e.consume(d), Q) : d === 60 && o === 1 ? (e.consume(d), W) : d === 62 && o === 4 ? (e.consume(d), oe) : d === 63 && o === 3 ? (e.consume(d), h) : d === 93 && o === 5 ? (e.consume(d), de) : L(d) && (o === 6 || o === 7) ? (e.exit("htmlFlowData"), e.check(Kr, fe, D)(d)) : d === null || L(d) ? (e.exit("htmlFlowData"), D(d)) : (e.consume(d), E);
|
|
1704
1704
|
}
|
|
1705
1705
|
function D(d) {
|
|
1706
|
-
return e.check(
|
|
1706
|
+
return e.check(Yr, V, fe)(d);
|
|
1707
1707
|
}
|
|
1708
1708
|
function V(d) {
|
|
1709
1709
|
return e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), R;
|
|
1710
1710
|
}
|
|
1711
1711
|
function R(d) {
|
|
1712
|
-
return d === null ||
|
|
1712
|
+
return d === null || L(d) ? D(d) : (e.enter("htmlFlowData"), E(d));
|
|
1713
1713
|
}
|
|
1714
1714
|
function Q(d) {
|
|
1715
1715
|
return d === 45 ? (e.consume(d), h) : E(d);
|
|
1716
1716
|
}
|
|
1717
1717
|
function W(d) {
|
|
1718
|
-
return d === 47 ? (e.consume(d), a = "",
|
|
1718
|
+
return d === 47 ? (e.consume(d), a = "", ie) : E(d);
|
|
1719
1719
|
}
|
|
1720
|
-
function
|
|
1720
|
+
function ie(d) {
|
|
1721
1721
|
if (d === 62) {
|
|
1722
|
-
const
|
|
1723
|
-
return qt.includes(
|
|
1722
|
+
const ae = a.toLowerCase();
|
|
1723
|
+
return qt.includes(ae) ? (e.consume(d), oe) : E(d);
|
|
1724
1724
|
}
|
|
1725
|
-
return
|
|
1725
|
+
return Se(d) && a.length < 8 ? (e.consume(d), a += String.fromCharCode(d), ie) : E(d);
|
|
1726
1726
|
}
|
|
1727
1727
|
function de(d) {
|
|
1728
1728
|
return d === 93 ? (e.consume(d), h) : E(d);
|
|
1729
1729
|
}
|
|
1730
1730
|
function h(d) {
|
|
1731
|
-
return d === 62 ? (e.consume(d),
|
|
1731
|
+
return d === 62 ? (e.consume(d), oe) : d === 45 && o === 2 ? (e.consume(d), h) : E(d);
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1734
|
-
return d === null ||
|
|
1733
|
+
function oe(d) {
|
|
1734
|
+
return d === null || L(d) ? (e.exit("htmlFlowData"), fe(d)) : (e.consume(d), oe);
|
|
1735
1735
|
}
|
|
1736
1736
|
function fe(d) {
|
|
1737
1737
|
return e.exit("htmlFlow"), t(d);
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
|
-
function
|
|
1740
|
+
function Zr(e, t, n) {
|
|
1741
1741
|
const r = this;
|
|
1742
1742
|
return o;
|
|
1743
1743
|
function o(a) {
|
|
1744
|
-
return
|
|
1744
|
+
return L(a) ? (e.enter("lineEnding"), e.consume(a), e.exit("lineEnding"), i) : n(a);
|
|
1745
1745
|
}
|
|
1746
1746
|
function i(a) {
|
|
1747
1747
|
return r.parser.lazy[r.now().line] ? n(a) : t(a);
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function Jr(e, t, n) {
|
|
1751
1751
|
return r;
|
|
1752
1752
|
function r(o) {
|
|
1753
1753
|
return e.enter("lineEnding"), e.consume(o), e.exit("lineEnding"), e.attempt(tt, t, n);
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
1756
|
-
const
|
|
1756
|
+
const ei = {
|
|
1757
1757
|
name: "htmlText",
|
|
1758
|
-
tokenize:
|
|
1758
|
+
tokenize: ti
|
|
1759
1759
|
};
|
|
1760
|
-
function
|
|
1760
|
+
function ti(e, t, n) {
|
|
1761
1761
|
const r = this;
|
|
1762
1762
|
let o, i, a;
|
|
1763
1763
|
return l;
|
|
@@ -1765,16 +1765,16 @@ function Gr(e, t, n) {
|
|
|
1765
1765
|
return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(h), s;
|
|
1766
1766
|
}
|
|
1767
1767
|
function s(h) {
|
|
1768
|
-
return h === 33 ? (e.consume(h), u) : h === 47 ? (e.consume(h),
|
|
1768
|
+
return h === 33 ? (e.consume(h), u) : h === 47 ? (e.consume(h), z) : h === 63 ? (e.consume(h), _) : Se(h) ? (e.consume(h), q) : n(h);
|
|
1769
1769
|
}
|
|
1770
1770
|
function u(h) {
|
|
1771
|
-
return h === 45 ? (e.consume(h), f) : h === 91 ? (e.consume(h), i = 0,
|
|
1771
|
+
return h === 45 ? (e.consume(h), f) : h === 91 ? (e.consume(h), i = 0, x) : Se(h) ? (e.consume(h), S) : n(h);
|
|
1772
1772
|
}
|
|
1773
1773
|
function f(h) {
|
|
1774
1774
|
return h === 45 ? (e.consume(h), c) : n(h);
|
|
1775
1775
|
}
|
|
1776
1776
|
function p(h) {
|
|
1777
|
-
return h === null ? n(h) : h === 45 ? (e.consume(h), g) :
|
|
1777
|
+
return h === null ? n(h) : h === 45 ? (e.consume(h), g) : L(h) ? (a = p, W(h)) : (e.consume(h), p);
|
|
1778
1778
|
}
|
|
1779
1779
|
function g(h) {
|
|
1780
1780
|
return h === 45 ? (e.consume(h), c) : p(h);
|
|
@@ -1782,68 +1782,68 @@ function Gr(e, t, n) {
|
|
|
1782
1782
|
function c(h) {
|
|
1783
1783
|
return h === 62 ? Q(h) : h === 45 ? g(h) : p(h);
|
|
1784
1784
|
}
|
|
1785
|
-
function
|
|
1786
|
-
const
|
|
1787
|
-
return h ===
|
|
1785
|
+
function x(h) {
|
|
1786
|
+
const oe = "CDATA[";
|
|
1787
|
+
return h === oe.charCodeAt(i++) ? (e.consume(h), i === oe.length ? v : x) : n(h);
|
|
1788
1788
|
}
|
|
1789
|
-
function
|
|
1790
|
-
return h === null ? n(h) : h === 93 ? (e.consume(h), A) :
|
|
1789
|
+
function v(h) {
|
|
1790
|
+
return h === null ? n(h) : h === 93 ? (e.consume(h), A) : L(h) ? (a = v, W(h)) : (e.consume(h), v);
|
|
1791
1791
|
}
|
|
1792
1792
|
function A(h) {
|
|
1793
|
-
return h === 93 ? (e.consume(h),
|
|
1793
|
+
return h === 93 ? (e.consume(h), b) : v(h);
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1796
|
-
return h === 62 ? Q(h) : h === 93 ? (e.consume(h),
|
|
1795
|
+
function b(h) {
|
|
1796
|
+
return h === 62 ? Q(h) : h === 93 ? (e.consume(h), b) : v(h);
|
|
1797
1797
|
}
|
|
1798
|
-
function
|
|
1799
|
-
return h === null || h === 62 ? Q(h) :
|
|
1798
|
+
function S(h) {
|
|
1799
|
+
return h === null || h === 62 ? Q(h) : L(h) ? (a = S, W(h)) : (e.consume(h), S);
|
|
1800
1800
|
}
|
|
1801
1801
|
function _(h) {
|
|
1802
|
-
return h === null ? n(h) : h === 63 ? (e.consume(h), O) :
|
|
1802
|
+
return h === null ? n(h) : h === 63 ? (e.consume(h), O) : L(h) ? (a = _, W(h)) : (e.consume(h), _);
|
|
1803
1803
|
}
|
|
1804
1804
|
function O(h) {
|
|
1805
1805
|
return h === 62 ? Q(h) : _(h);
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1808
|
-
return
|
|
1807
|
+
function z(h) {
|
|
1808
|
+
return Se(h) ? (e.consume(h), k) : n(h);
|
|
1809
1809
|
}
|
|
1810
1810
|
function k(h) {
|
|
1811
|
-
return h === 45 ||
|
|
1811
|
+
return h === 45 || ue(h) ? (e.consume(h), k) : M(h);
|
|
1812
1812
|
}
|
|
1813
1813
|
function M(h) {
|
|
1814
|
-
return
|
|
1814
|
+
return L(h) ? (a = M, W(h)) : F(h) ? (e.consume(h), M) : Q(h);
|
|
1815
1815
|
}
|
|
1816
1816
|
function q(h) {
|
|
1817
|
-
return h === 45 ||
|
|
1818
|
-
}
|
|
1819
|
-
function N(h) {
|
|
1820
|
-
return h === 47 ? (e.consume(h), Q) : h === 58 || h === 95 || ve(h) ? (e.consume(h), $) : I(h) ? (a = N, W(h)) : F(h) ? (e.consume(h), N) : Q(h);
|
|
1817
|
+
return h === 45 || ue(h) ? (e.consume(h), q) : h === 47 || h === 62 || ne(h) ? $(h) : n(h);
|
|
1821
1818
|
}
|
|
1822
1819
|
function $(h) {
|
|
1823
|
-
return h ===
|
|
1820
|
+
return h === 47 ? (e.consume(h), Q) : h === 58 || h === 95 || Se(h) ? (e.consume(h), N) : L(h) ? (a = $, W(h)) : F(h) ? (e.consume(h), $) : Q(h);
|
|
1821
|
+
}
|
|
1822
|
+
function N(h) {
|
|
1823
|
+
return h === 45 || h === 46 || h === 58 || h === 95 || ue(h) ? (e.consume(h), N) : T(h);
|
|
1824
1824
|
}
|
|
1825
1825
|
function T(h) {
|
|
1826
|
-
return h === 61 ? (e.consume(h), E) :
|
|
1826
|
+
return h === 61 ? (e.consume(h), E) : L(h) ? (a = T, W(h)) : F(h) ? (e.consume(h), T) : $(h);
|
|
1827
1827
|
}
|
|
1828
1828
|
function E(h) {
|
|
1829
|
-
return h === null || h === 60 || h === 61 || h === 62 || h === 96 ? n(h) : h === 34 || h === 39 ? (e.consume(h), o = h, D) :
|
|
1829
|
+
return h === null || h === 60 || h === 61 || h === 62 || h === 96 ? n(h) : h === 34 || h === 39 ? (e.consume(h), o = h, D) : L(h) ? (a = E, W(h)) : F(h) ? (e.consume(h), E) : (e.consume(h), V);
|
|
1830
1830
|
}
|
|
1831
1831
|
function D(h) {
|
|
1832
|
-
return h === o ? (e.consume(h), o = void 0, R) : h === null ? n(h) :
|
|
1832
|
+
return h === o ? (e.consume(h), o = void 0, R) : h === null ? n(h) : L(h) ? (a = D, W(h)) : (e.consume(h), D);
|
|
1833
1833
|
}
|
|
1834
1834
|
function V(h) {
|
|
1835
|
-
return h === null || h === 34 || h === 39 || h === 60 || h === 61 || h === 96 ? n(h) : h === 47 || h === 62 || ne(h) ?
|
|
1835
|
+
return h === null || h === 34 || h === 39 || h === 60 || h === 61 || h === 96 ? n(h) : h === 47 || h === 62 || ne(h) ? $(h) : (e.consume(h), V);
|
|
1836
1836
|
}
|
|
1837
1837
|
function R(h) {
|
|
1838
|
-
return h === 47 || h === 62 || ne(h) ?
|
|
1838
|
+
return h === 47 || h === 62 || ne(h) ? $(h) : n(h);
|
|
1839
1839
|
}
|
|
1840
1840
|
function Q(h) {
|
|
1841
1841
|
return h === 62 ? (e.consume(h), e.exit("htmlTextData"), e.exit("htmlText"), t) : n(h);
|
|
1842
1842
|
}
|
|
1843
1843
|
function W(h) {
|
|
1844
|
-
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(h), e.exit("lineEnding"),
|
|
1844
|
+
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(h), e.exit("lineEnding"), ie;
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function ie(h) {
|
|
1847
1847
|
return F(h) ? H(e, de, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(h) : de(h);
|
|
1848
1848
|
}
|
|
1849
1849
|
function de(h) {
|
|
@@ -1852,17 +1852,17 @@ function Gr(e, t, n) {
|
|
|
1852
1852
|
}
|
|
1853
1853
|
const Ct = {
|
|
1854
1854
|
name: "labelEnd",
|
|
1855
|
-
resolveAll:
|
|
1856
|
-
resolveTo:
|
|
1857
|
-
tokenize:
|
|
1858
|
-
},
|
|
1859
|
-
tokenize:
|
|
1860
|
-
},
|
|
1861
|
-
tokenize:
|
|
1862
|
-
},
|
|
1863
|
-
tokenize:
|
|
1855
|
+
resolveAll: oi,
|
|
1856
|
+
resolveTo: ai,
|
|
1857
|
+
tokenize: li
|
|
1858
|
+
}, ni = {
|
|
1859
|
+
tokenize: ui
|
|
1860
|
+
}, ri = {
|
|
1861
|
+
tokenize: si
|
|
1862
|
+
}, ii = {
|
|
1863
|
+
tokenize: ci
|
|
1864
1864
|
};
|
|
1865
|
-
function
|
|
1865
|
+
function oi(e) {
|
|
1866
1866
|
let t = -1;
|
|
1867
1867
|
const n = [];
|
|
1868
1868
|
for (; ++t < e.length; ) {
|
|
@@ -1872,9 +1872,9 @@ function ei(e) {
|
|
|
1872
1872
|
r.type = "data", t += o;
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
|
-
return e.length !== n.length &&
|
|
1875
|
+
return e.length !== n.length && se(e, 0, e.length, n), e;
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function ai(e, t) {
|
|
1878
1878
|
let n = e.length, r = 0, o, i, a, l;
|
|
1879
1879
|
for (; n--; )
|
|
1880
1880
|
if (o = e[n][1], i) {
|
|
@@ -1912,9 +1912,9 @@ function ti(e, t) {
|
|
|
1912
1912
|
...e[a - 2][1].start
|
|
1913
1913
|
}
|
|
1914
1914
|
};
|
|
1915
|
-
return l = [["enter", s, t], ["enter", u, t]], l = Y(l, e.slice(i + 1, i + r + 3)), l = Y(l, [["enter", f, t]]), l = Y(l, et(t.parser.constructs.insideSpan.null, e.slice(i + r + 4, a - 3), t)), l = Y(l, [["exit", f, t], e[a - 2], e[a - 1], ["exit", u, t]]), l = Y(l, e.slice(a + 1)), l = Y(l, [["exit", s, t]]),
|
|
1915
|
+
return l = [["enter", s, t], ["enter", u, t]], l = Y(l, e.slice(i + 1, i + r + 3)), l = Y(l, [["enter", f, t]]), l = Y(l, et(t.parser.constructs.insideSpan.null, e.slice(i + r + 4, a - 3), t)), l = Y(l, [["exit", f, t], e[a - 2], e[a - 1], ["exit", u, t]]), l = Y(l, e.slice(a + 1)), l = Y(l, [["exit", s, t]]), se(e, i, e.length, l), e;
|
|
1916
1916
|
}
|
|
1917
|
-
function
|
|
1917
|
+
function li(e, t, n) {
|
|
1918
1918
|
const r = this;
|
|
1919
1919
|
let o = r.events.length, i, a;
|
|
1920
1920
|
for (; o--; )
|
|
@@ -1924,16 +1924,16 @@ function ni(e, t, n) {
|
|
|
1924
1924
|
}
|
|
1925
1925
|
return l;
|
|
1926
1926
|
function l(g) {
|
|
1927
|
-
return i ? i._inactive ? p(g) : (a = r.parser.defined.includes(
|
|
1927
|
+
return i ? i._inactive ? p(g) : (a = r.parser.defined.includes(Ie(r.sliceSerialize({
|
|
1928
1928
|
start: i.end,
|
|
1929
1929
|
end: r.now()
|
|
1930
1930
|
}))), e.enter("labelEnd"), e.enter("labelMarker"), e.consume(g), e.exit("labelMarker"), e.exit("labelEnd"), s) : n(g);
|
|
1931
1931
|
}
|
|
1932
1932
|
function s(g) {
|
|
1933
|
-
return g === 40 ? e.attempt(
|
|
1933
|
+
return g === 40 ? e.attempt(ni, f, a ? f : p)(g) : g === 91 ? e.attempt(ri, f, a ? u : p)(g) : a ? f(g) : p(g);
|
|
1934
1934
|
}
|
|
1935
1935
|
function u(g) {
|
|
1936
|
-
return e.attempt(
|
|
1936
|
+
return e.attempt(ii, f, p)(g);
|
|
1937
1937
|
}
|
|
1938
1938
|
function f(g) {
|
|
1939
1939
|
return t(g);
|
|
@@ -1942,7 +1942,7 @@ function ni(e, t, n) {
|
|
|
1942
1942
|
return i._balanced = !0, n(g);
|
|
1943
1943
|
}
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1945
|
+
function ui(e, t, n) {
|
|
1946
1946
|
return r;
|
|
1947
1947
|
function r(p) {
|
|
1948
1948
|
return e.enter("resource"), e.enter("resourceMarker"), e.consume(p), e.exit("resourceMarker"), o;
|
|
@@ -1951,7 +1951,7 @@ function ri(e, t, n) {
|
|
|
1951
1951
|
return ne(p) ? Ne(e, i)(p) : i(p);
|
|
1952
1952
|
}
|
|
1953
1953
|
function i(p) {
|
|
1954
|
-
return p === 41 ? f(p) :
|
|
1954
|
+
return p === 41 ? f(p) : cn(e, a, l, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(p);
|
|
1955
1955
|
}
|
|
1956
1956
|
function a(p) {
|
|
1957
1957
|
return ne(p) ? Ne(e, s)(p) : f(p);
|
|
@@ -1960,7 +1960,7 @@ function ri(e, t, n) {
|
|
|
1960
1960
|
return n(p);
|
|
1961
1961
|
}
|
|
1962
1962
|
function s(p) {
|
|
1963
|
-
return p === 34 || p === 39 || p === 40 ?
|
|
1963
|
+
return p === 34 || p === 39 || p === 40 ? dn(e, u, n, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(p) : f(p);
|
|
1964
1964
|
}
|
|
1965
1965
|
function u(p) {
|
|
1966
1966
|
return ne(p) ? Ne(e, f)(p) : f(p);
|
|
@@ -1969,20 +1969,20 @@ function ri(e, t, n) {
|
|
|
1969
1969
|
return p === 41 ? (e.enter("resourceMarker"), e.consume(p), e.exit("resourceMarker"), e.exit("resource"), t) : n(p);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1972
|
+
function si(e, t, n) {
|
|
1973
1973
|
const r = this;
|
|
1974
1974
|
return o;
|
|
1975
1975
|
function o(l) {
|
|
1976
|
-
return
|
|
1976
|
+
return hn.call(r, e, i, a, "reference", "referenceMarker", "referenceString")(l);
|
|
1977
1977
|
}
|
|
1978
1978
|
function i(l) {
|
|
1979
|
-
return r.parser.defined.includes(
|
|
1979
|
+
return r.parser.defined.includes(Ie(r.sliceSerialize(r.events[r.events.length - 1][1]).slice(1, -1))) ? t(l) : n(l);
|
|
1980
1980
|
}
|
|
1981
1981
|
function a(l) {
|
|
1982
1982
|
return n(l);
|
|
1983
1983
|
}
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function ci(e, t, n) {
|
|
1986
1986
|
return r;
|
|
1987
1987
|
function r(i) {
|
|
1988
1988
|
return e.enter("reference"), e.enter("referenceMarker"), e.consume(i), e.exit("referenceMarker"), o;
|
|
@@ -1991,12 +1991,12 @@ function oi(e, t, n) {
|
|
|
1991
1991
|
return i === 93 ? (e.enter("referenceMarker"), e.consume(i), e.exit("referenceMarker"), e.exit("reference"), t) : n(i);
|
|
1992
1992
|
}
|
|
1993
1993
|
}
|
|
1994
|
-
const
|
|
1994
|
+
const hi = {
|
|
1995
1995
|
name: "labelStartImage",
|
|
1996
1996
|
resolveAll: Ct.resolveAll,
|
|
1997
|
-
tokenize:
|
|
1997
|
+
tokenize: di
|
|
1998
1998
|
};
|
|
1999
|
-
function
|
|
1999
|
+
function di(e, t, n) {
|
|
2000
2000
|
const r = this;
|
|
2001
2001
|
return o;
|
|
2002
2002
|
function o(l) {
|
|
@@ -2009,12 +2009,12 @@ function li(e, t, n) {
|
|
|
2009
2009
|
return l === 94 && "_hiddenFootnoteSupport" in r.parser.constructs ? n(l) : t(l);
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
2012
|
-
const
|
|
2012
|
+
const fi = {
|
|
2013
2013
|
name: "labelStartLink",
|
|
2014
2014
|
resolveAll: Ct.resolveAll,
|
|
2015
|
-
tokenize:
|
|
2015
|
+
tokenize: pi
|
|
2016
2016
|
};
|
|
2017
|
-
function
|
|
2017
|
+
function pi(e, t, n) {
|
|
2018
2018
|
const r = this;
|
|
2019
2019
|
return o;
|
|
2020
2020
|
function o(a) {
|
|
@@ -2026,19 +2026,19 @@ function si(e, t, n) {
|
|
|
2026
2026
|
}
|
|
2027
2027
|
const dt = {
|
|
2028
2028
|
name: "lineEnding",
|
|
2029
|
-
tokenize:
|
|
2029
|
+
tokenize: gi
|
|
2030
2030
|
};
|
|
2031
|
-
function
|
|
2031
|
+
function gi(e, t) {
|
|
2032
2032
|
return n;
|
|
2033
2033
|
function n(r) {
|
|
2034
2034
|
return e.enter("lineEnding"), e.consume(r), e.exit("lineEnding"), H(e, t, "linePrefix");
|
|
2035
2035
|
}
|
|
2036
2036
|
}
|
|
2037
|
-
const
|
|
2037
|
+
const Ke = {
|
|
2038
2038
|
name: "thematicBreak",
|
|
2039
|
-
tokenize:
|
|
2039
|
+
tokenize: mi
|
|
2040
2040
|
};
|
|
2041
|
-
function
|
|
2041
|
+
function mi(e, t, n) {
|
|
2042
2042
|
let r = 0, o;
|
|
2043
2043
|
return i;
|
|
2044
2044
|
function i(u) {
|
|
@@ -2048,7 +2048,7 @@ function hi(e, t, n) {
|
|
|
2048
2048
|
return o = u, l(u);
|
|
2049
2049
|
}
|
|
2050
2050
|
function l(u) {
|
|
2051
|
-
return u === o ? (e.enter("thematicBreakSequence"), s(u)) : r >= 3 && (u === null ||
|
|
2051
|
+
return u === o ? (e.enter("thematicBreakSequence"), s(u)) : r >= 3 && (u === null || L(u)) ? (e.exit("thematicBreak"), t(u)) : n(u);
|
|
2052
2052
|
}
|
|
2053
2053
|
function s(u) {
|
|
2054
2054
|
return u === o ? (e.consume(u), r++, s) : (e.exit("thematicBreakSequence"), F(u) ? H(e, l, "whitespace")(u) : l(u));
|
|
@@ -2056,43 +2056,43 @@ function hi(e, t, n) {
|
|
|
2056
2056
|
}
|
|
2057
2057
|
const te = {
|
|
2058
2058
|
continuation: {
|
|
2059
|
-
tokenize:
|
|
2059
|
+
tokenize: yi
|
|
2060
2060
|
},
|
|
2061
|
-
exit:
|
|
2061
|
+
exit: Si,
|
|
2062
2062
|
name: "list",
|
|
2063
|
-
tokenize: pi
|
|
2064
|
-
}, di = {
|
|
2065
|
-
partial: !0,
|
|
2066
2063
|
tokenize: xi
|
|
2067
|
-
},
|
|
2064
|
+
}, ki = {
|
|
2068
2065
|
partial: !0,
|
|
2069
|
-
tokenize:
|
|
2066
|
+
tokenize: _i
|
|
2067
|
+
}, bi = {
|
|
2068
|
+
partial: !0,
|
|
2069
|
+
tokenize: wi
|
|
2070
2070
|
};
|
|
2071
|
-
function
|
|
2071
|
+
function xi(e, t, n) {
|
|
2072
2072
|
const r = this, o = r.events[r.events.length - 1];
|
|
2073
2073
|
let i = o && o[1].type === "linePrefix" ? o[2].sliceSerialize(o[1], !0).length : 0, a = 0;
|
|
2074
2074
|
return l;
|
|
2075
2075
|
function l(c) {
|
|
2076
|
-
const
|
|
2077
|
-
if (
|
|
2078
|
-
if (r.containerState.type || (r.containerState.type =
|
|
2076
|
+
const x = r.containerState.type || (c === 42 || c === 43 || c === 45 ? "listUnordered" : "listOrdered");
|
|
2077
|
+
if (x === "listUnordered" ? !r.containerState.marker || c === r.containerState.marker : xt(c)) {
|
|
2078
|
+
if (r.containerState.type || (r.containerState.type = x, e.enter(x, {
|
|
2079
2079
|
_container: !0
|
|
2080
|
-
})),
|
|
2081
|
-
return e.enter("listItemPrefix"), c === 42 || c === 45 ? e.check(
|
|
2080
|
+
})), x === "listUnordered")
|
|
2081
|
+
return e.enter("listItemPrefix"), c === 42 || c === 45 ? e.check(Ke, n, u)(c) : u(c);
|
|
2082
2082
|
if (!r.interrupt || c === 49)
|
|
2083
2083
|
return e.enter("listItemPrefix"), e.enter("listItemValue"), s(c);
|
|
2084
2084
|
}
|
|
2085
2085
|
return n(c);
|
|
2086
2086
|
}
|
|
2087
2087
|
function s(c) {
|
|
2088
|
-
return
|
|
2088
|
+
return xt(c) && ++a < 10 ? (e.consume(c), s) : (!r.interrupt || a < 2) && (r.containerState.marker ? c === r.containerState.marker : c === 41 || c === 46) ? (e.exit("listItemValue"), u(c)) : n(c);
|
|
2089
2089
|
}
|
|
2090
2090
|
function u(c) {
|
|
2091
2091
|
return e.enter("listItemMarker"), e.consume(c), e.exit("listItemMarker"), r.containerState.marker = r.containerState.marker || c, e.check(
|
|
2092
2092
|
tt,
|
|
2093
2093
|
// Can’t be empty when interrupting.
|
|
2094
2094
|
r.interrupt ? n : f,
|
|
2095
|
-
e.attempt(
|
|
2095
|
+
e.attempt(ki, g, p)
|
|
2096
2096
|
);
|
|
2097
2097
|
}
|
|
2098
2098
|
function f(c) {
|
|
@@ -2105,20 +2105,20 @@ function pi(e, t, n) {
|
|
|
2105
2105
|
return r.containerState.size = i + r.sliceSerialize(e.exit("listItemPrefix"), !0).length, t(c);
|
|
2106
2106
|
}
|
|
2107
2107
|
}
|
|
2108
|
-
function
|
|
2108
|
+
function yi(e, t, n) {
|
|
2109
2109
|
const r = this;
|
|
2110
2110
|
return r.containerState._closeFlow = void 0, e.check(tt, o, i);
|
|
2111
2111
|
function o(l) {
|
|
2112
2112
|
return r.containerState.furtherBlankLines = r.containerState.furtherBlankLines || r.containerState.initialBlankLine, H(e, t, "listItemIndent", r.containerState.size + 1)(l);
|
|
2113
2113
|
}
|
|
2114
2114
|
function i(l) {
|
|
2115
|
-
return r.containerState.furtherBlankLines || !F(l) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, a(l)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(
|
|
2115
|
+
return r.containerState.furtherBlankLines || !F(l) ? (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, a(l)) : (r.containerState.furtherBlankLines = void 0, r.containerState.initialBlankLine = void 0, e.attempt(bi, t, a)(l));
|
|
2116
2116
|
}
|
|
2117
2117
|
function a(l) {
|
|
2118
2118
|
return r.containerState._closeFlow = !0, r.interrupt = void 0, H(e, e.attempt(te, t, n), "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(l);
|
|
2119
2119
|
}
|
|
2120
2120
|
}
|
|
2121
|
-
function
|
|
2121
|
+
function wi(e, t, n) {
|
|
2122
2122
|
const r = this;
|
|
2123
2123
|
return H(e, o, "listItemIndent", r.containerState.size + 1);
|
|
2124
2124
|
function o(i) {
|
|
@@ -2126,10 +2126,10 @@ function mi(e, t, n) {
|
|
|
2126
2126
|
return a && a[1].type === "listItemIndent" && a[2].sliceSerialize(a[1], !0).length === r.containerState.size ? t(i) : n(i);
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
function
|
|
2129
|
+
function Si(e) {
|
|
2130
2130
|
e.exit(this.containerState.type);
|
|
2131
2131
|
}
|
|
2132
|
-
function
|
|
2132
|
+
function _i(e, t, n) {
|
|
2133
2133
|
const r = this;
|
|
2134
2134
|
return H(e, o, "listItemPrefixWhitespace", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
|
|
2135
2135
|
function o(i) {
|
|
@@ -2139,10 +2139,10 @@ function xi(e, t, n) {
|
|
|
2139
2139
|
}
|
|
2140
2140
|
const Ut = {
|
|
2141
2141
|
name: "setextUnderline",
|
|
2142
|
-
resolveTo:
|
|
2143
|
-
tokenize:
|
|
2142
|
+
resolveTo: vi,
|
|
2143
|
+
tokenize: Ci
|
|
2144
2144
|
};
|
|
2145
|
-
function
|
|
2145
|
+
function vi(e, t) {
|
|
2146
2146
|
let n = e.length, r, o, i;
|
|
2147
2147
|
for (; n--; )
|
|
2148
2148
|
if (e[n][0] === "enter") {
|
|
@@ -2166,7 +2166,7 @@ function bi(e, t) {
|
|
|
2166
2166
|
...e[i][1].end
|
|
2167
2167
|
}) : e[r][1] = a, e.push(["exit", a, t]), e;
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2169
|
+
function Ci(e, t, n) {
|
|
2170
2170
|
const r = this;
|
|
2171
2171
|
let o;
|
|
2172
2172
|
return i;
|
|
@@ -2186,19 +2186,19 @@ function yi(e, t, n) {
|
|
|
2186
2186
|
return u === o ? (e.consume(u), l) : (e.exit("setextHeadingLineSequence"), F(u) ? H(e, s, "lineSuffix")(u) : s(u));
|
|
2187
2187
|
}
|
|
2188
2188
|
function s(u) {
|
|
2189
|
-
return u === null ||
|
|
2189
|
+
return u === null || L(u) ? (e.exit("setextHeadingLine"), t(u)) : n(u);
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
|
-
const
|
|
2193
|
-
tokenize:
|
|
2192
|
+
const Ei = {
|
|
2193
|
+
tokenize: Ti
|
|
2194
2194
|
};
|
|
2195
|
-
function
|
|
2195
|
+
function Ti(e) {
|
|
2196
2196
|
const t = this, n = e.attempt(
|
|
2197
2197
|
// Try to parse a blank line.
|
|
2198
2198
|
tt,
|
|
2199
2199
|
r,
|
|
2200
2200
|
// Try to parse initial flow (essentially, only code).
|
|
2201
|
-
e.attempt(this.parser.constructs.flowInitial, o, H(e, e.attempt(this.parser.constructs.flow, o, e.attempt(
|
|
2201
|
+
e.attempt(this.parser.constructs.flowInitial, o, H(e, e.attempt(this.parser.constructs.flow, o, e.attempt(Br, o)), "linePrefix"))
|
|
2202
2202
|
);
|
|
2203
2203
|
return n;
|
|
2204
2204
|
function r(i) {
|
|
@@ -2216,12 +2216,12 @@ function vi(e) {
|
|
|
2216
2216
|
return e.enter("lineEnding"), e.consume(i), e.exit("lineEnding"), t.currentConstruct = void 0, n;
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
2219
|
-
const
|
|
2220
|
-
resolveAll:
|
|
2221
|
-
},
|
|
2222
|
-
function
|
|
2219
|
+
const Li = {
|
|
2220
|
+
resolveAll: pn()
|
|
2221
|
+
}, Ii = fn("string"), Ai = fn("text");
|
|
2222
|
+
function fn(e) {
|
|
2223
2223
|
return {
|
|
2224
|
-
resolveAll:
|
|
2224
|
+
resolveAll: pn(e === "text" ? zi : void 0),
|
|
2225
2225
|
tokenize: t
|
|
2226
2226
|
};
|
|
2227
2227
|
function t(n) {
|
|
@@ -2255,7 +2255,7 @@ function dn(e) {
|
|
|
2255
2255
|
}
|
|
2256
2256
|
}
|
|
2257
2257
|
}
|
|
2258
|
-
function
|
|
2258
|
+
function pn(e) {
|
|
2259
2259
|
return t;
|
|
2260
2260
|
function t(n, r) {
|
|
2261
2261
|
let o = -1, i;
|
|
@@ -2264,7 +2264,7 @@ function fn(e) {
|
|
|
2264
2264
|
return e ? e(n, r) : n;
|
|
2265
2265
|
}
|
|
2266
2266
|
}
|
|
2267
|
-
function
|
|
2267
|
+
function zi(e, t) {
|
|
2268
2268
|
let n = 0;
|
|
2269
2269
|
for (; ++n <= e.length; )
|
|
2270
2270
|
if ((n === e.length || e[n][1].type === "lineEnding") && e[n - 1][1].type === "data") {
|
|
@@ -2306,7 +2306,7 @@ function Ei(e, t) {
|
|
|
2306
2306
|
}
|
|
2307
2307
|
return e;
|
|
2308
2308
|
}
|
|
2309
|
-
const
|
|
2309
|
+
const Bi = {
|
|
2310
2310
|
42: te,
|
|
2311
2311
|
43: te,
|
|
2312
2312
|
45: te,
|
|
@@ -2320,57 +2320,57 @@ const Ti = {
|
|
|
2320
2320
|
55: te,
|
|
2321
2321
|
56: te,
|
|
2322
2322
|
57: te,
|
|
2323
|
-
62:
|
|
2324
|
-
},
|
|
2325
|
-
91:
|
|
2326
|
-
},
|
|
2323
|
+
62: an
|
|
2324
|
+
}, Ri = {
|
|
2325
|
+
91: Or
|
|
2326
|
+
}, Mi = {
|
|
2327
2327
|
[-2]: ht,
|
|
2328
2328
|
[-1]: ht,
|
|
2329
2329
|
32: ht
|
|
2330
|
-
},
|
|
2331
|
-
35:
|
|
2332
|
-
42:
|
|
2333
|
-
45: [Ut,
|
|
2334
|
-
60:
|
|
2330
|
+
}, Fi = {
|
|
2331
|
+
35: qr,
|
|
2332
|
+
42: Ke,
|
|
2333
|
+
45: [Ut, Ke],
|
|
2334
|
+
60: Qr,
|
|
2335
2335
|
61: Ut,
|
|
2336
|
-
95:
|
|
2336
|
+
95: Ke,
|
|
2337
2337
|
96: Vt,
|
|
2338
2338
|
126: Vt
|
|
2339
|
-
},
|
|
2340
|
-
38:
|
|
2341
|
-
92:
|
|
2342
|
-
},
|
|
2339
|
+
}, Pi = {
|
|
2340
|
+
38: un,
|
|
2341
|
+
92: ln
|
|
2342
|
+
}, Oi = {
|
|
2343
2343
|
[-5]: dt,
|
|
2344
2344
|
[-4]: dt,
|
|
2345
2345
|
[-3]: dt,
|
|
2346
|
-
33:
|
|
2347
|
-
38:
|
|
2346
|
+
33: hi,
|
|
2347
|
+
38: un,
|
|
2348
2348
|
42: yt,
|
|
2349
|
-
60: [
|
|
2350
|
-
91:
|
|
2351
|
-
92: [
|
|
2349
|
+
60: [fr, ei],
|
|
2350
|
+
91: fi,
|
|
2351
|
+
92: [Hr, ln],
|
|
2352
2352
|
93: Ct,
|
|
2353
2353
|
95: yt,
|
|
2354
|
-
96:
|
|
2355
|
-
},
|
|
2356
|
-
null: [yt,
|
|
2357
|
-
},
|
|
2354
|
+
96: Er
|
|
2355
|
+
}, $i = {
|
|
2356
|
+
null: [yt, Li]
|
|
2357
|
+
}, Ni = {
|
|
2358
2358
|
null: [42, 95]
|
|
2359
|
-
},
|
|
2359
|
+
}, Di = {
|
|
2360
2360
|
null: []
|
|
2361
|
-
},
|
|
2361
|
+
}, Hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2362
2362
|
__proto__: null,
|
|
2363
|
-
attentionMarkers:
|
|
2364
|
-
contentInitial:
|
|
2365
|
-
disable:
|
|
2366
|
-
document:
|
|
2367
|
-
flow:
|
|
2368
|
-
flowInitial:
|
|
2369
|
-
insideSpan:
|
|
2370
|
-
string:
|
|
2371
|
-
text:
|
|
2363
|
+
attentionMarkers: Ni,
|
|
2364
|
+
contentInitial: Ri,
|
|
2365
|
+
disable: Di,
|
|
2366
|
+
document: Bi,
|
|
2367
|
+
flow: Fi,
|
|
2368
|
+
flowInitial: Mi,
|
|
2369
|
+
insideSpan: $i,
|
|
2370
|
+
string: Pi,
|
|
2371
|
+
text: Oi
|
|
2372
2372
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2373
|
-
function
|
|
2373
|
+
function Vi(e, t, n) {
|
|
2374
2374
|
let r = {
|
|
2375
2375
|
_bufferIndex: -1,
|
|
2376
2376
|
_index: 0,
|
|
@@ -2381,9 +2381,9 @@ function Oi(e, t, n) {
|
|
|
2381
2381
|
const o = {}, i = [];
|
|
2382
2382
|
let a = [], l = [];
|
|
2383
2383
|
const s = {
|
|
2384
|
-
attempt: M(
|
|
2384
|
+
attempt: M(z),
|
|
2385
2385
|
check: M(k),
|
|
2386
|
-
consume:
|
|
2386
|
+
consume: S,
|
|
2387
2387
|
enter: _,
|
|
2388
2388
|
exit: O,
|
|
2389
2389
|
interrupt: M(k, {
|
|
@@ -2392,9 +2392,9 @@ function Oi(e, t, n) {
|
|
|
2392
2392
|
}, u = {
|
|
2393
2393
|
code: null,
|
|
2394
2394
|
containerState: {},
|
|
2395
|
-
defineSkip:
|
|
2395
|
+
defineSkip: v,
|
|
2396
2396
|
events: [],
|
|
2397
|
-
now:
|
|
2397
|
+
now: x,
|
|
2398
2398
|
parser: e,
|
|
2399
2399
|
previous: null,
|
|
2400
2400
|
sliceSerialize: g,
|
|
@@ -2407,12 +2407,12 @@ function Oi(e, t, n) {
|
|
|
2407
2407
|
return a = Y(a, T), A(), a[a.length - 1] !== null ? [] : (q(t, 0), u.events = et(i, u.events, u), u.events);
|
|
2408
2408
|
}
|
|
2409
2409
|
function g(T, E) {
|
|
2410
|
-
return
|
|
2410
|
+
return Ui(c(T), E);
|
|
2411
2411
|
}
|
|
2412
2412
|
function c(T) {
|
|
2413
|
-
return
|
|
2413
|
+
return qi(a, T);
|
|
2414
2414
|
}
|
|
2415
|
-
function
|
|
2415
|
+
function x() {
|
|
2416
2416
|
const {
|
|
2417
2417
|
_bufferIndex: T,
|
|
2418
2418
|
_index: E,
|
|
@@ -2428,8 +2428,8 @@ function Oi(e, t, n) {
|
|
|
2428
2428
|
offset: R
|
|
2429
2429
|
};
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2432
|
-
o[T.line] = T.column,
|
|
2431
|
+
function v(T) {
|
|
2432
|
+
o[T.line] = T.column, N();
|
|
2433
2433
|
}
|
|
2434
2434
|
function A() {
|
|
2435
2435
|
let T;
|
|
@@ -2437,29 +2437,29 @@ function Oi(e, t, n) {
|
|
|
2437
2437
|
const E = a[r._index];
|
|
2438
2438
|
if (typeof E == "string")
|
|
2439
2439
|
for (T = r._index, r._bufferIndex < 0 && (r._bufferIndex = 0); r._index === T && r._bufferIndex < E.length; )
|
|
2440
|
-
|
|
2440
|
+
b(E.charCodeAt(r._bufferIndex));
|
|
2441
2441
|
else
|
|
2442
|
-
|
|
2442
|
+
b(E);
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
|
2445
|
-
function
|
|
2445
|
+
function b(T) {
|
|
2446
2446
|
f = f(T);
|
|
2447
2447
|
}
|
|
2448
|
-
function
|
|
2449
|
-
|
|
2448
|
+
function S(T) {
|
|
2449
|
+
L(T) ? (r.line++, r.column = 1, r.offset += T === -3 ? 2 : 1, N()) : T !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
|
|
2450
2450
|
// strings.
|
|
2451
2451
|
/** @type {string} */
|
|
2452
2452
|
a[r._index].length && (r._bufferIndex = -1, r._index++)), u.previous = T;
|
|
2453
2453
|
}
|
|
2454
2454
|
function _(T, E) {
|
|
2455
2455
|
const D = E || {};
|
|
2456
|
-
return D.type = T, D.start =
|
|
2456
|
+
return D.type = T, D.start = x(), u.events.push(["enter", D, u]), l.push(D), D;
|
|
2457
2457
|
}
|
|
2458
2458
|
function O(T) {
|
|
2459
2459
|
const E = l.pop();
|
|
2460
|
-
return E.end =
|
|
2460
|
+
return E.end = x(), u.events.push(["exit", E, u]), E;
|
|
2461
2461
|
}
|
|
2462
|
-
function
|
|
2462
|
+
function z(T, E) {
|
|
2463
2463
|
q(T, E.from);
|
|
2464
2464
|
}
|
|
2465
2465
|
function k(T, E) {
|
|
@@ -2468,7 +2468,7 @@ function Oi(e, t, n) {
|
|
|
2468
2468
|
function M(T, E) {
|
|
2469
2469
|
return D;
|
|
2470
2470
|
function D(V, R, Q) {
|
|
2471
|
-
let W,
|
|
2471
|
+
let W, ie, de, h;
|
|
2472
2472
|
return Array.isArray(V) ? (
|
|
2473
2473
|
/* c8 ignore next 1 */
|
|
2474
2474
|
fe(V)
|
|
@@ -2478,62 +2478,62 @@ function Oi(e, t, n) {
|
|
|
2478
2478
|
/** @type {Construct} */
|
|
2479
2479
|
V
|
|
2480
2480
|
])
|
|
2481
|
-
) :
|
|
2482
|
-
function
|
|
2483
|
-
return
|
|
2484
|
-
function
|
|
2485
|
-
const Ce =
|
|
2481
|
+
) : oe(V);
|
|
2482
|
+
function oe(j) {
|
|
2483
|
+
return ze;
|
|
2484
|
+
function ze(be) {
|
|
2485
|
+
const Ce = be !== null && j[be], Ee = be !== null && j.null, Fe = [
|
|
2486
2486
|
// To do: add more extension tests.
|
|
2487
2487
|
/* c8 ignore next 2 */
|
|
2488
2488
|
...Array.isArray(Ce) ? Ce : Ce ? [Ce] : [],
|
|
2489
2489
|
...Array.isArray(Ee) ? Ee : Ee ? [Ee] : []
|
|
2490
2490
|
];
|
|
2491
|
-
return fe(Fe)(
|
|
2491
|
+
return fe(Fe)(be);
|
|
2492
2492
|
}
|
|
2493
2493
|
}
|
|
2494
2494
|
function fe(j) {
|
|
2495
|
-
return W = j,
|
|
2495
|
+
return W = j, ie = 0, j.length === 0 ? Q : d(j[ie]);
|
|
2496
2496
|
}
|
|
2497
2497
|
function d(j) {
|
|
2498
|
-
return
|
|
2499
|
-
function
|
|
2500
|
-
return h =
|
|
2498
|
+
return ze;
|
|
2499
|
+
function ze(be) {
|
|
2500
|
+
return h = $(), de = j, j.partial || (u.currentConstruct = j), j.name && u.parser.constructs.disable.null.includes(j.name) ? _e() : j.tokenize.call(
|
|
2501
2501
|
// If we do have fields, create an object w/ `context` as its
|
|
2502
2502
|
// prototype.
|
|
2503
2503
|
// This allows a “live binding”, which is needed for `interrupt`.
|
|
2504
2504
|
E ? Object.assign(Object.create(u), E) : u,
|
|
2505
2505
|
s,
|
|
2506
|
-
|
|
2506
|
+
ae,
|
|
2507
2507
|
_e
|
|
2508
|
-
)(
|
|
2508
|
+
)(be);
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2511
|
+
function ae(j) {
|
|
2512
2512
|
return T(de, h), R;
|
|
2513
2513
|
}
|
|
2514
2514
|
function _e(j) {
|
|
2515
|
-
return h.restore(), ++
|
|
2515
|
+
return h.restore(), ++ie < W.length ? d(W[ie]) : Q;
|
|
2516
2516
|
}
|
|
2517
2517
|
}
|
|
2518
2518
|
}
|
|
2519
2519
|
function q(T, E) {
|
|
2520
|
-
T.resolveAll && !i.includes(T) && i.push(T), T.resolve &&
|
|
2520
|
+
T.resolveAll && !i.includes(T) && i.push(T), T.resolve && se(u.events, E, u.events.length - E, T.resolve(u.events.slice(E), u)), T.resolveTo && (u.events = T.resolveTo(u.events, u));
|
|
2521
2521
|
}
|
|
2522
|
-
function
|
|
2523
|
-
const T =
|
|
2522
|
+
function $() {
|
|
2523
|
+
const T = x(), E = u.previous, D = u.currentConstruct, V = u.events.length, R = Array.from(l);
|
|
2524
2524
|
return {
|
|
2525
2525
|
from: V,
|
|
2526
2526
|
restore: Q
|
|
2527
2527
|
};
|
|
2528
2528
|
function Q() {
|
|
2529
|
-
r = T, u.previous = E, u.currentConstruct = D, u.events.length = V, l = R,
|
|
2529
|
+
r = T, u.previous = E, u.currentConstruct = D, u.events.length = V, l = R, N();
|
|
2530
2530
|
}
|
|
2531
2531
|
}
|
|
2532
|
-
function
|
|
2532
|
+
function N() {
|
|
2533
2533
|
r.line in o && r.column < 2 && (r.column = o[r.line], r.offset += o[r.line] - 1);
|
|
2534
2534
|
}
|
|
2535
2535
|
}
|
|
2536
|
-
function
|
|
2536
|
+
function qi(e, t) {
|
|
2537
2537
|
const n = t.start._index, r = t.start._bufferIndex, o = t.end._index, i = t.end._bufferIndex;
|
|
2538
2538
|
let a;
|
|
2539
2539
|
if (n === o)
|
|
@@ -2547,7 +2547,7 @@ function Ni(e, t) {
|
|
|
2547
2547
|
}
|
|
2548
2548
|
return a;
|
|
2549
2549
|
}
|
|
2550
|
-
function
|
|
2550
|
+
function Ui(e, t) {
|
|
2551
2551
|
let n = -1;
|
|
2552
2552
|
const r = [];
|
|
2553
2553
|
let o;
|
|
@@ -2587,35 +2587,35 @@ function $i(e, t) {
|
|
|
2587
2587
|
}
|
|
2588
2588
|
return r.join("");
|
|
2589
2589
|
}
|
|
2590
|
-
function
|
|
2590
|
+
function gn(e) {
|
|
2591
2591
|
const r = {
|
|
2592
2592
|
constructs: (
|
|
2593
2593
|
/** @type {FullNormalizedExtension} */
|
|
2594
|
-
|
|
2594
|
+
jn([Hi, ...(e || {}).extensions || []])
|
|
2595
2595
|
),
|
|
2596
|
-
content: o(
|
|
2596
|
+
content: o(ar),
|
|
2597
2597
|
defined: [],
|
|
2598
|
-
document: o(
|
|
2599
|
-
flow: o(
|
|
2598
|
+
document: o(ur),
|
|
2599
|
+
flow: o(Ei),
|
|
2600
2600
|
lazy: {},
|
|
2601
|
-
string: o(
|
|
2602
|
-
text: o(
|
|
2601
|
+
string: o(Ii),
|
|
2602
|
+
text: o(Ai)
|
|
2603
2603
|
};
|
|
2604
2604
|
return r;
|
|
2605
2605
|
function o(i) {
|
|
2606
2606
|
return a;
|
|
2607
2607
|
function a(l) {
|
|
2608
|
-
return
|
|
2608
|
+
return Vi(r, i, l);
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
2611
|
}
|
|
2612
|
-
function
|
|
2613
|
-
for (; !
|
|
2612
|
+
function mn(e) {
|
|
2613
|
+
for (; !sn(e); )
|
|
2614
2614
|
;
|
|
2615
2615
|
return e;
|
|
2616
2616
|
}
|
|
2617
2617
|
const Wt = /[\0\t\n\r]/g;
|
|
2618
|
-
function
|
|
2618
|
+
function kn() {
|
|
2619
2619
|
let e = 1, t = "", n = !0, r;
|
|
2620
2620
|
return o;
|
|
2621
2621
|
function o(i, a, l) {
|
|
@@ -2650,10 +2650,10 @@ function mn() {
|
|
|
2650
2650
|
return l && (r && s.push(-5), t && s.push(t), s.push(null)), s;
|
|
2651
2651
|
}
|
|
2652
2652
|
}
|
|
2653
|
-
function
|
|
2654
|
-
return typeof t != "string" && (n = t, t = void 0),
|
|
2653
|
+
function Wi(e, t, n) {
|
|
2654
|
+
return typeof t != "string" && (n = t, t = void 0), or(n)(mn(gn(n).document().write(kn()(e, t, !0))));
|
|
2655
2655
|
}
|
|
2656
|
-
function
|
|
2656
|
+
function bn(e) {
|
|
2657
2657
|
let n = {}.singleTilde;
|
|
2658
2658
|
const r = {
|
|
2659
2659
|
name: "strikethrough",
|
|
@@ -2689,7 +2689,7 @@ function kn(e) {
|
|
|
2689
2689
|
start: Object.assign({}, a[u][1].end),
|
|
2690
2690
|
end: Object.assign({}, a[s][1].start)
|
|
2691
2691
|
}, g = [["enter", f, l], ["enter", a[u][1], l], ["exit", a[u][1], l], ["enter", p, l]], c = l.parser.constructs.insideSpan.null;
|
|
2692
|
-
c &&
|
|
2692
|
+
c && se(g, g.length, 0, et(c, a.slice(u + 1, s), l)), se(g, g.length, 0, [["exit", p, l], ["enter", a[s][1], l], ["exit", a[s][1], l], ["exit", f, l]]), se(a, u - 1, s - u + 3, g), s = u + g.length - 2;
|
|
2693
2693
|
break;
|
|
2694
2694
|
}
|
|
2695
2695
|
}
|
|
@@ -2701,20 +2701,20 @@ function kn(e) {
|
|
|
2701
2701
|
const u = this.previous, f = this.events;
|
|
2702
2702
|
let p = 0;
|
|
2703
2703
|
return g;
|
|
2704
|
-
function g(
|
|
2705
|
-
return u === 126 && f[f.length - 1][1].type !== "characterEscape" ? s(
|
|
2704
|
+
function g(x) {
|
|
2705
|
+
return u === 126 && f[f.length - 1][1].type !== "characterEscape" ? s(x) : (a.enter("strikethroughSequenceTemporary"), c(x));
|
|
2706
2706
|
}
|
|
2707
|
-
function c(
|
|
2708
|
-
const
|
|
2709
|
-
if (
|
|
2710
|
-
return p > 1 ? s(
|
|
2711
|
-
if (p < 2 && !n) return s(
|
|
2712
|
-
const A = a.exit("strikethroughSequenceTemporary"),
|
|
2713
|
-
return A._open = !
|
|
2707
|
+
function c(x) {
|
|
2708
|
+
const v = Ge(u);
|
|
2709
|
+
if (x === 126)
|
|
2710
|
+
return p > 1 ? s(x) : (a.consume(x), p++, c);
|
|
2711
|
+
if (p < 2 && !n) return s(x);
|
|
2712
|
+
const A = a.exit("strikethroughSequenceTemporary"), b = Ge(x);
|
|
2713
|
+
return A._open = !b || b === 2 && !!v, A._close = !v || v === 2 && !!b, l(x);
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
2716
|
}
|
|
2717
|
-
function
|
|
2717
|
+
function ji(e) {
|
|
2718
2718
|
for (var t = 1; t < arguments.length; t++) {
|
|
2719
2719
|
var n = arguments[t];
|
|
2720
2720
|
for (var r in n)
|
|
@@ -2722,54 +2722,54 @@ function Hi(e) {
|
|
|
2722
2722
|
}
|
|
2723
2723
|
return e;
|
|
2724
2724
|
}
|
|
2725
|
-
function
|
|
2725
|
+
function wt(e, t) {
|
|
2726
2726
|
return Array(t + 1).join(e);
|
|
2727
2727
|
}
|
|
2728
2728
|
function xn(e) {
|
|
2729
2729
|
return e.replace(/^\n*/, "");
|
|
2730
2730
|
}
|
|
2731
|
-
function
|
|
2731
|
+
function yn(e) {
|
|
2732
2732
|
for (var t = e.length; t > 0 && e[t - 1] === `
|
|
2733
2733
|
`; ) t--;
|
|
2734
2734
|
return e.substring(0, t);
|
|
2735
2735
|
}
|
|
2736
|
-
function
|
|
2737
|
-
return
|
|
2736
|
+
function wn(e) {
|
|
2737
|
+
return yn(xn(e));
|
|
2738
2738
|
}
|
|
2739
|
-
var
|
|
2739
|
+
var Qi = ["ADDRESS", "ARTICLE", "ASIDE", "AUDIO", "BLOCKQUOTE", "BODY", "CANVAS", "CENTER", "DD", "DIR", "DIV", "DL", "DT", "FIELDSET", "FIGCAPTION", "FIGURE", "FOOTER", "FORM", "FRAMESET", "H1", "H2", "H3", "H4", "H5", "H6", "HEADER", "HGROUP", "HR", "HTML", "ISINDEX", "LI", "MAIN", "MENU", "NAV", "NOFRAMES", "NOSCRIPT", "OL", "OUTPUT", "P", "PRE", "SECTION", "TABLE", "TBODY", "TD", "TFOOT", "TH", "THEAD", "TR", "UL"];
|
|
2740
2740
|
function Et(e) {
|
|
2741
|
-
return Tt(e,
|
|
2741
|
+
return Tt(e, Qi);
|
|
2742
2742
|
}
|
|
2743
2743
|
var Sn = ["AREA", "BASE", "BR", "COL", "COMMAND", "EMBED", "HR", "IMG", "INPUT", "KEYGEN", "LINK", "META", "PARAM", "SOURCE", "TRACK", "WBR"];
|
|
2744
|
-
function
|
|
2744
|
+
function _n(e) {
|
|
2745
2745
|
return Tt(e, Sn);
|
|
2746
2746
|
}
|
|
2747
|
-
function
|
|
2748
|
-
return
|
|
2747
|
+
function Ki(e) {
|
|
2748
|
+
return Cn(e, Sn);
|
|
2749
2749
|
}
|
|
2750
|
-
var
|
|
2751
|
-
function
|
|
2752
|
-
return Tt(e,
|
|
2750
|
+
var vn = ["A", "TABLE", "THEAD", "TBODY", "TFOOT", "TH", "TD", "IFRAME", "SCRIPT", "AUDIO", "VIDEO"];
|
|
2751
|
+
function Yi(e) {
|
|
2752
|
+
return Tt(e, vn);
|
|
2753
2753
|
}
|
|
2754
|
-
function
|
|
2755
|
-
return
|
|
2754
|
+
function Gi(e) {
|
|
2755
|
+
return Cn(e, vn);
|
|
2756
2756
|
}
|
|
2757
2757
|
function Tt(e, t) {
|
|
2758
2758
|
return t.indexOf(e.nodeName) >= 0;
|
|
2759
2759
|
}
|
|
2760
|
-
function
|
|
2760
|
+
function Cn(e, t) {
|
|
2761
2761
|
return e.getElementsByTagName && t.some(function(n) {
|
|
2762
2762
|
return e.getElementsByTagName(n).length;
|
|
2763
2763
|
});
|
|
2764
2764
|
}
|
|
2765
|
-
var
|
|
2766
|
-
function
|
|
2767
|
-
return
|
|
2765
|
+
var Xi = [[/\\/g, "\\\\"], [/\*/g, "\\*"], [/^-/g, "\\-"], [/^\+ /g, "\\+ "], [/^(=+)/g, "\\$1"], [/^(#{1,6}) /g, "\\$1 "], [/`/g, "\\`"], [/^~~~/g, "\\~~~"], [/\[/g, "\\["], [/\]/g, "\\]"], [/^>/g, "\\>"], [/_/g, "\\_"], [/^(\d+)\. /g, "$1\\. "]];
|
|
2766
|
+
function En(e) {
|
|
2767
|
+
return Xi.reduce(function(t, n) {
|
|
2768
2768
|
return t.replace(n[0], n[1]);
|
|
2769
2769
|
}, e);
|
|
2770
2770
|
}
|
|
2771
|
-
var
|
|
2772
|
-
|
|
2771
|
+
var X = {};
|
|
2772
|
+
X.paragraph = {
|
|
2773
2773
|
filter: "p",
|
|
2774
2774
|
replacement: function(e) {
|
|
2775
2775
|
return `
|
|
@@ -2779,19 +2779,19 @@ G.paragraph = {
|
|
|
2779
2779
|
`;
|
|
2780
2780
|
}
|
|
2781
2781
|
};
|
|
2782
|
-
|
|
2782
|
+
X.lineBreak = {
|
|
2783
2783
|
filter: "br",
|
|
2784
2784
|
replacement: function(e, t, n) {
|
|
2785
2785
|
return n.br + `
|
|
2786
2786
|
`;
|
|
2787
2787
|
}
|
|
2788
2788
|
};
|
|
2789
|
-
|
|
2789
|
+
X.heading = {
|
|
2790
2790
|
filter: ["h1", "h2", "h3", "h4", "h5", "h6"],
|
|
2791
2791
|
replacement: function(e, t, n) {
|
|
2792
2792
|
var r = Number(t.nodeName.charAt(1));
|
|
2793
2793
|
if (n.headingStyle === "setext" && r < 3) {
|
|
2794
|
-
var o =
|
|
2794
|
+
var o = wt(r === 1 ? "=" : "-", e.length);
|
|
2795
2795
|
return `
|
|
2796
2796
|
|
|
2797
2797
|
` + e + `
|
|
@@ -2801,22 +2801,22 @@ G.heading = {
|
|
|
2801
2801
|
} else
|
|
2802
2802
|
return `
|
|
2803
2803
|
|
|
2804
|
-
` +
|
|
2804
|
+
` + wt("#", r) + " " + e + `
|
|
2805
2805
|
|
|
2806
2806
|
`;
|
|
2807
2807
|
}
|
|
2808
2808
|
};
|
|
2809
|
-
|
|
2809
|
+
X.blockquote = {
|
|
2810
2810
|
filter: "blockquote",
|
|
2811
2811
|
replacement: function(e) {
|
|
2812
|
-
return e =
|
|
2812
|
+
return e = wn(e).replace(/^/gm, "> "), `
|
|
2813
2813
|
|
|
2814
2814
|
` + e + `
|
|
2815
2815
|
|
|
2816
2816
|
`;
|
|
2817
2817
|
}
|
|
2818
2818
|
};
|
|
2819
|
-
|
|
2819
|
+
X.list = {
|
|
2820
2820
|
filter: ["ul", "ol"],
|
|
2821
2821
|
replacement: function(e, t) {
|
|
2822
2822
|
var n = t.parentNode;
|
|
@@ -2828,7 +2828,7 @@ G.list = {
|
|
|
2828
2828
|
`;
|
|
2829
2829
|
}
|
|
2830
2830
|
};
|
|
2831
|
-
|
|
2831
|
+
X.listItem = {
|
|
2832
2832
|
filter: "li",
|
|
2833
2833
|
replacement: function(e, t, n) {
|
|
2834
2834
|
var r = n.bulletListMarker + " ", o = t.parentNode;
|
|
@@ -2837,13 +2837,13 @@ G.listItem = {
|
|
|
2837
2837
|
r = (i ? Number(i) + a : a + 1) + ". ";
|
|
2838
2838
|
}
|
|
2839
2839
|
var l = /\n$/.test(e);
|
|
2840
|
-
return e =
|
|
2840
|
+
return e = wn(e) + (l ? `
|
|
2841
2841
|
` : ""), e = e.replace(/\n/gm, `
|
|
2842
2842
|
` + " ".repeat(r.length)), r + e + (t.nextSibling ? `
|
|
2843
2843
|
` : "");
|
|
2844
2844
|
}
|
|
2845
2845
|
};
|
|
2846
|
-
|
|
2846
|
+
X.indentedCodeBlock = {
|
|
2847
2847
|
filter: function(e, t) {
|
|
2848
2848
|
return t.codeBlockStyle === "indented" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
|
|
2849
2849
|
},
|
|
@@ -2856,14 +2856,14 @@ G.indentedCodeBlock = {
|
|
|
2856
2856
|
`;
|
|
2857
2857
|
}
|
|
2858
2858
|
};
|
|
2859
|
-
|
|
2859
|
+
X.fencedCodeBlock = {
|
|
2860
2860
|
filter: function(e, t) {
|
|
2861
2861
|
return t.codeBlockStyle === "fenced" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
|
|
2862
2862
|
},
|
|
2863
2863
|
replacement: function(e, t, n) {
|
|
2864
2864
|
for (var r = t.firstChild.getAttribute("class") || "", o = (r.match(/language-(\S+)/) || [null, ""])[1], i = t.firstChild.textContent, a = n.fence.charAt(0), l = 3, s = new RegExp("^" + a + "{3,}", "gm"), u; u = s.exec(i); )
|
|
2865
2865
|
u[0].length >= l && (l = u[0].length + 1);
|
|
2866
|
-
var f =
|
|
2866
|
+
var f = wt(a, l);
|
|
2867
2867
|
return `
|
|
2868
2868
|
|
|
2869
2869
|
` + f + o + `
|
|
@@ -2873,7 +2873,7 @@ G.fencedCodeBlock = {
|
|
|
2873
2873
|
`;
|
|
2874
2874
|
}
|
|
2875
2875
|
};
|
|
2876
|
-
|
|
2876
|
+
X.horizontalRule = {
|
|
2877
2877
|
filter: "hr",
|
|
2878
2878
|
replacement: function(e, t, n) {
|
|
2879
2879
|
return `
|
|
@@ -2883,22 +2883,22 @@ G.horizontalRule = {
|
|
|
2883
2883
|
`;
|
|
2884
2884
|
}
|
|
2885
2885
|
};
|
|
2886
|
-
|
|
2886
|
+
X.inlineLink = {
|
|
2887
2887
|
filter: function(e, t) {
|
|
2888
2888
|
return t.linkStyle === "inlined" && e.nodeName === "A" && e.getAttribute("href");
|
|
2889
2889
|
},
|
|
2890
2890
|
replacement: function(e, t) {
|
|
2891
|
-
var n =
|
|
2891
|
+
var n = Lt(t.getAttribute("href")), r = It(Xe(t.getAttribute("title"))), o = r ? ' "' + r + '"' : "";
|
|
2892
2892
|
return "[" + e + "](" + n + o + ")";
|
|
2893
2893
|
}
|
|
2894
2894
|
};
|
|
2895
|
-
|
|
2895
|
+
X.referenceLink = {
|
|
2896
2896
|
filter: function(e, t) {
|
|
2897
2897
|
return t.linkStyle === "referenced" && e.nodeName === "A" && e.getAttribute("href");
|
|
2898
2898
|
},
|
|
2899
2899
|
replacement: function(e, t, n) {
|
|
2900
|
-
var r =
|
|
2901
|
-
o && (o = ' "' +
|
|
2900
|
+
var r = Lt(t.getAttribute("href")), o = Xe(t.getAttribute("title"));
|
|
2901
|
+
o && (o = ' "' + It(o) + '"');
|
|
2902
2902
|
var i, a;
|
|
2903
2903
|
switch (n.linkReferenceStyle) {
|
|
2904
2904
|
case "collapsed":
|
|
@@ -2924,19 +2924,19 @@ G.referenceLink = {
|
|
|
2924
2924
|
`, this.references = []), t;
|
|
2925
2925
|
}
|
|
2926
2926
|
};
|
|
2927
|
-
|
|
2927
|
+
X.emphasis = {
|
|
2928
2928
|
filter: ["em", "i"],
|
|
2929
2929
|
replacement: function(e, t, n) {
|
|
2930
2930
|
return e.trim() ? n.emDelimiter + e + n.emDelimiter : "";
|
|
2931
2931
|
}
|
|
2932
2932
|
};
|
|
2933
|
-
|
|
2933
|
+
X.strong = {
|
|
2934
2934
|
filter: ["strong", "b"],
|
|
2935
2935
|
replacement: function(e, t, n) {
|
|
2936
2936
|
return e.trim() ? n.strongDelimiter + e + n.strongDelimiter : "";
|
|
2937
2937
|
}
|
|
2938
2938
|
};
|
|
2939
|
-
|
|
2939
|
+
X.code = {
|
|
2940
2940
|
filter: function(e) {
|
|
2941
2941
|
var t = e.previousSibling || e.nextSibling, n = e.parentNode.nodeName === "PRE" && !t;
|
|
2942
2942
|
return e.nodeName === "CODE" && !n;
|
|
@@ -2948,10 +2948,10 @@ G.code = {
|
|
|
2948
2948
|
return n + t + e + t + n;
|
|
2949
2949
|
}
|
|
2950
2950
|
};
|
|
2951
|
-
|
|
2951
|
+
X.image = {
|
|
2952
2952
|
filter: "img",
|
|
2953
2953
|
replacement: function(e, t) {
|
|
2954
|
-
var n =
|
|
2954
|
+
var n = En(Xe(t.getAttribute("alt"))), r = Lt(t.getAttribute("src") || ""), o = Xe(t.getAttribute("title")), i = o ? ' "' + It(o) + '"' : "";
|
|
2955
2955
|
return r ? "" : "";
|
|
2956
2956
|
}
|
|
2957
2957
|
};
|
|
@@ -2959,14 +2959,14 @@ function Xe(e) {
|
|
|
2959
2959
|
return e ? e.replace(/(\n+\s*)+/g, `
|
|
2960
2960
|
`) : "";
|
|
2961
2961
|
}
|
|
2962
|
-
function
|
|
2962
|
+
function Lt(e) {
|
|
2963
2963
|
var t = e.replace(/([<>()])/g, "\\$1");
|
|
2964
2964
|
return t.indexOf(" ") >= 0 ? "<" + t + ">" : t;
|
|
2965
2965
|
}
|
|
2966
|
-
function
|
|
2966
|
+
function It(e) {
|
|
2967
2967
|
return e.replace(/"/g, '\\"');
|
|
2968
2968
|
}
|
|
2969
|
-
function
|
|
2969
|
+
function Tn(e) {
|
|
2970
2970
|
this.options = e, this._keep = [], this._remove = [], this.blankRule = {
|
|
2971
2971
|
replacement: e.blankReplacement
|
|
2972
2972
|
}, this.keepReplacement = e.keepReplacement, this.defaultRule = {
|
|
@@ -2974,7 +2974,7 @@ function En(e) {
|
|
|
2974
2974
|
}, this.array = [];
|
|
2975
2975
|
for (var t in e.rules) this.array.push(e.rules[t]);
|
|
2976
2976
|
}
|
|
2977
|
-
|
|
2977
|
+
Tn.prototype = {
|
|
2978
2978
|
add: function(e, t) {
|
|
2979
2979
|
this.array.unshift(t);
|
|
2980
2980
|
},
|
|
@@ -3004,10 +3004,10 @@ En.prototype = {
|
|
|
3004
3004
|
function ft(e, t, n) {
|
|
3005
3005
|
for (var r = 0; r < e.length; r++) {
|
|
3006
3006
|
var o = e[r];
|
|
3007
|
-
if (
|
|
3007
|
+
if (Zi(o, t, n)) return o;
|
|
3008
3008
|
}
|
|
3009
3009
|
}
|
|
3010
|
-
function
|
|
3010
|
+
function Zi(e, t, n) {
|
|
3011
3011
|
var r = e.filter;
|
|
3012
3012
|
if (typeof r == "string") {
|
|
3013
3013
|
if (r === t.nodeName.toLowerCase()) return !0;
|
|
@@ -3018,7 +3018,7 @@ function Qi(e, t, n) {
|
|
|
3018
3018
|
} else
|
|
3019
3019
|
throw new TypeError("`filter` needs to be a string, array, or function");
|
|
3020
3020
|
}
|
|
3021
|
-
function
|
|
3021
|
+
function Ji(e) {
|
|
3022
3022
|
var t = e.element, n = e.isBlock, r = e.isVoid, o = e.isPre || function(p) {
|
|
3023
3023
|
return p.nodeName === "PRE";
|
|
3024
3024
|
};
|
|
@@ -3051,7 +3051,7 @@ function jt(e, t, n) {
|
|
|
3051
3051
|
return e && e.parentNode === t || n(t) ? t.nextSibling || t.parentNode : t.firstChild || t.nextSibling || t.parentNode;
|
|
3052
3052
|
}
|
|
3053
3053
|
var At = typeof window < "u" ? window : {};
|
|
3054
|
-
function
|
|
3054
|
+
function eo() {
|
|
3055
3055
|
var e = At.DOMParser, t = !1;
|
|
3056
3056
|
try {
|
|
3057
3057
|
new e().parseFromString("", "text/html") && (t = !0);
|
|
@@ -3059,10 +3059,10 @@ function Yi() {
|
|
|
3059
3059
|
}
|
|
3060
3060
|
return t;
|
|
3061
3061
|
}
|
|
3062
|
-
function
|
|
3062
|
+
function to() {
|
|
3063
3063
|
var e = function() {
|
|
3064
3064
|
};
|
|
3065
|
-
return
|
|
3065
|
+
return no() ? e.prototype.parseFromString = function(t) {
|
|
3066
3066
|
var n = new window.ActiveXObject("htmlfile");
|
|
3067
3067
|
return n.designMode = "on", n.open(), n.write(t), n.close(), n;
|
|
3068
3068
|
} : e.prototype.parseFromString = function(t) {
|
|
@@ -3070,7 +3070,7 @@ function Gi() {
|
|
|
3070
3070
|
return n.open(), n.write(t), n.close(), n;
|
|
3071
3071
|
}, e;
|
|
3072
3072
|
}
|
|
3073
|
-
function
|
|
3073
|
+
function no() {
|
|
3074
3074
|
var e = !1;
|
|
3075
3075
|
try {
|
|
3076
3076
|
document.implementation.createHTMLDocument("").open();
|
|
@@ -3079,11 +3079,11 @@ function Xi() {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
return e;
|
|
3081
3081
|
}
|
|
3082
|
-
var
|
|
3083
|
-
function
|
|
3082
|
+
var ro = eo() ? At.DOMParser : to();
|
|
3083
|
+
function io(e, t) {
|
|
3084
3084
|
var n;
|
|
3085
3085
|
if (typeof e == "string") {
|
|
3086
|
-
var r =
|
|
3086
|
+
var r = oo().parseFromString(
|
|
3087
3087
|
// DOM parsers arrange elements in the <head> and <body>.
|
|
3088
3088
|
// Wrapping in a custom element ensures elements are reliably arranged in
|
|
3089
3089
|
// a single element.
|
|
@@ -3093,39 +3093,39 @@ function Ji(e, t) {
|
|
|
3093
3093
|
n = r.getElementById("turndown-root");
|
|
3094
3094
|
} else
|
|
3095
3095
|
n = e.cloneNode(!0);
|
|
3096
|
-
return
|
|
3096
|
+
return Ji({
|
|
3097
3097
|
element: n,
|
|
3098
3098
|
isBlock: Et,
|
|
3099
|
-
isVoid:
|
|
3100
|
-
isPre: t.preformattedCode ?
|
|
3099
|
+
isVoid: _n,
|
|
3100
|
+
isPre: t.preformattedCode ? ao : null
|
|
3101
3101
|
}), n;
|
|
3102
3102
|
}
|
|
3103
3103
|
var gt;
|
|
3104
|
-
function
|
|
3105
|
-
return gt = gt || new
|
|
3104
|
+
function oo() {
|
|
3105
|
+
return gt = gt || new ro(), gt;
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function ao(e) {
|
|
3108
3108
|
return e.nodeName === "PRE" || e.nodeName === "CODE";
|
|
3109
3109
|
}
|
|
3110
|
-
function
|
|
3111
|
-
return e.isBlock = Et(e), e.isCode = e.nodeName === "CODE" || e.parentNode.isCode, e.isBlank =
|
|
3110
|
+
function lo(e, t) {
|
|
3111
|
+
return e.isBlock = Et(e), e.isCode = e.nodeName === "CODE" || e.parentNode.isCode, e.isBlank = uo(e), e.flankingWhitespace = so(e, t), e;
|
|
3112
3112
|
}
|
|
3113
|
-
function
|
|
3114
|
-
return !
|
|
3113
|
+
function uo(e) {
|
|
3114
|
+
return !_n(e) && !Yi(e) && /^\s*$/i.test(e.textContent) && !Ki(e) && !Gi(e);
|
|
3115
3115
|
}
|
|
3116
|
-
function
|
|
3116
|
+
function so(e, t) {
|
|
3117
3117
|
if (e.isBlock || t.preformattedCode && e.isCode)
|
|
3118
3118
|
return {
|
|
3119
3119
|
leading: "",
|
|
3120
3120
|
trailing: ""
|
|
3121
3121
|
};
|
|
3122
|
-
var n =
|
|
3122
|
+
var n = co(e.textContent);
|
|
3123
3123
|
return n.leadingAscii && Qt("left", e, t) && (n.leading = n.leadingNonAscii), n.trailingAscii && Qt("right", e, t) && (n.trailing = n.trailingNonAscii), {
|
|
3124
3124
|
leading: n.leading,
|
|
3125
3125
|
trailing: n.trailing
|
|
3126
3126
|
};
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3128
|
+
function co(e) {
|
|
3129
3129
|
var t = e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);
|
|
3130
3130
|
return {
|
|
3131
3131
|
leading: t[1],
|
|
@@ -3142,11 +3142,11 @@ function Qt(e, t, n) {
|
|
|
3142
3142
|
var r, o, i;
|
|
3143
3143
|
return e === "left" ? (r = t.previousSibling, o = / $/) : (r = t.nextSibling, o = /^ /), r && (r.nodeType === 3 ? i = o.test(r.nodeValue) : n.preformattedCode && r.nodeName === "CODE" ? i = !1 : r.nodeType === 1 && !Et(r) && (i = o.test(r.textContent))), i;
|
|
3144
3144
|
}
|
|
3145
|
-
var
|
|
3145
|
+
var ho = Array.prototype.reduce;
|
|
3146
3146
|
function Ze(e) {
|
|
3147
3147
|
if (!(this instanceof Ze)) return new Ze(e);
|
|
3148
3148
|
var t = {
|
|
3149
|
-
rules:
|
|
3149
|
+
rules: X,
|
|
3150
3150
|
headingStyle: "setext",
|
|
3151
3151
|
hr: "* * *",
|
|
3152
3152
|
bulletListMarker: "*",
|
|
@@ -3178,7 +3178,7 @@ function Ze(e) {
|
|
|
3178
3178
|
` : n;
|
|
3179
3179
|
}
|
|
3180
3180
|
};
|
|
3181
|
-
this.options =
|
|
3181
|
+
this.options = ji({}, t, e), this.rules = new Tn(this.options);
|
|
3182
3182
|
}
|
|
3183
3183
|
Ze.prototype = {
|
|
3184
3184
|
/**
|
|
@@ -3189,11 +3189,11 @@ Ze.prototype = {
|
|
|
3189
3189
|
* @type String
|
|
3190
3190
|
*/
|
|
3191
3191
|
turndown: function(e) {
|
|
3192
|
-
if (!
|
|
3192
|
+
if (!go(e))
|
|
3193
3193
|
throw new TypeError(e + " is not a string, or an element/document/fragment node.");
|
|
3194
3194
|
if (e === "") return "";
|
|
3195
|
-
var t =
|
|
3196
|
-
return
|
|
3195
|
+
var t = Ln.call(this, new io(e, this.options));
|
|
3196
|
+
return fo.call(this, t);
|
|
3197
3197
|
},
|
|
3198
3198
|
/**
|
|
3199
3199
|
* Add one or more plugins
|
|
@@ -3250,43 +3250,43 @@ Ze.prototype = {
|
|
|
3250
3250
|
* @type String
|
|
3251
3251
|
*/
|
|
3252
3252
|
escape: function(e) {
|
|
3253
|
-
return
|
|
3253
|
+
return En(e);
|
|
3254
3254
|
}
|
|
3255
3255
|
};
|
|
3256
|
-
function
|
|
3256
|
+
function Ln(e) {
|
|
3257
3257
|
var t = this;
|
|
3258
|
-
return
|
|
3259
|
-
r = new
|
|
3258
|
+
return ho.call(e.childNodes, function(n, r) {
|
|
3259
|
+
r = new lo(r, t.options);
|
|
3260
3260
|
var o = "";
|
|
3261
|
-
return r.nodeType === 3 ? o = r.isCode ? r.nodeValue : t.escape(r.nodeValue) : r.nodeType === 1 && (o =
|
|
3261
|
+
return r.nodeType === 3 ? o = r.isCode ? r.nodeValue : t.escape(r.nodeValue) : r.nodeType === 1 && (o = po.call(t, r)), In(n, o);
|
|
3262
3262
|
}, "");
|
|
3263
3263
|
}
|
|
3264
|
-
function
|
|
3264
|
+
function fo(e) {
|
|
3265
3265
|
var t = this;
|
|
3266
3266
|
return this.rules.forEach(function(n) {
|
|
3267
3267
|
typeof n.append == "function" && (e = In(e, n.append(t.options)));
|
|
3268
3268
|
}), e.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
|
|
3269
3269
|
}
|
|
3270
|
-
function
|
|
3271
|
-
var t = this.rules.forNode(e), n =
|
|
3270
|
+
function po(e) {
|
|
3271
|
+
var t = this.rules.forNode(e), n = Ln.call(this, e), r = e.flankingWhitespace;
|
|
3272
3272
|
return (r.leading || r.trailing) && (n = n.trim()), r.leading + t.replacement(n, e, this.options) + r.trailing;
|
|
3273
3273
|
}
|
|
3274
3274
|
function In(e, t) {
|
|
3275
|
-
var n =
|
|
3275
|
+
var n = yn(e), r = xn(t), o = Math.max(e.length - n.length, t.length - r.length), i = `
|
|
3276
3276
|
|
|
3277
3277
|
`.substring(0, o);
|
|
3278
3278
|
return n + i + r;
|
|
3279
3279
|
}
|
|
3280
|
-
function
|
|
3280
|
+
function go(e) {
|
|
3281
3281
|
return e != null && (typeof e == "string" || e.nodeType && (e.nodeType === 1 || e.nodeType === 9 || e.nodeType === 11));
|
|
3282
3282
|
}
|
|
3283
|
-
const
|
|
3284
|
-
function
|
|
3285
|
-
const n =
|
|
3286
|
-
return
|
|
3283
|
+
const mo = {};
|
|
3284
|
+
function ko(e, t) {
|
|
3285
|
+
const n = mo, r = typeof n.includeImageAlt == "boolean" ? n.includeImageAlt : !0, o = typeof n.includeHtml == "boolean" ? n.includeHtml : !0;
|
|
3286
|
+
return An(e, r, o);
|
|
3287
3287
|
}
|
|
3288
|
-
function
|
|
3289
|
-
if (
|
|
3288
|
+
function An(e, t, n) {
|
|
3289
|
+
if (bo(e)) {
|
|
3290
3290
|
if ("value" in e)
|
|
3291
3291
|
return e.type === "html" && !n ? "" : e.value;
|
|
3292
3292
|
if (t && "alt" in e && e.alt)
|
|
@@ -3300,132 +3300,132 @@ function Kt(e, t, n) {
|
|
|
3300
3300
|
const r = [];
|
|
3301
3301
|
let o = -1;
|
|
3302
3302
|
for (; ++o < e.length; )
|
|
3303
|
-
r[o] =
|
|
3303
|
+
r[o] = An(e[o], t, n);
|
|
3304
3304
|
return r.join("");
|
|
3305
3305
|
}
|
|
3306
|
-
function
|
|
3306
|
+
function bo(e) {
|
|
3307
3307
|
return !!(e && typeof e == "object");
|
|
3308
3308
|
}
|
|
3309
|
-
const
|
|
3310
|
-
function
|
|
3311
|
-
return e.replace(
|
|
3309
|
+
const xo = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
3310
|
+
function yo(e) {
|
|
3311
|
+
return e.replace(xo, wo);
|
|
3312
3312
|
}
|
|
3313
|
-
function
|
|
3313
|
+
function wo(e, t, n) {
|
|
3314
3314
|
if (t)
|
|
3315
3315
|
return t;
|
|
3316
3316
|
if (n.charCodeAt(0) === 35) {
|
|
3317
3317
|
const o = n.charCodeAt(1), i = o === 120 || o === 88;
|
|
3318
|
-
return
|
|
3318
|
+
return vt(n.slice(i ? 2 : 1), i ? 16 : 10);
|
|
3319
3319
|
}
|
|
3320
3320
|
return Je(n) || e;
|
|
3321
3321
|
}
|
|
3322
|
-
function
|
|
3323
|
-
return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? Yt(e.position) : "start" in e || "end" in e ? Yt(e) : "line" in e || "column" in e ?
|
|
3322
|
+
function Ye(e) {
|
|
3323
|
+
return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? Yt(e.position) : "start" in e || "end" in e ? Yt(e) : "line" in e || "column" in e ? St(e) : "";
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function St(e) {
|
|
3326
3326
|
return Gt(e && e.line) + ":" + Gt(e && e.column);
|
|
3327
3327
|
}
|
|
3328
3328
|
function Yt(e) {
|
|
3329
|
-
return
|
|
3329
|
+
return St(e && e.start) + "-" + St(e && e.end);
|
|
3330
3330
|
}
|
|
3331
3331
|
function Gt(e) {
|
|
3332
3332
|
return e && typeof e == "number" ? e : 1;
|
|
3333
3333
|
}
|
|
3334
|
-
const
|
|
3334
|
+
const zn = {}.hasOwnProperty;
|
|
3335
3335
|
function Xt(e, t, n) {
|
|
3336
|
-
return t && typeof t == "object" && (n = t, t = void 0),
|
|
3336
|
+
return t && typeof t == "object" && (n = t, t = void 0), So(n)(mn(gn(n).document().write(kn()(e, t, !0))));
|
|
3337
3337
|
}
|
|
3338
|
-
function
|
|
3338
|
+
function So(e) {
|
|
3339
3339
|
const t = {
|
|
3340
3340
|
transforms: [],
|
|
3341
3341
|
canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
|
|
3342
3342
|
enter: {
|
|
3343
|
-
autolink: i(
|
|
3344
|
-
autolinkProtocol:
|
|
3345
|
-
autolinkEmail:
|
|
3346
|
-
atxHeading: i(
|
|
3343
|
+
autolink: i(We),
|
|
3344
|
+
autolinkProtocol: $,
|
|
3345
|
+
autolinkEmail: $,
|
|
3346
|
+
atxHeading: i(Ve),
|
|
3347
3347
|
blockQuote: i(Ee),
|
|
3348
|
-
characterEscape:
|
|
3349
|
-
characterReference:
|
|
3348
|
+
characterEscape: $,
|
|
3349
|
+
characterReference: $,
|
|
3350
3350
|
codeFenced: i(Fe),
|
|
3351
3351
|
codeFencedFenceInfo: a,
|
|
3352
3352
|
codeFencedFenceMeta: a,
|
|
3353
3353
|
codeIndented: i(Fe, a),
|
|
3354
3354
|
codeText: i(rt, a),
|
|
3355
|
-
codeTextData:
|
|
3356
|
-
data:
|
|
3357
|
-
codeFlowValue:
|
|
3358
|
-
definition: i(
|
|
3355
|
+
codeTextData: $,
|
|
3356
|
+
data: $,
|
|
3357
|
+
codeFlowValue: $,
|
|
3358
|
+
definition: i(He),
|
|
3359
3359
|
definitionDestinationString: a,
|
|
3360
3360
|
definitionLabelString: a,
|
|
3361
3361
|
definitionTitleString: a,
|
|
3362
3362
|
emphasis: i(it),
|
|
3363
|
-
hardBreakEscape: i(
|
|
3364
|
-
hardBreakTrailing: i(
|
|
3365
|
-
htmlFlow: i(
|
|
3366
|
-
htmlFlowData:
|
|
3367
|
-
htmlText: i(
|
|
3368
|
-
htmlTextData:
|
|
3363
|
+
hardBreakEscape: i(qe),
|
|
3364
|
+
hardBreakTrailing: i(qe),
|
|
3365
|
+
htmlFlow: i(Ue, a),
|
|
3366
|
+
htmlFlowData: $,
|
|
3367
|
+
htmlText: i(Ue, a),
|
|
3368
|
+
htmlTextData: $,
|
|
3369
3369
|
image: i(ot),
|
|
3370
3370
|
label: a,
|
|
3371
|
-
link: i(
|
|
3371
|
+
link: i(We),
|
|
3372
3372
|
listItem: i(at),
|
|
3373
3373
|
listItemValue: g,
|
|
3374
|
-
listOrdered: i(
|
|
3375
|
-
listUnordered: i(
|
|
3374
|
+
listOrdered: i(je, p),
|
|
3375
|
+
listUnordered: i(je),
|
|
3376
3376
|
paragraph: i(lt),
|
|
3377
3377
|
reference: d,
|
|
3378
3378
|
referenceString: a,
|
|
3379
3379
|
resourceDestinationString: a,
|
|
3380
3380
|
resourceTitleString: a,
|
|
3381
|
-
setextHeading: i(
|
|
3381
|
+
setextHeading: i(Ve),
|
|
3382
3382
|
strong: i(ut),
|
|
3383
3383
|
thematicBreak: i(ct)
|
|
3384
3384
|
},
|
|
3385
3385
|
exit: {
|
|
3386
3386
|
atxHeading: s(),
|
|
3387
|
-
atxHeadingSequence:
|
|
3387
|
+
atxHeadingSequence: z,
|
|
3388
3388
|
autolink: s(),
|
|
3389
3389
|
autolinkEmail: Ce,
|
|
3390
|
-
autolinkProtocol:
|
|
3390
|
+
autolinkProtocol: be,
|
|
3391
3391
|
blockQuote: s(),
|
|
3392
|
-
characterEscapeValue:
|
|
3392
|
+
characterEscapeValue: N,
|
|
3393
3393
|
characterReferenceMarkerHexadecimal: _e,
|
|
3394
3394
|
characterReferenceMarkerNumeric: _e,
|
|
3395
3395
|
characterReferenceValue: j,
|
|
3396
|
-
characterReference:
|
|
3396
|
+
characterReference: ze,
|
|
3397
3397
|
codeFenced: s(A),
|
|
3398
|
-
codeFencedFence:
|
|
3398
|
+
codeFencedFence: v,
|
|
3399
3399
|
codeFencedFenceInfo: c,
|
|
3400
|
-
codeFencedFenceMeta:
|
|
3401
|
-
codeFlowValue:
|
|
3402
|
-
codeIndented: s(
|
|
3400
|
+
codeFencedFenceMeta: x,
|
|
3401
|
+
codeFlowValue: N,
|
|
3402
|
+
codeIndented: s(b),
|
|
3403
3403
|
codeText: s(R),
|
|
3404
|
-
codeTextData:
|
|
3405
|
-
data:
|
|
3404
|
+
codeTextData: N,
|
|
3405
|
+
data: N,
|
|
3406
3406
|
definition: s(),
|
|
3407
3407
|
definitionDestinationString: O,
|
|
3408
|
-
definitionLabelString:
|
|
3408
|
+
definitionLabelString: S,
|
|
3409
3409
|
definitionTitleString: _,
|
|
3410
3410
|
emphasis: s(),
|
|
3411
3411
|
hardBreakEscape: s(E),
|
|
3412
3412
|
hardBreakTrailing: s(E),
|
|
3413
3413
|
htmlFlow: s(D),
|
|
3414
|
-
htmlFlowData:
|
|
3414
|
+
htmlFlowData: N,
|
|
3415
3415
|
htmlText: s(V),
|
|
3416
|
-
htmlTextData:
|
|
3416
|
+
htmlTextData: N,
|
|
3417
3417
|
image: s(W),
|
|
3418
3418
|
label: de,
|
|
3419
|
-
labelText:
|
|
3419
|
+
labelText: ie,
|
|
3420
3420
|
lineEnding: T,
|
|
3421
3421
|
link: s(Q),
|
|
3422
3422
|
listItem: s(),
|
|
3423
3423
|
listOrdered: s(),
|
|
3424
3424
|
listUnordered: s(),
|
|
3425
3425
|
paragraph: s(),
|
|
3426
|
-
referenceString:
|
|
3426
|
+
referenceString: ae,
|
|
3427
3427
|
resourceDestinationString: h,
|
|
3428
|
-
resourceTitleString:
|
|
3428
|
+
resourceTitleString: oe,
|
|
3429
3429
|
resource: fe,
|
|
3430
3430
|
setextHeading: s(q),
|
|
3431
3431
|
setextHeadingLineSequence: M,
|
|
@@ -3442,7 +3442,7 @@ function ko(e) {
|
|
|
3442
3442
|
type: "root",
|
|
3443
3443
|
children: []
|
|
3444
3444
|
};
|
|
3445
|
-
const
|
|
3445
|
+
const I = {
|
|
3446
3446
|
stack: [y],
|
|
3447
3447
|
tokenStack: [],
|
|
3448
3448
|
config: t,
|
|
@@ -3451,33 +3451,33 @@ function ko(e) {
|
|
|
3451
3451
|
buffer: a,
|
|
3452
3452
|
resume: f,
|
|
3453
3453
|
data: n
|
|
3454
|
-
},
|
|
3454
|
+
}, B = [];
|
|
3455
3455
|
let P = -1;
|
|
3456
3456
|
for (; ++P < m.length; )
|
|
3457
3457
|
if (m[P][1].type === "listOrdered" || m[P][1].type === "listUnordered")
|
|
3458
3458
|
if (m[P][0] === "enter")
|
|
3459
|
-
|
|
3459
|
+
B.push(P);
|
|
3460
3460
|
else {
|
|
3461
|
-
const
|
|
3462
|
-
P = o(m,
|
|
3461
|
+
const le = B.pop();
|
|
3462
|
+
P = o(m, le, P);
|
|
3463
3463
|
}
|
|
3464
3464
|
for (P = -1; ++P < m.length; ) {
|
|
3465
|
-
const
|
|
3466
|
-
|
|
3465
|
+
const le = t[m[P][0]];
|
|
3466
|
+
zn.call(le, m[P][1].type) && le[m[P][1].type].call(Object.assign({
|
|
3467
3467
|
sliceSerialize: m[P][2].sliceSerialize
|
|
3468
|
-
},
|
|
3468
|
+
}, I), m[P][1]);
|
|
3469
3469
|
}
|
|
3470
|
-
if (
|
|
3471
|
-
const
|
|
3472
|
-
(
|
|
3470
|
+
if (I.tokenStack.length > 0) {
|
|
3471
|
+
const le = I.tokenStack[I.tokenStack.length - 1];
|
|
3472
|
+
(le[1] || Zt).call(I, void 0, le[0]);
|
|
3473
3473
|
}
|
|
3474
3474
|
for (y.position = {
|
|
3475
|
-
start:
|
|
3475
|
+
start: Le(m.length > 0 ? m[0][1].start : {
|
|
3476
3476
|
line: 1,
|
|
3477
3477
|
column: 1,
|
|
3478
3478
|
offset: 0
|
|
3479
3479
|
}),
|
|
3480
|
-
end:
|
|
3480
|
+
end: Le(m.length > 0 ? m[m.length - 2][1].end : {
|
|
3481
3481
|
line: 1,
|
|
3482
3482
|
column: 1,
|
|
3483
3483
|
offset: 0
|
|
@@ -3486,19 +3486,19 @@ function ko(e) {
|
|
|
3486
3486
|
y = t.transforms[P](y) || y;
|
|
3487
3487
|
return y;
|
|
3488
3488
|
}
|
|
3489
|
-
function o(m, y,
|
|
3490
|
-
let
|
|
3491
|
-
for (; ++
|
|
3492
|
-
const
|
|
3493
|
-
switch (
|
|
3489
|
+
function o(m, y, I) {
|
|
3490
|
+
let B = y - 1, P = -1, le = !1, xe, ce, Be, Re;
|
|
3491
|
+
for (; ++B <= I; ) {
|
|
3492
|
+
const Z = m[B];
|
|
3493
|
+
switch (Z[1].type) {
|
|
3494
3494
|
case "listUnordered":
|
|
3495
3495
|
case "listOrdered":
|
|
3496
3496
|
case "blockQuote": {
|
|
3497
|
-
|
|
3497
|
+
Z[0] === "enter" ? P++ : P--, Re = void 0;
|
|
3498
3498
|
break;
|
|
3499
3499
|
}
|
|
3500
3500
|
case "lineEndingBlank": {
|
|
3501
|
-
|
|
3501
|
+
Z[0] === "enter" && (xe && !Re && !P && !Be && (Be = B), Re = void 0);
|
|
3502
3502
|
break;
|
|
3503
3503
|
}
|
|
3504
3504
|
case "linePrefix":
|
|
@@ -3510,36 +3510,36 @@ function ko(e) {
|
|
|
3510
3510
|
default:
|
|
3511
3511
|
Re = void 0;
|
|
3512
3512
|
}
|
|
3513
|
-
if (!P &&
|
|
3514
|
-
if (
|
|
3515
|
-
let Te =
|
|
3513
|
+
if (!P && Z[0] === "enter" && Z[1].type === "listItemPrefix" || P === -1 && Z[0] === "exit" && (Z[1].type === "listUnordered" || Z[1].type === "listOrdered")) {
|
|
3514
|
+
if (xe) {
|
|
3515
|
+
let Te = B;
|
|
3516
3516
|
for (ce = void 0; Te--; ) {
|
|
3517
3517
|
const pe = m[Te];
|
|
3518
3518
|
if (pe[1].type === "lineEnding" || pe[1].type === "lineEndingBlank") {
|
|
3519
3519
|
if (pe[0] === "exit") continue;
|
|
3520
|
-
ce && (m[ce][1].type = "lineEndingBlank",
|
|
3520
|
+
ce && (m[ce][1].type = "lineEndingBlank", le = !0), pe[1].type = "lineEnding", ce = Te;
|
|
3521
3521
|
} else if (!(pe[1].type === "linePrefix" || pe[1].type === "blockQuotePrefix" || pe[1].type === "blockQuotePrefixWhitespace" || pe[1].type === "blockQuoteMarker" || pe[1].type === "listItemIndent")) break;
|
|
3522
3522
|
}
|
|
3523
|
-
|
|
3523
|
+
Be && (!ce || Be < ce) && (xe._spread = !0), xe.end = Object.assign({}, ce ? m[ce][1].start : Z[1].end), m.splice(ce || B, 0, ["exit", xe, Z[2]]), B++, I++;
|
|
3524
3524
|
}
|
|
3525
|
-
if (
|
|
3525
|
+
if (Z[1].type === "listItemPrefix") {
|
|
3526
3526
|
const Te = {
|
|
3527
3527
|
type: "listItem",
|
|
3528
3528
|
_spread: !1,
|
|
3529
|
-
start: Object.assign({},
|
|
3529
|
+
start: Object.assign({}, Z[1].start),
|
|
3530
3530
|
// @ts-expect-error: we’ll add `end` in a second.
|
|
3531
3531
|
end: void 0
|
|
3532
3532
|
};
|
|
3533
|
-
|
|
3533
|
+
xe = Te, m.splice(B, 0, ["enter", Te, Z[2]]), B++, I++, Be = void 0, Re = !0;
|
|
3534
3534
|
}
|
|
3535
3535
|
}
|
|
3536
3536
|
}
|
|
3537
|
-
return m[y][1]._spread =
|
|
3537
|
+
return m[y][1]._spread = le, I;
|
|
3538
3538
|
}
|
|
3539
3539
|
function i(m, y) {
|
|
3540
|
-
return
|
|
3541
|
-
function
|
|
3542
|
-
l.call(this, m(
|
|
3540
|
+
return I;
|
|
3541
|
+
function I(B) {
|
|
3542
|
+
l.call(this, m(B), B), y && y.call(this, B);
|
|
3543
3543
|
}
|
|
3544
3544
|
}
|
|
3545
3545
|
function a() {
|
|
@@ -3548,31 +3548,31 @@ function ko(e) {
|
|
|
3548
3548
|
children: []
|
|
3549
3549
|
});
|
|
3550
3550
|
}
|
|
3551
|
-
function l(m, y,
|
|
3552
|
-
this.stack[this.stack.length - 1].children.push(m), this.stack.push(m), this.tokenStack.push([y,
|
|
3553
|
-
start:
|
|
3551
|
+
function l(m, y, I) {
|
|
3552
|
+
this.stack[this.stack.length - 1].children.push(m), this.stack.push(m), this.tokenStack.push([y, I || void 0]), m.position = {
|
|
3553
|
+
start: Le(y.start),
|
|
3554
3554
|
// @ts-expect-error: `end` will be patched later.
|
|
3555
3555
|
end: void 0
|
|
3556
3556
|
};
|
|
3557
3557
|
}
|
|
3558
3558
|
function s(m) {
|
|
3559
3559
|
return y;
|
|
3560
|
-
function y(
|
|
3561
|
-
m && m.call(this,
|
|
3560
|
+
function y(I) {
|
|
3561
|
+
m && m.call(this, I), u.call(this, I);
|
|
3562
3562
|
}
|
|
3563
3563
|
}
|
|
3564
3564
|
function u(m, y) {
|
|
3565
|
-
const
|
|
3566
|
-
if (
|
|
3567
|
-
|
|
3568
|
-
else throw new Error("Cannot close `" + m.type + "` (" +
|
|
3565
|
+
const I = this.stack.pop(), B = this.tokenStack.pop();
|
|
3566
|
+
if (B)
|
|
3567
|
+
B[0].type !== m.type && (y ? y.call(this, m, B[0]) : (B[1] || Zt).call(this, m, B[0]));
|
|
3568
|
+
else throw new Error("Cannot close `" + m.type + "` (" + Ye({
|
|
3569
3569
|
start: m.start,
|
|
3570
3570
|
end: m.end
|
|
3571
3571
|
}) + "): it’s not open");
|
|
3572
|
-
|
|
3572
|
+
I.position.end = Le(m.end);
|
|
3573
3573
|
}
|
|
3574
3574
|
function f() {
|
|
3575
|
-
return
|
|
3575
|
+
return ko(this.stack.pop());
|
|
3576
3576
|
}
|
|
3577
3577
|
function p() {
|
|
3578
3578
|
this.data.expectingFirstListItemValue = !0;
|
|
@@ -3587,24 +3587,24 @@ function ko(e) {
|
|
|
3587
3587
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
3588
3588
|
y.lang = m;
|
|
3589
3589
|
}
|
|
3590
|
-
function
|
|
3590
|
+
function x() {
|
|
3591
3591
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
3592
3592
|
y.meta = m;
|
|
3593
3593
|
}
|
|
3594
|
-
function
|
|
3594
|
+
function v() {
|
|
3595
3595
|
this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
|
|
3596
3596
|
}
|
|
3597
3597
|
function A() {
|
|
3598
3598
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
3599
3599
|
y.value = m.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
|
|
3600
3600
|
}
|
|
3601
|
-
function
|
|
3601
|
+
function b() {
|
|
3602
3602
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
3603
3603
|
y.value = m.replace(/(\r?\n|\r)$/g, "");
|
|
3604
3604
|
}
|
|
3605
|
-
function
|
|
3606
|
-
const y = this.resume(),
|
|
3607
|
-
|
|
3605
|
+
function S(m) {
|
|
3606
|
+
const y = this.resume(), I = this.stack[this.stack.length - 1];
|
|
3607
|
+
I.label = y, I.identifier = Ie(this.sliceSerialize(m)).toLowerCase();
|
|
3608
3608
|
}
|
|
3609
3609
|
function _() {
|
|
3610
3610
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
@@ -3614,11 +3614,11 @@ function ko(e) {
|
|
|
3614
3614
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
3615
3615
|
y.url = m;
|
|
3616
3616
|
}
|
|
3617
|
-
function
|
|
3617
|
+
function z(m) {
|
|
3618
3618
|
const y = this.stack[this.stack.length - 1];
|
|
3619
3619
|
if (!y.depth) {
|
|
3620
|
-
const
|
|
3621
|
-
y.depth =
|
|
3620
|
+
const I = this.sliceSerialize(m).length;
|
|
3621
|
+
y.depth = I;
|
|
3622
3622
|
}
|
|
3623
3623
|
}
|
|
3624
3624
|
function k() {
|
|
@@ -3631,27 +3631,27 @@ function ko(e) {
|
|
|
3631
3631
|
function q() {
|
|
3632
3632
|
this.data.setextHeadingSlurpLineEnding = void 0;
|
|
3633
3633
|
}
|
|
3634
|
-
function
|
|
3635
|
-
const
|
|
3636
|
-
let
|
|
3637
|
-
(!
|
|
3638
|
-
start:
|
|
3634
|
+
function $(m) {
|
|
3635
|
+
const I = this.stack[this.stack.length - 1].children;
|
|
3636
|
+
let B = I[I.length - 1];
|
|
3637
|
+
(!B || B.type !== "text") && (B = st(), B.position = {
|
|
3638
|
+
start: Le(m.start),
|
|
3639
3639
|
// @ts-expect-error: we’ll add `end` later.
|
|
3640
3640
|
end: void 0
|
|
3641
|
-
},
|
|
3641
|
+
}, I.push(B)), this.stack.push(B);
|
|
3642
3642
|
}
|
|
3643
|
-
function
|
|
3643
|
+
function N(m) {
|
|
3644
3644
|
const y = this.stack.pop();
|
|
3645
|
-
y.value += this.sliceSerialize(m), y.position.end =
|
|
3645
|
+
y.value += this.sliceSerialize(m), y.position.end = Le(m.end);
|
|
3646
3646
|
}
|
|
3647
3647
|
function T(m) {
|
|
3648
3648
|
const y = this.stack[this.stack.length - 1];
|
|
3649
3649
|
if (this.data.atHardBreak) {
|
|
3650
|
-
const
|
|
3651
|
-
|
|
3650
|
+
const I = y.children[y.children.length - 1];
|
|
3651
|
+
I.position.end = Le(m.end), this.data.atHardBreak = void 0;
|
|
3652
3652
|
return;
|
|
3653
3653
|
}
|
|
3654
|
-
!this.data.setextHeadingSlurpLineEnding && t.canContainEols.includes(y.type) && (
|
|
3654
|
+
!this.data.setextHeadingSlurpLineEnding && t.canContainEols.includes(y.type) && ($.call(this, m), N.call(this, m));
|
|
3655
3655
|
}
|
|
3656
3656
|
function E() {
|
|
3657
3657
|
this.data.atHardBreak = !0;
|
|
@@ -3686,23 +3686,23 @@ function ko(e) {
|
|
|
3686
3686
|
delete m.identifier, delete m.label;
|
|
3687
3687
|
this.data.referenceType = void 0;
|
|
3688
3688
|
}
|
|
3689
|
-
function
|
|
3690
|
-
const y = this.sliceSerialize(m),
|
|
3691
|
-
|
|
3689
|
+
function ie(m) {
|
|
3690
|
+
const y = this.sliceSerialize(m), I = this.stack[this.stack.length - 2];
|
|
3691
|
+
I.label = yo(y), I.identifier = Ie(y).toLowerCase();
|
|
3692
3692
|
}
|
|
3693
3693
|
function de() {
|
|
3694
|
-
const m = this.stack[this.stack.length - 1], y = this.resume(),
|
|
3695
|
-
if (this.data.inReference = !0,
|
|
3696
|
-
const
|
|
3697
|
-
|
|
3694
|
+
const m = this.stack[this.stack.length - 1], y = this.resume(), I = this.stack[this.stack.length - 1];
|
|
3695
|
+
if (this.data.inReference = !0, I.type === "link") {
|
|
3696
|
+
const B = m.children;
|
|
3697
|
+
I.children = B;
|
|
3698
3698
|
} else
|
|
3699
|
-
|
|
3699
|
+
I.alt = y;
|
|
3700
3700
|
}
|
|
3701
3701
|
function h() {
|
|
3702
3702
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
3703
3703
|
y.url = m;
|
|
3704
3704
|
}
|
|
3705
|
-
function
|
|
3705
|
+
function oe() {
|
|
3706
3706
|
const m = this.resume(), y = this.stack[this.stack.length - 1];
|
|
3707
3707
|
y.title = m;
|
|
3708
3708
|
}
|
|
@@ -3712,31 +3712,31 @@ function ko(e) {
|
|
|
3712
3712
|
function d() {
|
|
3713
3713
|
this.data.referenceType = "collapsed";
|
|
3714
3714
|
}
|
|
3715
|
-
function
|
|
3716
|
-
const y = this.resume(),
|
|
3717
|
-
|
|
3715
|
+
function ae(m) {
|
|
3716
|
+
const y = this.resume(), I = this.stack[this.stack.length - 1];
|
|
3717
|
+
I.label = y, I.identifier = Ie(this.sliceSerialize(m)).toLowerCase(), this.data.referenceType = "full";
|
|
3718
3718
|
}
|
|
3719
3719
|
function _e(m) {
|
|
3720
3720
|
this.data.characterReferenceType = m.type;
|
|
3721
3721
|
}
|
|
3722
3722
|
function j(m) {
|
|
3723
|
-
const y = this.sliceSerialize(m),
|
|
3724
|
-
let
|
|
3725
|
-
|
|
3723
|
+
const y = this.sliceSerialize(m), I = this.data.characterReferenceType;
|
|
3724
|
+
let B;
|
|
3725
|
+
I ? (B = vt(y, I === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : B = Je(y);
|
|
3726
3726
|
const P = this.stack[this.stack.length - 1];
|
|
3727
|
-
P.value +=
|
|
3727
|
+
P.value += B;
|
|
3728
3728
|
}
|
|
3729
|
-
function
|
|
3729
|
+
function ze(m) {
|
|
3730
3730
|
const y = this.stack.pop();
|
|
3731
|
-
y.position.end =
|
|
3731
|
+
y.position.end = Le(m.end);
|
|
3732
3732
|
}
|
|
3733
|
-
function
|
|
3734
|
-
|
|
3733
|
+
function be(m) {
|
|
3734
|
+
N.call(this, m);
|
|
3735
3735
|
const y = this.stack[this.stack.length - 1];
|
|
3736
3736
|
y.url = this.sliceSerialize(m);
|
|
3737
3737
|
}
|
|
3738
3738
|
function Ce(m) {
|
|
3739
|
-
|
|
3739
|
+
N.call(this, m);
|
|
3740
3740
|
const y = this.stack[this.stack.length - 1];
|
|
3741
3741
|
y.url = "mailto:" + this.sliceSerialize(m);
|
|
3742
3742
|
}
|
|
@@ -3760,7 +3760,7 @@ function ko(e) {
|
|
|
3760
3760
|
value: ""
|
|
3761
3761
|
};
|
|
3762
3762
|
}
|
|
3763
|
-
function
|
|
3763
|
+
function He() {
|
|
3764
3764
|
return {
|
|
3765
3765
|
type: "definition",
|
|
3766
3766
|
identifier: "",
|
|
@@ -3775,7 +3775,7 @@ function ko(e) {
|
|
|
3775
3775
|
children: []
|
|
3776
3776
|
};
|
|
3777
3777
|
}
|
|
3778
|
-
function
|
|
3778
|
+
function Ve() {
|
|
3779
3779
|
return {
|
|
3780
3780
|
type: "heading",
|
|
3781
3781
|
// @ts-expect-error `depth` will be set later.
|
|
@@ -3783,12 +3783,12 @@ function ko(e) {
|
|
|
3783
3783
|
children: []
|
|
3784
3784
|
};
|
|
3785
3785
|
}
|
|
3786
|
-
function
|
|
3786
|
+
function qe() {
|
|
3787
3787
|
return {
|
|
3788
3788
|
type: "break"
|
|
3789
3789
|
};
|
|
3790
3790
|
}
|
|
3791
|
-
function
|
|
3791
|
+
function Ue() {
|
|
3792
3792
|
return {
|
|
3793
3793
|
type: "html",
|
|
3794
3794
|
value: ""
|
|
@@ -3802,7 +3802,7 @@ function ko(e) {
|
|
|
3802
3802
|
alt: null
|
|
3803
3803
|
};
|
|
3804
3804
|
}
|
|
3805
|
-
function
|
|
3805
|
+
function We() {
|
|
3806
3806
|
return {
|
|
3807
3807
|
type: "link",
|
|
3808
3808
|
title: null,
|
|
@@ -3810,7 +3810,7 @@ function ko(e) {
|
|
|
3810
3810
|
children: []
|
|
3811
3811
|
};
|
|
3812
3812
|
}
|
|
3813
|
-
function
|
|
3813
|
+
function je(m) {
|
|
3814
3814
|
return {
|
|
3815
3815
|
type: "list",
|
|
3816
3816
|
ordered: m.type === "listOrdered",
|
|
@@ -3851,7 +3851,7 @@ function ko(e) {
|
|
|
3851
3851
|
};
|
|
3852
3852
|
}
|
|
3853
3853
|
}
|
|
3854
|
-
function
|
|
3854
|
+
function Le(e) {
|
|
3855
3855
|
return {
|
|
3856
3856
|
line: e.line,
|
|
3857
3857
|
column: e.column,
|
|
@@ -3862,13 +3862,13 @@ function Bn(e, t) {
|
|
|
3862
3862
|
let n = -1;
|
|
3863
3863
|
for (; ++n < t.length; ) {
|
|
3864
3864
|
const r = t[n];
|
|
3865
|
-
Array.isArray(r) ? Bn(e, r) :
|
|
3865
|
+
Array.isArray(r) ? Bn(e, r) : _o(e, r);
|
|
3866
3866
|
}
|
|
3867
3867
|
}
|
|
3868
|
-
function
|
|
3868
|
+
function _o(e, t) {
|
|
3869
3869
|
let n;
|
|
3870
3870
|
for (n in t)
|
|
3871
|
-
if (
|
|
3871
|
+
if (zn.call(t, n))
|
|
3872
3872
|
switch (n) {
|
|
3873
3873
|
case "canContainEols": {
|
|
3874
3874
|
const r = t[n];
|
|
@@ -3889,31 +3889,31 @@ function xo(e, t) {
|
|
|
3889
3889
|
}
|
|
3890
3890
|
}
|
|
3891
3891
|
function Zt(e, t) {
|
|
3892
|
-
throw e ? new Error("Cannot close `" + e.type + "` (" +
|
|
3892
|
+
throw e ? new Error("Cannot close `" + e.type + "` (" + Ye({
|
|
3893
3893
|
start: e.start,
|
|
3894
3894
|
end: e.end
|
|
3895
|
-
}) + "): a different token (`" + t.type + "`, " +
|
|
3895
|
+
}) + "): a different token (`" + t.type + "`, " + Ye({
|
|
3896
3896
|
start: t.start,
|
|
3897
3897
|
end: t.end
|
|
3898
|
-
}) + ") is open") : new Error("Cannot close document, a token (`" + t.type + "`, " +
|
|
3898
|
+
}) + ") is open") : new Error("Cannot close document, a token (`" + t.type + "`, " + Ye({
|
|
3899
3899
|
start: t.start,
|
|
3900
3900
|
end: t.end
|
|
3901
3901
|
}) + ") is still open");
|
|
3902
3902
|
}
|
|
3903
|
-
function
|
|
3903
|
+
function vo() {
|
|
3904
3904
|
return {
|
|
3905
3905
|
canContainEols: ["delete"],
|
|
3906
|
-
enter: { strikethrough:
|
|
3907
|
-
exit: { strikethrough:
|
|
3906
|
+
enter: { strikethrough: Co },
|
|
3907
|
+
exit: { strikethrough: Eo }
|
|
3908
3908
|
};
|
|
3909
3909
|
}
|
|
3910
|
-
function
|
|
3910
|
+
function Co(e) {
|
|
3911
3911
|
this.enter({ type: "delete", children: [] }, e);
|
|
3912
3912
|
}
|
|
3913
|
-
function
|
|
3913
|
+
function Eo(e) {
|
|
3914
3914
|
this.exit(e);
|
|
3915
3915
|
}
|
|
3916
|
-
const
|
|
3916
|
+
const Rn = (
|
|
3917
3917
|
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
|
3918
3918
|
/**
|
|
3919
3919
|
* @type {(
|
|
@@ -3930,28 +3930,28 @@ const zn = (
|
|
|
3930
3930
|
*/
|
|
3931
3931
|
(function(e) {
|
|
3932
3932
|
if (e == null)
|
|
3933
|
-
return
|
|
3933
|
+
return Ao;
|
|
3934
3934
|
if (typeof e == "function")
|
|
3935
3935
|
return nt(e);
|
|
3936
3936
|
if (typeof e == "object")
|
|
3937
|
-
return Array.isArray(e) ?
|
|
3937
|
+
return Array.isArray(e) ? To(e) : (
|
|
3938
3938
|
// Cast because `ReadonlyArray` goes into the above but `isArray`
|
|
3939
3939
|
// narrows to `Array`.
|
|
3940
|
-
|
|
3940
|
+
Lo(
|
|
3941
3941
|
/** @type {Props} */
|
|
3942
3942
|
e
|
|
3943
3943
|
)
|
|
3944
3944
|
);
|
|
3945
3945
|
if (typeof e == "string")
|
|
3946
|
-
return
|
|
3946
|
+
return Io(e);
|
|
3947
3947
|
throw new Error("Expected function, string, or object as test");
|
|
3948
3948
|
})
|
|
3949
3949
|
);
|
|
3950
|
-
function
|
|
3950
|
+
function To(e) {
|
|
3951
3951
|
const t = [];
|
|
3952
3952
|
let n = -1;
|
|
3953
3953
|
for (; ++n < e.length; )
|
|
3954
|
-
t[n] =
|
|
3954
|
+
t[n] = Rn(e[n]);
|
|
3955
3955
|
return nt(r);
|
|
3956
3956
|
function r(...o) {
|
|
3957
3957
|
let i = -1;
|
|
@@ -3960,7 +3960,7 @@ function vo(e) {
|
|
|
3960
3960
|
return !1;
|
|
3961
3961
|
}
|
|
3962
3962
|
}
|
|
3963
|
-
function
|
|
3963
|
+
function Lo(e) {
|
|
3964
3964
|
const t = (
|
|
3965
3965
|
/** @type {Record<string, unknown>} */
|
|
3966
3966
|
e
|
|
@@ -3978,7 +3978,7 @@ function _o(e) {
|
|
|
3978
3978
|
return !0;
|
|
3979
3979
|
}
|
|
3980
3980
|
}
|
|
3981
|
-
function
|
|
3981
|
+
function Io(e) {
|
|
3982
3982
|
return nt(t);
|
|
3983
3983
|
function t(n) {
|
|
3984
3984
|
return n && n.type === e;
|
|
@@ -3987,7 +3987,7 @@ function wo(e) {
|
|
|
3987
3987
|
function nt(e) {
|
|
3988
3988
|
return t;
|
|
3989
3989
|
function t(n, r, o) {
|
|
3990
|
-
return !!(
|
|
3990
|
+
return !!(zo(n) && e.call(
|
|
3991
3991
|
this,
|
|
3992
3992
|
n,
|
|
3993
3993
|
typeof r == "number" ? r : void 0,
|
|
@@ -3995,17 +3995,17 @@ function nt(e) {
|
|
|
3995
3995
|
));
|
|
3996
3996
|
}
|
|
3997
3997
|
}
|
|
3998
|
-
function
|
|
3998
|
+
function Ao() {
|
|
3999
3999
|
return !0;
|
|
4000
4000
|
}
|
|
4001
|
-
function
|
|
4001
|
+
function zo(e) {
|
|
4002
4002
|
return e !== null && typeof e == "object" && "type" in e;
|
|
4003
4003
|
}
|
|
4004
|
-
const
|
|
4005
|
-
function
|
|
4004
|
+
const Mn = [], Bo = !0, Jt = !1, Ro = "skip";
|
|
4005
|
+
function Mo(e, t, n, r) {
|
|
4006
4006
|
let o;
|
|
4007
4007
|
typeof t == "function" && typeof n != "function" ? (r = n, n = t) : o = t;
|
|
4008
|
-
const i =
|
|
4008
|
+
const i = Rn(o), a = r ? -1 : 1;
|
|
4009
4009
|
l(e, void 0, [])();
|
|
4010
4010
|
function l(s, u, f) {
|
|
4011
4011
|
const p = (
|
|
@@ -4026,38 +4026,38 @@ function Lo(e, t, n, r) {
|
|
|
4026
4026
|
}
|
|
4027
4027
|
return g;
|
|
4028
4028
|
function g() {
|
|
4029
|
-
let c =
|
|
4030
|
-
if ((!t || i(s, u, f[f.length - 1] || void 0)) && (c =
|
|
4029
|
+
let c = Mn, x, v, A;
|
|
4030
|
+
if ((!t || i(s, u, f[f.length - 1] || void 0)) && (c = Fo(n(s, f)), c[0] === Jt))
|
|
4031
4031
|
return c;
|
|
4032
4032
|
if ("children" in s && s.children) {
|
|
4033
|
-
const
|
|
4033
|
+
const b = (
|
|
4034
4034
|
/** @type {UnistParent} */
|
|
4035
4035
|
s
|
|
4036
4036
|
);
|
|
4037
|
-
if (
|
|
4038
|
-
for (
|
|
4039
|
-
const
|
|
4040
|
-
if (
|
|
4041
|
-
return
|
|
4042
|
-
|
|
4037
|
+
if (b.children && c[0] !== Ro)
|
|
4038
|
+
for (v = (r ? b.children.length : -1) + a, A = f.concat(b); v > -1 && v < b.children.length; ) {
|
|
4039
|
+
const S = b.children[v];
|
|
4040
|
+
if (x = l(S, v, A)(), x[0] === Jt)
|
|
4041
|
+
return x;
|
|
4042
|
+
v = typeof x[1] == "number" ? x[1] : v + a;
|
|
4043
4043
|
}
|
|
4044
4044
|
}
|
|
4045
4045
|
return c;
|
|
4046
4046
|
}
|
|
4047
4047
|
}
|
|
4048
4048
|
}
|
|
4049
|
-
function
|
|
4050
|
-
return Array.isArray(e) ? e : typeof e == "number" ? [
|
|
4049
|
+
function Fo(e) {
|
|
4050
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [Bo, e] : e == null ? Mn : [e];
|
|
4051
4051
|
}
|
|
4052
4052
|
function mt(e, t, n, r) {
|
|
4053
4053
|
let o, i, a;
|
|
4054
|
-
typeof t == "function" && typeof n != "function" ? (i = void 0, a = t, o = n) : (i = t, a = n, o = r),
|
|
4054
|
+
typeof t == "function" && typeof n != "function" ? (i = void 0, a = t, o = n) : (i = t, a = n, o = r), Mo(e, i, l, o);
|
|
4055
4055
|
function l(s, u) {
|
|
4056
4056
|
const f = u[u.length - 1], p = f ? f.children.indexOf(s) : void 0;
|
|
4057
4057
|
return a(s, p, f);
|
|
4058
4058
|
}
|
|
4059
4059
|
}
|
|
4060
|
-
function
|
|
4060
|
+
function Po(e, t, n) {
|
|
4061
4061
|
const r = e.slice(0, t), o = /^```[^\n]*(?:\n|$)/gm;
|
|
4062
4062
|
let i = null, a;
|
|
4063
4063
|
for (; (a = o.exec(r)) !== null; )
|
|
@@ -4069,7 +4069,7 @@ function Bo(e, t, n) {
|
|
|
4069
4069
|
return e.slice(0, l) + "```" + n + `
|
|
4070
4070
|
` + e.slice(u);
|
|
4071
4071
|
}
|
|
4072
|
-
function
|
|
4072
|
+
function Oo(e, t, n) {
|
|
4073
4073
|
const r = e.filter(
|
|
4074
4074
|
(a) => a.type === "mark" && a.from <= t && a.to >= n
|
|
4075
4075
|
), i = r.find((a) => a.className?.startsWith("rme-heading-"))?.className?.replace("rme-heading-", "");
|
|
@@ -4087,323 +4087,57 @@ function zo(e, t, n) {
|
|
|
4087
4087
|
codeBlock: r.some((a) => a.className === "rme-code-block")
|
|
4088
4088
|
};
|
|
4089
4089
|
}
|
|
4090
|
-
const
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
display: flex;
|
|
4094
|
-
flex-direction: column;
|
|
4095
|
-
box-sizing: border-box;
|
|
4096
|
-
}
|
|
4097
|
-
|
|
4098
|
-
#rich-view {
|
|
4099
|
-
flex: 1 1 auto;
|
|
4100
|
-
min-height: 0;
|
|
4101
|
-
overflow-y: auto;
|
|
4102
|
-
box-sizing: border-box;
|
|
4103
|
-
outline: none;
|
|
4104
|
-
/* Consumer themes via CSS custom properties */
|
|
4105
|
-
font-family: var(--rme-font-family, inherit);
|
|
4106
|
-
font-size: var(--rme-font-size, inherit);
|
|
4107
|
-
line-height: var(--rme-line-height, 1.6);
|
|
4108
|
-
padding: var(--rme-padding, 0.75em 1em);
|
|
4109
|
-
background: var(--rme-background, Canvas);
|
|
4110
|
-
color: var(--rme-color, CanvasText);
|
|
4111
|
-
border: var(--rme-border, 1px solid ButtonBorder);
|
|
4112
|
-
border-top: none;
|
|
4113
|
-
border-radius: var(--rme-border-radius, 0 0 4px 4px);
|
|
4114
|
-
}
|
|
4115
|
-
|
|
4116
|
-
#rich-view:focus {
|
|
4117
|
-
outline: var(--rme-focus-outline, 2px solid Highlight);
|
|
4118
|
-
outline-offset: -2px;
|
|
4119
|
-
}
|
|
4120
|
-
|
|
4121
|
-
#rich-view[hidden] {
|
|
4122
|
-
display: none;
|
|
4123
|
-
}
|
|
4124
|
-
|
|
4125
|
-
/* Block-level spacing within the rich view */
|
|
4126
|
-
#rich-view > :first-child {
|
|
4127
|
-
margin-top: 0;
|
|
4128
|
-
}
|
|
4129
|
-
#rich-view > :last-child {
|
|
4130
|
-
margin-bottom: 0;
|
|
4131
|
-
}
|
|
4132
|
-
|
|
4133
|
-
/* Source mode wrapper */
|
|
4134
|
-
#source-wrapper {
|
|
4135
|
-
flex: 1 1 auto;
|
|
4136
|
-
min-height: 0;
|
|
4137
|
-
display: flex;
|
|
4138
|
-
flex-direction: column;
|
|
4139
|
-
}
|
|
4140
|
-
|
|
4141
|
-
#source-wrapper[hidden] {
|
|
4142
|
-
display: none;
|
|
4143
|
-
}
|
|
4144
|
-
|
|
4145
|
-
#source-editor {
|
|
4146
|
-
flex: 1 1 auto;
|
|
4147
|
-
display: block;
|
|
4148
|
-
font-family: var(--rme-src-font-family, 'Cascadia Code', 'Fira Code', ui-monospace, monospace);
|
|
4149
|
-
--rc-textarea-border-radius: 0 0 4px 4px;
|
|
4150
|
-
--rc-textarea-border-top: none;
|
|
4151
|
-
}
|
|
4152
|
-
|
|
4153
|
-
rc-editor-toolbar rc-toolbar {
|
|
4154
|
-
display: block;
|
|
4155
|
-
inline-size: 100%;
|
|
4156
|
-
--rc-toolbar-flex-wrap: wrap;
|
|
4157
|
-
--rc-toolbar-gap-inline: var(--rme-toolbar-gap, 1px);
|
|
4158
|
-
--rc-toolbar-padding-block: var(--rme-toolbar-padding, 4px);
|
|
4159
|
-
--rc-toolbar-padding-inline: var(--rme-toolbar-padding, 4px);
|
|
4160
|
-
--rc-toolbar-radius: var(--rme-toolbar-radius, 4px 4px 0 0);
|
|
4161
|
-
}
|
|
4162
|
-
|
|
4163
|
-
rc-editor-toolbar rc-toolbar::part(root) {
|
|
4164
|
-
border: var(--rme-toolbar-border, 1px solid ButtonBorder);
|
|
4165
|
-
background: var(--rme-toolbar-background, Canvas);
|
|
4166
|
-
color: var(--rme-toolbar-color, CanvasText);
|
|
4167
|
-
}
|
|
4168
|
-
|
|
4169
|
-
rc-editor-toolbar rc-button {
|
|
4170
|
-
--rc-button-bg: var(--rme-toolbar-button-background, transparent);
|
|
4171
|
-
--rc-button-color: var(--rme-toolbar-button-color, ButtonText);
|
|
4172
|
-
--rc-button-border: var(--rme-toolbar-button-border, 1px solid transparent);
|
|
4173
|
-
--rc-button-radius: var(--rme-toolbar-button-radius, 3px);
|
|
4174
|
-
--rc-button-block-size: var(--rme-toolbar-button-size, 2rem);
|
|
4175
|
-
--rc-button-icon-size: var(--rme-toolbar-button-size, 2rem);
|
|
4176
|
-
--rc-button-padding-block: 0;
|
|
4177
|
-
--rc-button-padding-inline: 0;
|
|
4178
|
-
--rc-button-font: inherit;
|
|
4179
|
-
--rc-button-state-layer-bg: currentColor;
|
|
4180
|
-
--rc-button-hover-state-layer-opacity: var(--rme-toolbar-button-hover-opacity, 0.08);
|
|
4181
|
-
--rc-button-focus-state-layer-opacity: var(--rme-toolbar-button-focus-opacity, 0.12);
|
|
4182
|
-
--rc-button-pressed-state-layer-opacity: var(--rme-toolbar-button-pressed-opacity, 0.12);
|
|
4183
|
-
}
|
|
4184
|
-
|
|
4185
|
-
rc-editor-toolbar rc-button.toolbar-active {
|
|
4186
|
-
--rc-button-bg: var(--rme-toolbar-button-active-background, Highlight);
|
|
4187
|
-
--rc-button-color: var(--rme-toolbar-button-active-color, HighlightText);
|
|
4188
|
-
--rc-button-border: var(--rme-toolbar-button-active-border, 1px solid Highlight);
|
|
4189
|
-
}
|
|
4190
|
-
|
|
4191
|
-
rc-editor-toolbar rc-button > button:focus-visible {
|
|
4192
|
-
outline: var(--rme-toolbar-focus-outline, 2px solid Highlight);
|
|
4193
|
-
outline-offset: var(--rme-toolbar-focus-outline-offset, 1px);
|
|
4194
|
-
}
|
|
4195
|
-
|
|
4196
|
-
rc-editor-toolbar [data-rc-button-icon] svg {
|
|
4197
|
-
inline-size: 1.15em;
|
|
4198
|
-
block-size: 1.15em;
|
|
4199
|
-
flex-shrink: 0;
|
|
4200
|
-
}
|
|
4201
|
-
|
|
4202
|
-
/* Heading select */
|
|
4203
|
-
rc-editor-toolbar rc-select {
|
|
4204
|
-
font-size: 0.8125em;
|
|
4205
|
-
--rc-select-padding-block: 0.25em;
|
|
4206
|
-
--rc-select-padding-inline: 0.35em;
|
|
4207
|
-
--rc-select-border: var(--rme-toolbar-select-border, 1px solid ButtonBorder);
|
|
4208
|
-
--rc-select-radius: var(--rme-toolbar-select-radius, 3px);
|
|
4209
|
-
}
|
|
4210
|
-
|
|
4211
|
-
rc-editor-toolbar rc-select::part(trigger) {
|
|
4212
|
-
min-width: 0;
|
|
4213
|
-
background: var(--rme-toolbar-select-background, ButtonFace);
|
|
4214
|
-
color: var(--rme-toolbar-select-color, ButtonText);
|
|
4215
|
-
cursor: pointer;
|
|
4216
|
-
}
|
|
4217
|
-
|
|
4218
|
-
rc-editor-toolbar rc-select::part(listbox) {
|
|
4219
|
-
border-radius: 3px;
|
|
4220
|
-
}
|
|
4221
|
-
|
|
4222
|
-
rc-editor-toolbar rc-select.toolbar-active::part(trigger) {
|
|
4223
|
-
background: var(--rme-toolbar-select-active-background, Highlight);
|
|
4224
|
-
color: var(--rme-toolbar-select-active-color, HighlightText);
|
|
4225
|
-
border-color: var(--rme-toolbar-select-active-border-color, Highlight);
|
|
4226
|
-
}
|
|
4227
|
-
|
|
4228
|
-
/* Code block language input */
|
|
4229
|
-
rc-editor-toolbar .lang-input {
|
|
4230
|
-
padding: 0.25em 0.5em;
|
|
4231
|
-
border: var(--rme-toolbar-input-border, 1px solid ButtonBorder);
|
|
4232
|
-
border-radius: var(--rme-toolbar-input-radius, 3px);
|
|
4233
|
-
background: var(--rme-toolbar-input-background, Field);
|
|
4234
|
-
color: var(--rme-toolbar-input-color, FieldText);
|
|
4235
|
-
font: inherit;
|
|
4236
|
-
font-size: 0.8125em;
|
|
4237
|
-
width: 8em;
|
|
4238
|
-
}
|
|
4239
|
-
|
|
4240
|
-
rc-editor-toolbar .lang-input:focus {
|
|
4241
|
-
outline: var(--rme-toolbar-focus-outline, 2px solid Highlight);
|
|
4242
|
-
outline-offset: var(--rme-toolbar-focus-outline-offset, 1px);
|
|
4243
|
-
}
|
|
4244
|
-
|
|
4245
|
-
rc-editor-toolbar .lang-input::placeholder {
|
|
4246
|
-
color: GrayText;
|
|
4247
|
-
}
|
|
4248
|
-
|
|
4249
|
-
#rich-view a {
|
|
4250
|
-
cursor: pointer;
|
|
4251
|
-
text-decoration: underline;
|
|
4252
|
-
}
|
|
4253
|
-
|
|
4254
|
-
#rich-view blockquote {
|
|
4255
|
-
margin: 0.5em 0;
|
|
4256
|
-
padding-left: 1em;
|
|
4257
|
-
border-left: 3px solid ButtonBorder;
|
|
4258
|
-
color: GrayText;
|
|
4259
|
-
}
|
|
4260
|
-
|
|
4261
|
-
#rich-view pre {
|
|
4262
|
-
margin: 0.5em 0;
|
|
4263
|
-
padding: 0.65em 0.85em;
|
|
4264
|
-
background: Field;
|
|
4265
|
-
border: 1px solid ButtonBorder;
|
|
4266
|
-
border-radius: 4px;
|
|
4267
|
-
overflow-x: auto;
|
|
4268
|
-
}
|
|
4269
|
-
|
|
4270
|
-
#rich-view pre code {
|
|
4271
|
-
font-family: 'Cascadia Code', 'Fira Code', ui-monospace, monospace;
|
|
4272
|
-
font-size: 0.875em;
|
|
4273
|
-
}
|
|
4274
|
-
|
|
4275
|
-
#rich-view ul,
|
|
4276
|
-
#rich-view ol {
|
|
4277
|
-
margin: 0.5em 0;
|
|
4278
|
-
padding-left: 1.75em;
|
|
4279
|
-
}
|
|
4280
|
-
|
|
4281
|
-
#rich-view li {
|
|
4282
|
-
margin: 0.2em 0;
|
|
4283
|
-
}
|
|
4284
|
-
|
|
4285
|
-
.link-popover {
|
|
4286
|
-
position: absolute;
|
|
4287
|
-
z-index: 10;
|
|
4288
|
-
display: flex;
|
|
4289
|
-
align-items: center;
|
|
4290
|
-
gap: 2px;
|
|
4291
|
-
padding: 4px;
|
|
4292
|
-
background: Canvas;
|
|
4293
|
-
border: 1px solid ButtonBorder;
|
|
4294
|
-
border-radius: 4px;
|
|
4295
|
-
box-shadow: 0 2px 8px color-mix(in srgb, CanvasText 15%, transparent);
|
|
4296
|
-
}
|
|
4297
|
-
|
|
4298
|
-
.link-popover-input {
|
|
4299
|
-
min-inline-size: 16em;
|
|
4300
|
-
padding: 0.25em 0.4em;
|
|
4301
|
-
border: 1px solid ButtonBorder;
|
|
4302
|
-
border-radius: 3px;
|
|
4303
|
-
background: Field;
|
|
4304
|
-
color: FieldText;
|
|
4305
|
-
font: inherit;
|
|
4306
|
-
font-size: 0.875em;
|
|
4307
|
-
}
|
|
4308
|
-
|
|
4309
|
-
.link-popover-input:focus {
|
|
4310
|
-
outline: 2px solid Highlight;
|
|
4311
|
-
outline-offset: 1px;
|
|
4312
|
-
}
|
|
4313
|
-
|
|
4314
|
-
.link-popover-btn {
|
|
4315
|
-
appearance: none;
|
|
4316
|
-
display: inline-flex;
|
|
4317
|
-
align-items: center;
|
|
4318
|
-
justify-content: center;
|
|
4319
|
-
min-inline-size: 1.75rem;
|
|
4320
|
-
min-block-size: 1.75rem;
|
|
4321
|
-
padding: 0.15em;
|
|
4322
|
-
border: 1px solid transparent;
|
|
4323
|
-
border-radius: 3px;
|
|
4324
|
-
background: transparent;
|
|
4325
|
-
color: ButtonText;
|
|
4326
|
-
font: inherit;
|
|
4327
|
-
font-size: 0.875em;
|
|
4328
|
-
cursor: pointer;
|
|
4329
|
-
line-height: 1;
|
|
4330
|
-
}
|
|
4331
|
-
|
|
4332
|
-
.link-popover-btn:hover:not(:disabled) {
|
|
4333
|
-
background: ButtonFace;
|
|
4334
|
-
border-color: ButtonBorder;
|
|
4335
|
-
}
|
|
4336
|
-
|
|
4337
|
-
.link-popover-btn:focus-visible {
|
|
4338
|
-
outline: 2px solid Highlight;
|
|
4339
|
-
outline-offset: 1px;
|
|
4340
|
-
}
|
|
4341
|
-
|
|
4342
|
-
.link-popover-btn:disabled {
|
|
4343
|
-
opacity: 0.4;
|
|
4344
|
-
cursor: default;
|
|
4345
|
-
}
|
|
4346
|
-
|
|
4347
|
-
::slotted(textarea) {
|
|
4348
|
-
display: none !important;
|
|
4349
|
-
}
|
|
4350
|
-
|
|
4351
|
-
::slotted(label) {
|
|
4352
|
-
display: block;
|
|
4353
|
-
margin-bottom: 0.25em;
|
|
4354
|
-
font-size: 0.875em;
|
|
4355
|
-
}
|
|
4356
|
-
`;
|
|
4357
|
-
var Mo = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, se = (e, t, n, r) => {
|
|
4358
|
-
for (var o = r > 1 ? void 0 : r ? Fo(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4090
|
+
const $o = Hn`:host{box-sizing:border-box;flex-direction:column;display:flex;position:relative}#rich-view{overflow-block:auto;box-sizing:border-box;min-height:0;font-family:var(--rc-markdown-editor-font-family,inherit);font-size:var(--rc-markdown-editor-font-size,inherit);line-height:var(--rc-markdown-editor-line-height,1.6);padding:var(--rc-markdown-editor-padding,.75em 1em);background:var(--rc-markdown-editor-background,Canvas);color:var(--rc-markdown-editor-color,CanvasText);border:var(--rc-markdown-editor-border,1px solid ButtonBorder);border-radius:var(--rc-markdown-editor-border-radius,0 0 4px 4px);border-top:none;outline:none;flex:auto;overflow-y:auto}#rich-view:focus{outline:var(--rc-markdown-editor-focus-outline,2px solid Highlight);outline-offset:-2px}#rich-view[hidden]{display:none}#rich-view>:first-child{margin-top:0}#rich-view>:last-child{margin-bottom:0}#source-wrapper{flex-direction:column;flex:auto;min-height:0;display:flex}#source-wrapper[hidden]{display:none}#source-editor{font-family:var(--rc-markdown-editor-src-font-family,"Cascadia Code", "Fira Code", ui-monospace, monospace);--rc-textarea-border-radius:0 0 4px 4px;--rc-textarea-border-top:none;flex:auto;display:block}rc-editor-toolbar rc-toolbar{--rc-toolbar-flex-wrap:wrap;--rc-toolbar-gap-inline:var(--rc-markdown-editor-toolbar-gap,1px);--rc-toolbar-padding-block:var(--rc-markdown-editor-toolbar-padding,4px);--rc-toolbar-padding-inline:var(--rc-markdown-editor-toolbar-padding,4px);--rc-toolbar-radius:var(--rc-markdown-editor-toolbar-radius,4px 4px 0 0);inline-size:100%;display:block}rc-editor-toolbar rc-toolbar::part(root){border:var(--rc-markdown-editor-toolbar-border,1px solid ButtonBorder);background:var(--rc-markdown-editor-toolbar-background,Canvas);color:var(--rc-markdown-editor-toolbar-color,CanvasText)}rc-editor-toolbar rc-button{--rc-button-bg:var(--rc-markdown-editor-toolbar-button-background,transparent);--rc-button-color:var(--rc-markdown-editor-toolbar-button-color,ButtonText);--rc-button-border:var(--rc-markdown-editor-toolbar-button-border,1px solid transparent);--rc-button-radius:var(--rc-markdown-editor-toolbar-button-radius,3px);--rc-button-block-size:var(--rc-markdown-editor-toolbar-button-size,2rem);--rc-button-icon-size:var(--rc-markdown-editor-toolbar-button-size,2rem);--rc-button-padding-block:0;--rc-button-padding-inline:0;--rc-button-font:inherit;--rc-button-state-layer-bg:currentColor;--rc-button-hover-state-layer-opacity:var(--rc-markdown-editor-toolbar-button-hover-opacity,.08);--rc-button-focus-state-layer-opacity:var(--rc-markdown-editor-toolbar-button-focus-opacity,.12);--rc-button-pressed-state-layer-opacity:var(--rc-markdown-editor-toolbar-button-pressed-opacity,.12)}rc-editor-toolbar rc-button.toolbar-active{--rc-button-bg:var(--rc-markdown-editor-toolbar-button-active-background,Highlight);--rc-button-color:var(--rc-markdown-editor-toolbar-button-active-color,HighlightText);--rc-button-border:var(--rc-markdown-editor-toolbar-button-active-border,1px solid Highlight)}rc-editor-toolbar rc-button>button:focus-visible{outline:var(--rc-markdown-editor-toolbar-focus-outline,2px solid Highlight);outline-offset:var(--rc-markdown-editor-toolbar-focus-outline-offset,1px)}rc-editor-toolbar [data-rc-button-icon] svg{flex-shrink:0;block-size:1.15em;inline-size:1.15em}rc-editor-toolbar .heading-select{border:var(--rc-markdown-editor-toolbar-select-border,1px solid ButtonBorder);border-radius:var(--rc-markdown-editor-toolbar-select-radius,3px);background:var(--rc-markdown-editor-toolbar-select-background,ButtonFace);color:var(--rc-markdown-editor-toolbar-select-color,ButtonText);font:inherit;cursor:pointer;padding:.25em .35em;font-size:.8125em}rc-editor-toolbar .heading-select:focus-visible{outline:var(--rc-markdown-editor-toolbar-focus-outline,2px solid Highlight);outline-offset:var(--rc-markdown-editor-toolbar-focus-outline-offset,1px)}rc-editor-toolbar .heading-select.toolbar-active{border-color:var(--rc-markdown-editor-toolbar-select-active-border-color,Highlight);background:var(--rc-markdown-editor-toolbar-select-active-background,Highlight);color:var(--rc-markdown-editor-toolbar-select-active-color,HighlightText)}rc-editor-toolbar .lang-input{border:var(--rc-markdown-editor-toolbar-input-border,1px solid ButtonBorder);border-radius:var(--rc-markdown-editor-toolbar-input-radius,3px);background:var(--rc-markdown-editor-toolbar-input-background,Field);color:var(--rc-markdown-editor-toolbar-input-color,FieldText);font:inherit;width:8em;padding:.25em .5em;font-size:.8125em}rc-editor-toolbar .lang-input:focus{outline:var(--rc-markdown-editor-toolbar-focus-outline,2px solid Highlight);outline-offset:var(--rc-markdown-editor-toolbar-focus-outline-offset,1px)}rc-editor-toolbar .lang-input::placeholder{color:graytext}#rich-view a{cursor:pointer;text-decoration:underline}#rich-view blockquote{color:graytext;border-inline-start:3px solid buttonborder;margin:.5em 0;padding-inline-start:1em}#rich-view pre{overflow-inline:auto;background:field;border:1px solid buttonborder;border-radius:4px;margin:.5em 0;padding:.65em .85em;overflow-x:auto}#rich-view pre code{font-family:Cascadia Code,Fira Code,ui-monospace,monospace;font-size:.875em}#rich-view ul,#rich-view ol{margin:.5em 0;padding-inline-start:1.75em}#rich-view li{margin:.2em 0}.link-popover{z-index:10;box-shadow:0 2px 8px color-mix(in srgb, CanvasText 15%, transparent);background:canvas;border:1px solid buttonborder;border-radius:4px;align-items:center;gap:2px;padding:4px;display:flex;position:absolute}.link-popover-input{color:fieldtext;min-inline-size:16em;font:inherit;background:field;border:1px solid buttonborder;border-radius:3px;padding:.25em .4em;font-size:.875em}.link-popover-input:focus{outline-offset:1px;outline:2px solid highlight}.link-popover-btn{appearance:none;color:buttontext;min-block-size:1.75rem;min-inline-size:1.75rem;font:inherit;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:3px;justify-content:center;align-items:center;padding:.15em;font-size:.875em;line-height:1;display:inline-flex}.link-popover-btn:hover:not(:disabled){background:buttonface;border-color:buttonborder}.link-popover-btn:focus-visible{outline-offset:1px;outline:2px solid highlight}.link-popover-btn:disabled{opacity:.4;cursor:default}::slotted(textarea){display:none!important}::slotted(label){margin-bottom:.25em;font-size:.875em;display:block}`;
|
|
4091
|
+
var No = Object.defineProperty, Do = Object.getOwnPropertyDescriptor, re = (e, t, n, r) => {
|
|
4092
|
+
for (var o = r > 1 ? void 0 : r ? Do(t, n) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4359
4093
|
(a = e[i]) && (o = (r ? a(t, n, o) : a(o)) || o);
|
|
4360
|
-
return r && o &&
|
|
4094
|
+
return r && o && No(t, n, o), o;
|
|
4361
4095
|
};
|
|
4362
|
-
const
|
|
4363
|
-
|
|
4096
|
+
const Fn = new CSSStyleSheet();
|
|
4097
|
+
Fn.replaceSync(`
|
|
4364
4098
|
.rme-heading-h1,
|
|
4365
4099
|
.rme-heading-h2,
|
|
4366
4100
|
.rme-heading-h3,
|
|
4367
4101
|
.rme-heading-h4,
|
|
4368
4102
|
.rme-heading-h5,
|
|
4369
4103
|
.rme-heading-h6 {
|
|
4370
|
-
color: var(--
|
|
4104
|
+
color: var(--rc-markdown-editor-src-heading-color, light-dark(#1d6fc4, #82b4f5));
|
|
4371
4105
|
}
|
|
4372
4106
|
|
|
4373
4107
|
.rme-code,
|
|
4374
4108
|
.rme-code-block {
|
|
4375
|
-
color: var(--
|
|
4109
|
+
color: var(--rc-markdown-editor-src-code-color, light-dark(#c94a1a, #f09060));
|
|
4376
4110
|
}
|
|
4377
4111
|
|
|
4378
4112
|
.rme-link {
|
|
4379
|
-
color: var(--
|
|
4113
|
+
color: var(--rc-markdown-editor-src-link-color, light-dark(#0370b0, #60b8e8));
|
|
4380
4114
|
}
|
|
4381
4115
|
|
|
4382
4116
|
.rme-blockquote {
|
|
4383
|
-
color: var(--
|
|
4117
|
+
color: var(--rc-markdown-editor-src-blockquote-color, light-dark(#2d7a42, #70b880));
|
|
4384
4118
|
}
|
|
4385
4119
|
|
|
4386
4120
|
.rme-list-bullet,
|
|
4387
4121
|
.rme-list-ordered {
|
|
4388
|
-
color: var(--
|
|
4122
|
+
color: var(--rc-markdown-editor-src-list-color, light-dark(#7a5c0a, #d4ac48));
|
|
4389
4123
|
}
|
|
4390
4124
|
|
|
4391
4125
|
.rme-strikethrough {
|
|
4392
4126
|
text-decoration: line-through;
|
|
4393
|
-
color: var(--
|
|
4127
|
+
color: var(--rc-markdown-editor-src-dim-color, GrayText);
|
|
4394
4128
|
}
|
|
4395
4129
|
|
|
4396
4130
|
.rme-underline {
|
|
4397
4131
|
text-decoration: underline;
|
|
4398
4132
|
}
|
|
4399
4133
|
`);
|
|
4400
|
-
const
|
|
4134
|
+
const Ho = {
|
|
4401
4135
|
allowDangerousHtml: !0,
|
|
4402
|
-
extensions: [
|
|
4136
|
+
extensions: [bn()]
|
|
4403
4137
|
}, en = {
|
|
4404
|
-
extensions: [
|
|
4405
|
-
mdastExtensions: [
|
|
4406
|
-
},
|
|
4138
|
+
extensions: [bn()],
|
|
4139
|
+
mdastExtensions: [vo()]
|
|
4140
|
+
}, Vo = /* @__PURE__ */ new Set([
|
|
4407
4141
|
"A",
|
|
4408
4142
|
"BLOCKQUOTE",
|
|
4409
4143
|
"BR",
|
|
@@ -4426,7 +4160,7 @@ const Po = {
|
|
|
4426
4160
|
"U",
|
|
4427
4161
|
"UL"
|
|
4428
4162
|
]);
|
|
4429
|
-
function
|
|
4163
|
+
function qo(e) {
|
|
4430
4164
|
const t = e.trim();
|
|
4431
4165
|
if (/^(?:#|\/|\.\/|\.\.\/)/.test(t))
|
|
4432
4166
|
return !0;
|
|
@@ -4440,12 +4174,12 @@ function No(e) {
|
|
|
4440
4174
|
function tn(e) {
|
|
4441
4175
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
4442
4176
|
for (const n of [...t.body.querySelectorAll("*")]) {
|
|
4443
|
-
if (!
|
|
4177
|
+
if (!Vo.has(n.tagName)) {
|
|
4444
4178
|
n.replaceWith(t.createTextNode(n.textContent ?? ""));
|
|
4445
4179
|
continue;
|
|
4446
4180
|
}
|
|
4447
4181
|
for (const r of [...n.attributes])
|
|
4448
|
-
n.tagName === "A" && r.name === "href" &&
|
|
4182
|
+
n.tagName === "A" && r.name === "href" && qo(r.value) || n.tagName === "A" && r.name === "title" || n.tagName === "PRE" && r.name === "data-lang" || n.removeAttribute(r.name);
|
|
4449
4183
|
}
|
|
4450
4184
|
return t.body.innerHTML;
|
|
4451
4185
|
}
|
|
@@ -4477,7 +4211,7 @@ Pe.addRule("codeBlockWithLang", {
|
|
|
4477
4211
|
` + (r?.textContent ?? "") + "\n```\n\n";
|
|
4478
4212
|
}
|
|
4479
4213
|
});
|
|
4480
|
-
const
|
|
4214
|
+
const Uo = {
|
|
4481
4215
|
// className applied per depth in _setupSourcePlugin, not here
|
|
4482
4216
|
heading: { bold: !0 },
|
|
4483
4217
|
emphasis: { italic: !0 },
|
|
@@ -4490,9 +4224,22 @@ const $o = {
|
|
|
4490
4224
|
// GFM ~~text~~ (AST node.type === 'delete')
|
|
4491
4225
|
delete: { className: "rme-strikethrough" }
|
|
4492
4226
|
// list and html (underline) nodes are handled dynamically in _setupSourcePlugin
|
|
4493
|
-
},
|
|
4227
|
+
}, Wo = Object.freeze({
|
|
4228
|
+
source: "Markdown source",
|
|
4229
|
+
linkPopover: "Link",
|
|
4230
|
+
url: "URL",
|
|
4231
|
+
applyLink: "Apply",
|
|
4232
|
+
openLink: "Open link",
|
|
4233
|
+
removeLink: "Remove link",
|
|
4234
|
+
shortcut: (e, t) => `${e} (${t})`
|
|
4235
|
+
}), zt = class zt extends nn {
|
|
4494
4236
|
constructor() {
|
|
4495
|
-
super(...arguments), this.
|
|
4237
|
+
super(...arguments), this._messages = new rn(
|
|
4238
|
+
this,
|
|
4239
|
+
"rc-markdown-editor",
|
|
4240
|
+
Wo,
|
|
4241
|
+
{ overrides: () => this.messages }
|
|
4242
|
+
), this._defaultValue = "", this._valueInitialized = !1, this._defaultSourceMode = !1, this._sourceModeInitialized = !1, this.toolbar = !0, this.readOnly = !1, this._observer = null, this._$savedRange = null, this._activeFormats = {}, this._syncTimer = null, this._pluginApi = null, this._ignoreRichMutations = !1, this._richViewRendered = !1, this._cachedTree = null, this._renderedMode = null, this._firstUpdatedDone = !1, this._linkPopoverOpen = !1, this._linkPopoverHref = "", this._onSourceChange = (t) => {
|
|
4496
4243
|
if (!this.sourceMode)
|
|
4497
4244
|
return;
|
|
4498
4245
|
const n = this._$sourceEditor?.value ?? "";
|
|
@@ -4652,13 +4399,15 @@ const $o = {
|
|
|
4652
4399
|
t.has("value") && !this.sourceMode && this._richViewRendered && this._setRichViewContent(this.value), t.has("_linkPopoverOpen") && this._linkPopoverOpen && (this._positionLinkPopover(), this._$linkPopoverInput?.focus(), this._$linkPopoverInput?.select());
|
|
4653
4400
|
}
|
|
4654
4401
|
render() {
|
|
4402
|
+
const t = this._messages.value;
|
|
4655
4403
|
return Me`
|
|
4656
4404
|
<slot></slot>
|
|
4657
4405
|
|
|
4658
4406
|
${this.toolbar ? Me`<rc-editor-toolbar
|
|
4659
4407
|
part="toolbar"
|
|
4408
|
+
lang=${this.getAttribute("lang") ?? $e}
|
|
4660
4409
|
@rc-toolbar-action=${this._onToolbarAction}
|
|
4661
|
-
></rc-editor-toolbar>` :
|
|
4410
|
+
></rc-editor-toolbar>` : $e}
|
|
4662
4411
|
|
|
4663
4412
|
<div
|
|
4664
4413
|
id="rich-view"
|
|
@@ -4671,31 +4420,29 @@ const $o = {
|
|
|
4671
4420
|
></div>
|
|
4672
4421
|
|
|
4673
4422
|
<div id="source-wrapper" ?hidden=${!this.sourceMode}>
|
|
4674
|
-
<rc-textarea
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
?read-only=${this.readOnly}
|
|
4678
|
-
@rc-change=${this._onSourceChange}
|
|
4679
|
-
></rc-textarea>
|
|
4423
|
+
<rc-textarea id="source-editor" word-wrap @rc-change=${this._onSourceChange}>
|
|
4424
|
+
<textarea aria-label=${t.source} ?readonly=${this.readOnly}></textarea>
|
|
4425
|
+
</rc-textarea>
|
|
4680
4426
|
</div>
|
|
4681
4427
|
|
|
4682
4428
|
${this._linkPopoverOpen ? Me`
|
|
4683
|
-
<div class="link-popover" role="dialog" aria-label
|
|
4429
|
+
<div class="link-popover" role="dialog" aria-label=${t.linkPopover}>
|
|
4684
4430
|
<input
|
|
4685
4431
|
type="url"
|
|
4686
4432
|
class="link-popover-input"
|
|
4687
4433
|
.value=${this._linkPopoverHref}
|
|
4688
4434
|
placeholder="https://"
|
|
4689
|
-
aria-label
|
|
4690
|
-
@input=${(
|
|
4691
|
-
this._linkPopoverHref =
|
|
4435
|
+
aria-label=${t.url}
|
|
4436
|
+
@input=${(n) => {
|
|
4437
|
+
this._linkPopoverHref = n.target.value;
|
|
4692
4438
|
}}
|
|
4693
4439
|
@keydown=${this._onLinkPopoverKeyDown}
|
|
4694
4440
|
/>
|
|
4695
4441
|
<button
|
|
4696
4442
|
type="button"
|
|
4697
4443
|
class="link-popover-btn"
|
|
4698
|
-
|
|
4444
|
+
aria-label=${t.applyLink}
|
|
4445
|
+
title=${t.shortcut(t.applyLink, "Enter")}
|
|
4699
4446
|
@click=${this._applyLink}
|
|
4700
4447
|
>
|
|
4701
4448
|
↵
|
|
@@ -4703,7 +4450,8 @@ const $o = {
|
|
|
4703
4450
|
<button
|
|
4704
4451
|
type="button"
|
|
4705
4452
|
class="link-popover-btn"
|
|
4706
|
-
|
|
4453
|
+
aria-label=${t.openLink}
|
|
4454
|
+
title=${t.openLink}
|
|
4707
4455
|
?disabled=${!this._linkPopoverHref}
|
|
4708
4456
|
@click=${this._openLinkHref}
|
|
4709
4457
|
>
|
|
@@ -4712,20 +4460,21 @@ const $o = {
|
|
|
4712
4460
|
<button
|
|
4713
4461
|
type="button"
|
|
4714
4462
|
class="link-popover-btn"
|
|
4715
|
-
|
|
4463
|
+
aria-label=${t.removeLink}
|
|
4464
|
+
title=${t.removeLink}
|
|
4716
4465
|
@click=${this._removeLink}
|
|
4717
4466
|
>
|
|
4718
4467
|
✕
|
|
4719
4468
|
</button>
|
|
4720
4469
|
</div>
|
|
4721
|
-
` :
|
|
4470
|
+
` : $e}
|
|
4722
4471
|
`;
|
|
4723
4472
|
}
|
|
4724
4473
|
_setRichViewContent(t) {
|
|
4725
4474
|
this._$richView && (this._ignoreRichMutations = !0, this._$richView.innerHTML = this._renderMarkdown(t), this._ignoreRichMutations = !1, this._richViewRendered = !0);
|
|
4726
4475
|
}
|
|
4727
4476
|
_renderMarkdown(t) {
|
|
4728
|
-
const n =
|
|
4477
|
+
const n = Wi(t, Ho), r = Xt(t, en), o = [];
|
|
4729
4478
|
if (mt(r, "code", (l) => {
|
|
4730
4479
|
o.push(l.lang ?? null);
|
|
4731
4480
|
}), o.length === 0)
|
|
@@ -4765,10 +4514,10 @@ const $o = {
|
|
|
4765
4514
|
_setupSourcePlugin() {
|
|
4766
4515
|
this._$sourceEditor.usePlugin({
|
|
4767
4516
|
mount: (t) => {
|
|
4768
|
-
this._pluginApi = t, t.adoptStyleSheet(
|
|
4517
|
+
this._pluginApi = t, t.adoptStyleSheet(Fn), t.onCursorMove((n, r) => {
|
|
4769
4518
|
if (!this.sourceMode)
|
|
4770
4519
|
return;
|
|
4771
|
-
const o =
|
|
4520
|
+
const o = Oo(t.getDecorations(), n, r), i = o.codeBlock && this._cachedTree ? this._getCodeBlockLanguage(this._cachedTree, n) : null;
|
|
4772
4521
|
this._activeFormats = { ...o, codeLanguage: i }, this._pushToolbarState();
|
|
4773
4522
|
});
|
|
4774
4523
|
},
|
|
@@ -4792,7 +4541,7 @@ const $o = {
|
|
|
4792
4541
|
});
|
|
4793
4542
|
return;
|
|
4794
4543
|
}
|
|
4795
|
-
const s =
|
|
4544
|
+
const s = Uo[i.type];
|
|
4796
4545
|
if (!s)
|
|
4797
4546
|
return;
|
|
4798
4547
|
const u = { type: "mark", from: a, to: l, ...s };
|
|
@@ -4926,7 +4675,7 @@ const $o = {
|
|
|
4926
4675
|
if (!n || !r)
|
|
4927
4676
|
return;
|
|
4928
4677
|
const { value: o, selectionStart: i } = n, a = o.lastIndexOf(`
|
|
4929
|
-
`, i - 1) + 1, l = o.slice(a).replace(/^#{1,6} /, ""), s = t ? "#".repeat(
|
|
4678
|
+
`, i - 1) + 1, l = o.slice(a).replace(/^#{1,6} /, ""), s = t ? "#".repeat(Number(t.slice(1))) + " " : "";
|
|
4930
4679
|
r.value = o.slice(0, a) + s + l + o.slice(a + (o.slice(a).length - l.length));
|
|
4931
4680
|
}
|
|
4932
4681
|
/** Updates the language of the code block at the cursor in source mode. */
|
|
@@ -4934,7 +4683,7 @@ const $o = {
|
|
|
4934
4683
|
const n = this._pluginApi, r = this._$sourceEditor;
|
|
4935
4684
|
if (!n || !r)
|
|
4936
4685
|
return;
|
|
4937
|
-
const o =
|
|
4686
|
+
const o = Po(n.value, n.selectionStart, t);
|
|
4938
4687
|
o !== null && (r.value = o);
|
|
4939
4688
|
}
|
|
4940
4689
|
/** Updates the `data-lang` attribute on the `<pre>` at the cursor in rich mode. */
|
|
@@ -4963,16 +4712,16 @@ const $o = {
|
|
|
4963
4712
|
`, o - 1) + 1, s = r.indexOf(`
|
|
4964
4713
|
`, i), u = s === -1 ? r.length : s, f = r.lastIndexOf(`
|
|
4965
4714
|
`, l - 2), p = f === -1 ? "" : r.slice(f + 1, l - 1), g = u + 1, c = r.indexOf(`
|
|
4966
|
-
`, g),
|
|
4967
|
-
if (p.trim() === a &&
|
|
4968
|
-
const A = f === -1 ? 0 : f + 1,
|
|
4969
|
-
n.value = r.slice(0, A) +
|
|
4970
|
-
` + r.slice(
|
|
4715
|
+
`, g), x = r.slice(g, c === -1 ? void 0 : c);
|
|
4716
|
+
if (p.trim() === a && x.trim() === a) {
|
|
4717
|
+
const A = f === -1 ? 0 : f + 1, b = c === -1 ? r.length : c + 1, S = r.slice(l, u);
|
|
4718
|
+
n.value = r.slice(0, A) + S + `
|
|
4719
|
+
` + r.slice(b);
|
|
4971
4720
|
return;
|
|
4972
4721
|
}
|
|
4973
|
-
const
|
|
4722
|
+
const v = r.slice(l, u);
|
|
4974
4723
|
n.value = r.slice(0, l) + a + `
|
|
4975
|
-
` +
|
|
4724
|
+
` + v + `
|
|
4976
4725
|
` + a + r.slice(u);
|
|
4977
4726
|
}
|
|
4978
4727
|
_wrapRichSelection(t) {
|
|
@@ -5047,8 +4796,8 @@ const $o = {
|
|
|
5047
4796
|
_positionLinkPopover() {
|
|
5048
4797
|
if (!this._$savedRange || !this._$linkPopover)
|
|
5049
4798
|
return;
|
|
5050
|
-
const t = this._$savedRange.getBoundingClientRect(), n = this.getBoundingClientRect();
|
|
5051
|
-
this._$linkPopover.style.top = `${t.bottom - n.top + 4}px`, this._$linkPopover.style.left = `${Math.max(0,
|
|
4799
|
+
const t = this._$savedRange.getBoundingClientRect(), n = this.getBoundingClientRect(), r = Vn(this._$linkPopover), i = qn("x", Un(this)) ? t.right - n.left - this._$linkPopover.offsetWidth * r : t.left - n.left;
|
|
4800
|
+
this._$linkPopover.style.top = `${(t.bottom - n.top) / r + 4}px`, this._$linkPopover.style.left = `${Math.max(0, i / r)}px`;
|
|
5052
4801
|
}
|
|
5053
4802
|
_dispatchChange(t) {
|
|
5054
4803
|
this.dispatchEvent(
|
|
@@ -5069,47 +4818,50 @@ const $o = {
|
|
|
5069
4818
|
);
|
|
5070
4819
|
}
|
|
5071
4820
|
};
|
|
5072
|
-
|
|
5073
|
-
let
|
|
5074
|
-
|
|
4821
|
+
zt.styles = $o;
|
|
4822
|
+
let G = zt;
|
|
4823
|
+
re([
|
|
4824
|
+
U({ attribute: !1 })
|
|
4825
|
+
], G.prototype, "messages", 2);
|
|
4826
|
+
re([
|
|
5075
4827
|
U({ type: String, attribute: "default-value" })
|
|
5076
|
-
],
|
|
5077
|
-
|
|
4828
|
+
], G.prototype, "defaultValue", 1);
|
|
4829
|
+
re([
|
|
5078
4830
|
U({ type: String })
|
|
5079
|
-
],
|
|
5080
|
-
|
|
4831
|
+
], G.prototype, "value", 1);
|
|
4832
|
+
re([
|
|
5081
4833
|
U({ type: Boolean, attribute: "default-source-mode" })
|
|
5082
|
-
],
|
|
5083
|
-
|
|
4834
|
+
], G.prototype, "defaultSourceMode", 1);
|
|
4835
|
+
re([
|
|
5084
4836
|
U({ type: Boolean, reflect: !0, attribute: "source-mode" })
|
|
5085
|
-
],
|
|
5086
|
-
|
|
4837
|
+
], G.prototype, "sourceMode", 1);
|
|
4838
|
+
re([
|
|
5087
4839
|
U({ type: Boolean, reflect: !0 })
|
|
5088
|
-
],
|
|
5089
|
-
|
|
4840
|
+
], G.prototype, "toolbar", 2);
|
|
4841
|
+
re([
|
|
5090
4842
|
U({ type: Boolean, reflect: !0, attribute: "read-only" })
|
|
5091
|
-
],
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
],
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
],
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
],
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
],
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
],
|
|
5107
|
-
|
|
4843
|
+
], G.prototype, "readOnly", 2);
|
|
4844
|
+
re([
|
|
4845
|
+
De("#rich-view")
|
|
4846
|
+
], G.prototype, "_$richView", 2);
|
|
4847
|
+
re([
|
|
4848
|
+
De("#source-editor")
|
|
4849
|
+
], G.prototype, "_$sourceEditor", 2);
|
|
4850
|
+
re([
|
|
4851
|
+
De("rc-editor-toolbar")
|
|
4852
|
+
], G.prototype, "_$toolbar", 2);
|
|
4853
|
+
re([
|
|
4854
|
+
De(".link-popover")
|
|
4855
|
+
], G.prototype, "_$linkPopover", 2);
|
|
4856
|
+
re([
|
|
4857
|
+
De(".link-popover-input")
|
|
4858
|
+
], G.prototype, "_$linkPopoverInput", 2);
|
|
4859
|
+
re([
|
|
5108
4860
|
_t()
|
|
5109
|
-
],
|
|
5110
|
-
|
|
4861
|
+
], G.prototype, "_linkPopoverOpen", 2);
|
|
4862
|
+
re([
|
|
5111
4863
|
_t()
|
|
5112
|
-
],
|
|
4864
|
+
], G.prototype, "_linkPopoverHref", 2);
|
|
5113
4865
|
const me = (e) => he`
|
|
5114
4866
|
<svg
|
|
5115
4867
|
viewBox="0 0 16 16"
|
|
@@ -5164,27 +4916,45 @@ const me = (e) => he`
|
|
|
5164
4916
|
</g>
|
|
5165
4917
|
`)
|
|
5166
4918
|
};
|
|
5167
|
-
var
|
|
4919
|
+
var jo = Object.defineProperty, J = (e, t, n, r) => {
|
|
5168
4920
|
for (var o = void 0, i = e.length - 1, a; i >= 0; i--)
|
|
5169
4921
|
(a = e[i]) && (o = a(t, n, o) || o);
|
|
5170
|
-
return o &&
|
|
4922
|
+
return o && jo(t, n, o), o;
|
|
5171
4923
|
};
|
|
5172
|
-
const
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
4924
|
+
const Qo = ["h1", "h2", "h3", "h4", "h5", "h6"], Ko = Object.freeze({
|
|
4925
|
+
toolbar: "Formatting",
|
|
4926
|
+
bold: "Bold",
|
|
4927
|
+
italic: "Italic",
|
|
4928
|
+
underline: "Underline",
|
|
4929
|
+
strikethrough: "Strikethrough",
|
|
4930
|
+
inlineCode: "Inline Code",
|
|
4931
|
+
link: "Link",
|
|
4932
|
+
headingLevel: "Heading level",
|
|
4933
|
+
paragraph: "Paragraph",
|
|
4934
|
+
heading: (e, t) => `Heading ${Wn(t, { useGrouping: !1 }).format(e)}`,
|
|
4935
|
+
blockquote: "Blockquote",
|
|
4936
|
+
bulletList: "Bullet List",
|
|
4937
|
+
orderedList: "Ordered List",
|
|
4938
|
+
codeBlock: "Code Block",
|
|
4939
|
+
codeBlockLanguage: "Code block language",
|
|
4940
|
+
languagePlaceholder: "Language",
|
|
4941
|
+
languageHint: "Syntax language (e.g. TypeScript, Rust)",
|
|
4942
|
+
sourceMode: "Source Mode",
|
|
4943
|
+
sourceModeHint: "Toggle Markdown Source",
|
|
4944
|
+
shortcut: (e, t) => `${e} (${t})`
|
|
4945
|
+
});
|
|
5181
4946
|
class ee extends nn {
|
|
5182
4947
|
constructor() {
|
|
5183
|
-
super(...arguments), this.
|
|
4948
|
+
super(...arguments), this._messages = new rn(
|
|
4949
|
+
this,
|
|
4950
|
+
"rc-editor-toolbar",
|
|
4951
|
+
Ko,
|
|
4952
|
+
{ overrides: () => this.messages }
|
|
4953
|
+
), this.activeBold = !1, this.activeItalic = !1, this.activeUnderline = !1, this.activeStrikethrough = !1, this.activeCode = !1, this.activeLink = !1, this.activeHeading = null, this.activeBlockquote = !1, this.activeBulletList = !1, this.activeOrderedList = !1, this.activeCodeBlock = !1, this.codeLanguage = null, this.sourceMode = !1, this._langInputValue = "", this._onClick = (t) => {
|
|
5184
4954
|
const n = t.target.closest("button[data-action]");
|
|
5185
4955
|
n && this._dispatch(n.dataset.action);
|
|
5186
4956
|
}, this._onHeadingChange = (t) => {
|
|
5187
|
-
const n = t.
|
|
4957
|
+
const n = t.target.value;
|
|
5188
4958
|
this._dispatch("heading", { headingLevel: n === "p" ? null : n });
|
|
5189
4959
|
}, this._onLangInput = (t) => {
|
|
5190
4960
|
this._langInputValue = t.target.value;
|
|
@@ -5211,7 +4981,7 @@ class ee extends nn {
|
|
|
5211
4981
|
}
|
|
5212
4982
|
_renderActionButton(t, n, r, o, i) {
|
|
5213
4983
|
return Me`
|
|
5214
|
-
<rc-button icon-only class=${o ? "toolbar-active" :
|
|
4984
|
+
<rc-button icon-only class=${o ? "toolbar-active" : $e}>
|
|
5215
4985
|
<button
|
|
5216
4986
|
type="button"
|
|
5217
4987
|
data-action=${t}
|
|
@@ -5225,78 +4995,98 @@ class ee extends nn {
|
|
|
5225
4995
|
`;
|
|
5226
4996
|
}
|
|
5227
4997
|
render() {
|
|
4998
|
+
const t = this._messages.value, n = [
|
|
4999
|
+
{ value: "p", label: t.paragraph },
|
|
5000
|
+
...Qo.map((r, o) => ({
|
|
5001
|
+
value: r,
|
|
5002
|
+
label: t.heading(o + 1, this._messages.locale)
|
|
5003
|
+
}))
|
|
5004
|
+
];
|
|
5228
5005
|
return Me`
|
|
5229
|
-
<rc-toolbar label=${
|
|
5230
|
-
${this._renderActionButton(
|
|
5006
|
+
<rc-toolbar label=${t.toolbar} @click=${this._onClick}>
|
|
5007
|
+
${this._renderActionButton(
|
|
5008
|
+
"bold",
|
|
5009
|
+
t.bold,
|
|
5010
|
+
t.shortcut(t.bold, "Ctrl+B"),
|
|
5011
|
+
this.activeBold,
|
|
5012
|
+
ke.bold
|
|
5013
|
+
)}
|
|
5231
5014
|
${this._renderActionButton(
|
|
5232
5015
|
"italic",
|
|
5233
|
-
|
|
5234
|
-
"
|
|
5016
|
+
t.italic,
|
|
5017
|
+
t.shortcut(t.italic, "Ctrl+I"),
|
|
5235
5018
|
this.activeItalic,
|
|
5236
5019
|
ke.italic
|
|
5237
5020
|
)}
|
|
5238
5021
|
${this._renderActionButton(
|
|
5239
5022
|
"underline",
|
|
5240
|
-
|
|
5241
|
-
"
|
|
5023
|
+
t.underline,
|
|
5024
|
+
t.shortcut(t.underline, "Ctrl+U"),
|
|
5242
5025
|
this.activeUnderline,
|
|
5243
5026
|
ke.underline
|
|
5244
5027
|
)}
|
|
5245
5028
|
${this._renderActionButton(
|
|
5246
5029
|
"strikethrough",
|
|
5247
|
-
|
|
5248
|
-
|
|
5030
|
+
t.strikethrough,
|
|
5031
|
+
t.strikethrough,
|
|
5249
5032
|
this.activeStrikethrough,
|
|
5250
5033
|
ke.strikethrough
|
|
5251
5034
|
)}
|
|
5252
5035
|
${this._renderActionButton(
|
|
5253
5036
|
"code",
|
|
5254
|
-
|
|
5255
|
-
"
|
|
5037
|
+
t.inlineCode,
|
|
5038
|
+
t.shortcut(t.inlineCode, "Ctrl+`"),
|
|
5256
5039
|
this.activeCode,
|
|
5257
5040
|
ke.code
|
|
5258
5041
|
)}
|
|
5259
|
-
${this._renderActionButton(
|
|
5042
|
+
${this._renderActionButton(
|
|
5043
|
+
"link",
|
|
5044
|
+
t.link,
|
|
5045
|
+
t.shortcut(t.link, "Ctrl+K"),
|
|
5046
|
+
this.activeLink,
|
|
5047
|
+
ke.link
|
|
5048
|
+
)}
|
|
5260
5049
|
|
|
5261
|
-
<
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
@rc-select-change=${this._onHeadingChange}
|
|
5050
|
+
<select
|
|
5051
|
+
class=${this.activeHeading ? "heading-select toolbar-active" : "heading-select"}
|
|
5052
|
+
title=${t.headingLevel}
|
|
5053
|
+
aria-label=${t.headingLevel}
|
|
5054
|
+
@change=${this._onHeadingChange}
|
|
5267
5055
|
>
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5056
|
+
${n.map(
|
|
5057
|
+
({ value: r, label: o }) => Me`
|
|
5058
|
+
<option value=${r} .selected=${r === (this.activeHeading ?? "p")}>
|
|
5059
|
+
${o}
|
|
5060
|
+
</option>
|
|
5061
|
+
`
|
|
5271
5062
|
)}
|
|
5272
|
-
|
|
5273
|
-
</rc-select>
|
|
5063
|
+
</select>
|
|
5274
5064
|
|
|
5275
5065
|
${this._renderActionButton(
|
|
5276
5066
|
"blockquote",
|
|
5277
|
-
|
|
5278
|
-
|
|
5067
|
+
t.blockquote,
|
|
5068
|
+
t.blockquote,
|
|
5279
5069
|
this.activeBlockquote,
|
|
5280
5070
|
ke.blockquote
|
|
5281
5071
|
)}
|
|
5282
5072
|
${this._renderActionButton(
|
|
5283
5073
|
"bullet-list",
|
|
5284
|
-
|
|
5285
|
-
|
|
5074
|
+
t.bulletList,
|
|
5075
|
+
t.bulletList,
|
|
5286
5076
|
this.activeBulletList,
|
|
5287
5077
|
ke.bulletList
|
|
5288
5078
|
)}
|
|
5289
5079
|
${this._renderActionButton(
|
|
5290
5080
|
"ordered-list",
|
|
5291
|
-
|
|
5292
|
-
|
|
5081
|
+
t.orderedList,
|
|
5082
|
+
t.orderedList,
|
|
5293
5083
|
this.activeOrderedList,
|
|
5294
5084
|
ke.orderedList
|
|
5295
5085
|
)}
|
|
5296
5086
|
${this._renderActionButton(
|
|
5297
5087
|
"code-block",
|
|
5298
|
-
|
|
5299
|
-
|
|
5088
|
+
t.codeBlock,
|
|
5089
|
+
t.codeBlock,
|
|
5300
5090
|
this.activeCodeBlock,
|
|
5301
5091
|
ke.codeBlock
|
|
5302
5092
|
)}
|
|
@@ -5304,20 +5094,20 @@ class ee extends nn {
|
|
|
5304
5094
|
<input
|
|
5305
5095
|
type="text"
|
|
5306
5096
|
class="lang-input"
|
|
5307
|
-
aria-label
|
|
5308
|
-
placeholder
|
|
5309
|
-
title
|
|
5097
|
+
aria-label=${t.codeBlockLanguage}
|
|
5098
|
+
placeholder=${t.languagePlaceholder}
|
|
5099
|
+
title=${t.languageHint}
|
|
5310
5100
|
.value=${this._langInputValue}
|
|
5311
5101
|
@input=${this._onLangInput}
|
|
5312
5102
|
@blur=${this._onLangCommit}
|
|
5313
5103
|
@keydown=${this._onLangKeyDown}
|
|
5314
|
-
@click=${(
|
|
5104
|
+
@click=${(r) => r.stopPropagation()}
|
|
5315
5105
|
/>
|
|
5316
|
-
` :
|
|
5106
|
+
` : $e}
|
|
5317
5107
|
${this._renderActionButton(
|
|
5318
5108
|
"source",
|
|
5319
|
-
|
|
5320
|
-
"
|
|
5109
|
+
t.sourceMode,
|
|
5110
|
+
t.shortcut(t.sourceModeHint, "Ctrl+Shift+S"),
|
|
5321
5111
|
this.sourceMode,
|
|
5322
5112
|
ke.source
|
|
5323
5113
|
)}
|
|
@@ -5326,8 +5116,8 @@ class ee extends nn {
|
|
|
5326
5116
|
}
|
|
5327
5117
|
}
|
|
5328
5118
|
J([
|
|
5329
|
-
U({
|
|
5330
|
-
], ee.prototype, "
|
|
5119
|
+
U({ attribute: !1 })
|
|
5120
|
+
], ee.prototype, "messages");
|
|
5331
5121
|
J([
|
|
5332
5122
|
U({ type: Boolean, reflect: !0, attribute: "active-bold" })
|
|
5333
5123
|
], ee.prototype, "activeBold");
|
|
@@ -5372,6 +5162,6 @@ J([
|
|
|
5372
5162
|
], ee.prototype, "_langInputValue");
|
|
5373
5163
|
export {
|
|
5374
5164
|
ee as R,
|
|
5375
|
-
|
|
5165
|
+
G as a
|
|
5376
5166
|
};
|
|
5377
|
-
//# sourceMappingURL=rc-editor-toolbar-
|
|
5167
|
+
//# sourceMappingURL=rc-editor-toolbar-DZHqoNun.js.map
|