@pi-outpost/embed 0.62.3 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeEditor-C2mtBAxz.js → CodeEditor-BW8cShfE.js} +870 -869
- package/dist/CodeEditor-BZfOQyjO.cjs +9 -0
- package/dist/{conversationExport-jRLUX0kH.js → conversationExport-BHXWfKKh.js} +37 -37
- package/dist/{conversationExport-DXxmgLoF.cjs → conversationExport-CWUOyeJO.cjs} +2 -2
- package/dist/{conversationHistory-C6PqGsO9.cjs → conversationHistory-0ds9dEO5.cjs} +26 -4
- package/dist/{conversationHistory-3pDBlkZZ.js → conversationHistory-xEFHYA2a.js} +94 -61
- package/dist/{dist-B9wvGgxB.js → dist-B-n0qSdY.js} +134 -133
- package/dist/{dist-LBUs7dVk.js → dist-B53CIh_q.js} +62 -61
- package/dist/{dist-DeLxY4Ia.js → dist-BBPYf4ef.js} +30 -29
- package/dist/dist-BFbWWJdM.cjs +23 -0
- package/dist/dist-BLE5-Y8p.cjs +9 -0
- package/dist/dist-BQCPWecG.cjs +1 -0
- package/dist/dist-BmjjdWVL.cjs +1 -0
- package/dist/{dist-kpPXlS4A.cjs → dist-Bo7aGd2O.cjs} +2 -2
- package/dist/{dist-Bk3hLKgL.js → dist-BoHwBqKn.js} +49 -49
- package/dist/{dist-VWDOErn8.js → dist-BpRy8-Lq.js} +47 -47
- package/dist/dist-BzV3uXd3.js +2842 -0
- package/dist/dist-C3wOZTh_.cjs +1 -0
- package/dist/dist-C6485_TJ.cjs +1 -0
- package/dist/{dist-BIMxMB--.js → dist-CEPaeNz_.js} +57 -57
- package/dist/dist-CbNZ-oK_.cjs +11 -0
- package/dist/dist-CewGgiCl.cjs +1 -0
- package/dist/dist-Cgkuh5Wk.cjs +11 -0
- package/dist/dist-ChIJFFop.cjs +3 -0
- package/dist/dist-Cqy-WSUm.cjs +6 -0
- package/dist/{dist-Bg1-NGne.js → dist-D1XDfvdG.js} +17 -17
- package/dist/{dist-qeX2QqDc.js → dist-DAh__jUg.js} +6724 -9561
- package/dist/dist-DV7vb3Vn.cjs +1 -0
- package/dist/dist-DWOMmaS_.cjs +1 -0
- package/dist/{dist-BWAsFrsx.js → dist-DcevhA0K.js} +73 -73
- package/dist/dist-DdI6ugoG.cjs +1 -0
- package/dist/{dist-CpOA8cNn.js → dist-DhtR0qbm.js} +49 -49
- package/dist/{dist-CwPu13CG.js → dist-DlwWvZ4d.js} +46 -46
- package/dist/{dist-nQ2aeIgK.js → dist-DnmbmV7C.js} +495 -494
- package/dist/dist-DsOiUWHL.cjs +1 -0
- package/dist/dist-DuyBYmw-.cjs +1 -0
- package/dist/{dist-DUziszL2.js → dist-T7rNKseu.js} +32 -32
- package/dist/{dist-CcTOENSK.js → dist-XKeyr4Om.js} +26 -26
- package/dist/{dist-CvxwObne.js → dist-n29rG6c2.js} +117 -117
- package/dist/{dist-DCT8mdeU.js → dist-s8hmOD0A.js} +52 -52
- package/dist/pi-outpost-embed.cjs +46 -44
- package/dist/pi-outpost-embed.js +5022 -4147
- package/package.json +1 -1
- package/dist/CodeEditor-CHKp59kP.cjs +0 -9
- package/dist/dist-B9TXDASo.cjs +0 -1
- package/dist/dist-BMzIUMhf.cjs +0 -1
- package/dist/dist-BawiB8yE.cjs +0 -23
- package/dist/dist-BjxwUutQ.cjs +0 -6
- package/dist/dist-BlUoR-U1.cjs +0 -13
- package/dist/dist-Bnsp4Y3i.cjs +0 -9
- package/dist/dist-CM2l_BHt.cjs +0 -1
- package/dist/dist-CkDnvyBs.cjs +0 -1
- package/dist/dist-CpsCEkIr.cjs +0 -1
- package/dist/dist-DJYmQsI-.cjs +0 -1
- package/dist/dist-F6qtkv2Q.cjs +0 -11
- package/dist/dist-Lxxq5IH0.cjs +0 -1
- package/dist/dist-c-DRw6Dh.cjs +0 -1
- package/dist/dist-sM-IE5EO.cjs +0 -1
- package/dist/dist-vBlUeRrZ.cjs +0 -1
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { A as e, D as t, E as n, V as r, h as i, r as a } from "./dist-DAh__jUg.js";
|
|
2
|
+
import { A as o, B as s, H as c, I as l, L as u, M as d, N as f, R as p, T as m, V as h, _ as g, a as ee, d as te, i as ne, k as _, o as re, r as ie, v as ae, w as oe, x as se } from "./dist-BzV3uXd3.js";
|
|
3
|
+
import { html as ce, htmlCompletionSource as le } from "./dist-B53CIh_q.js";
|
|
4
|
+
import { n as ue } from "./CodeEditor-BW8cShfE.js";
|
|
4
5
|
//#region ../node_modules/@lezer/markdown/dist/index.js
|
|
5
|
-
var
|
|
6
|
-
static create(
|
|
7
|
-
let o = i + (i << 8) +
|
|
8
|
-
return new t
|
|
6
|
+
var de = class e {
|
|
7
|
+
static create(t, n, r, i, a) {
|
|
8
|
+
let o = i + (i << 8) + t + (n << 4) | 0;
|
|
9
|
+
return new e(t, n, r, o, a, [], []);
|
|
9
10
|
}
|
|
10
|
-
constructor(t, n, r, i, a, o
|
|
11
|
-
this.type =
|
|
11
|
+
constructor(e, t, n, r, i, a, o) {
|
|
12
|
+
this.type = e, this.value = t, this.from = n, this.hash = r, this.end = i, this.children = a, this.positions = o, this.hashProp = [[l.contextHash, r]];
|
|
12
13
|
}
|
|
13
|
-
addChild(
|
|
14
|
-
|
|
14
|
+
addChild(e, t) {
|
|
15
|
+
e.prop(l.contextHash) != this.hash && (e = new h(e.type, e.children, e.positions, e.length, this.hashProp)), this.children.push(e), this.positions.push(t);
|
|
15
16
|
}
|
|
16
17
|
toTree(e, t = this.end) {
|
|
17
18
|
let n = this.children.length - 1;
|
|
18
|
-
return n >= 0 && (t = Math.max(t, this.positions[n] + this.children[n].length + this.from)), new
|
|
19
|
+
return n >= 0 && (t = Math.max(t, this.positions[n] + this.children[n].length + this.from)), new h(e.types[this.type], this.children, this.positions, t - this.from).balance({ makeTree: (e, t, n) => new h(p.none, e, t, n, this.hashProp) });
|
|
19
20
|
}
|
|
20
|
-
},
|
|
21
|
+
}, v;
|
|
21
22
|
(function(e) {
|
|
22
23
|
e[e.Document = 1] = "Document", e[e.CodeBlock = 2] = "CodeBlock", e[e.FencedCode = 3] = "FencedCode", e[e.Blockquote = 4] = "Blockquote", e[e.HorizontalRule = 5] = "HorizontalRule", e[e.BulletList = 6] = "BulletList", e[e.OrderedList = 7] = "OrderedList", e[e.ListItem = 8] = "ListItem", e[e.ATXHeading1 = 9] = "ATXHeading1", e[e.ATXHeading2 = 10] = "ATXHeading2", e[e.ATXHeading3 = 11] = "ATXHeading3", e[e.ATXHeading4 = 12] = "ATXHeading4", e[e.ATXHeading5 = 13] = "ATXHeading5", e[e.ATXHeading6 = 14] = "ATXHeading6", e[e.SetextHeading1 = 15] = "SetextHeading1", e[e.SetextHeading2 = 16] = "SetextHeading2", e[e.HTMLBlock = 17] = "HTMLBlock", e[e.LinkReference = 18] = "LinkReference", e[e.Paragraph = 19] = "Paragraph", e[e.CommentBlock = 20] = "CommentBlock", e[e.ProcessingInstructionBlock = 21] = "ProcessingInstructionBlock", e[e.Escape = 22] = "Escape", e[e.Entity = 23] = "Entity", e[e.HardBreak = 24] = "HardBreak", e[e.Emphasis = 25] = "Emphasis", e[e.StrongEmphasis = 26] = "StrongEmphasis", e[e.Link = 27] = "Link", e[e.Image = 28] = "Image", e[e.InlineCode = 29] = "InlineCode", e[e.HTMLTag = 30] = "HTMLTag", e[e.Comment = 31] = "Comment", e[e.ProcessingInstruction = 32] = "ProcessingInstruction", e[e.Autolink = 33] = "Autolink", e[e.HeaderMark = 34] = "HeaderMark", e[e.QuoteMark = 35] = "QuoteMark", e[e.ListMark = 36] = "ListMark", e[e.LinkMark = 37] = "LinkMark", e[e.EmphasisMark = 38] = "EmphasisMark", e[e.CodeMark = 39] = "CodeMark", e[e.CodeText = 40] = "CodeText", e[e.CodeInfo = 41] = "CodeInfo", e[e.LinkTitle = 42] = "LinkTitle", e[e.LinkLabel = 43] = "LinkLabel", e[e.URL = 44] = "URL";
|
|
23
|
-
})(
|
|
24
|
-
var
|
|
24
|
+
})(v ||= {});
|
|
25
|
+
var fe = class {
|
|
25
26
|
constructor(e, t) {
|
|
26
27
|
this.start = e, this.content = t, this.marks = [], this.parsers = [];
|
|
27
28
|
}
|
|
28
|
-
},
|
|
29
|
+
}, pe = class {
|
|
29
30
|
constructor() {
|
|
30
31
|
this.text = "", this.baseIndent = 0, this.basePos = 0, this.depth = 0, this.markers = [], this.pos = 0, this.indent = 0, this.next = -1;
|
|
31
32
|
}
|
|
@@ -37,7 +38,7 @@ var pe = class {
|
|
|
37
38
|
this.indent = this.countIndent(e, this.pos, this.indent), this.pos = e, this.next = e == this.text.length ? -1 : this.text.charCodeAt(e);
|
|
38
39
|
}
|
|
39
40
|
skipSpace(e) {
|
|
40
|
-
return
|
|
41
|
+
return b(this.text, e);
|
|
41
42
|
}
|
|
42
43
|
reset(e) {
|
|
43
44
|
for (this.text = e, this.baseIndent = this.basePos = this.pos = this.indent = 0, this.forwardInner(), this.depth = 1; this.markers.length;) this.markers.pop();
|
|
@@ -67,37 +68,37 @@ var pe = class {
|
|
|
67
68
|
return e + this.text.slice(this.basePos);
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
|
-
function
|
|
71
|
+
function me(e, t, n) {
|
|
71
72
|
if (n.pos == n.text.length || e != t.block && n.indent >= t.stack[n.depth + 1].value + n.baseIndent) return !0;
|
|
72
73
|
if (n.indent >= n.baseIndent + 4) return !1;
|
|
73
|
-
let r = (e.type ==
|
|
74
|
-
return r > 0 && (e.type !=
|
|
74
|
+
let r = (e.type == v.OrderedList ? C : S)(n, t, !1);
|
|
75
|
+
return r > 0 && (e.type != v.BulletList || x(n, t, !1) < 0) && n.text.charCodeAt(n.pos + r - 1) == e.value;
|
|
75
76
|
}
|
|
76
|
-
var
|
|
77
|
-
[
|
|
78
|
-
return n.next == 62 && (n.markers.push(
|
|
77
|
+
var he = {
|
|
78
|
+
[v.Blockquote](e, t, n) {
|
|
79
|
+
return n.next == 62 && (n.markers.push(P(v.QuoteMark, t.lineStart + n.pos, t.lineStart + n.pos + 1)), n.moveBase(n.pos + (y(n.text.charCodeAt(n.pos + 1)) ? 2 : 1)), e.end = t.lineStart + n.text.length, !0);
|
|
79
80
|
},
|
|
80
|
-
[
|
|
81
|
+
[v.ListItem](e, t, n) {
|
|
81
82
|
return n.indent < n.baseIndent + e.value && n.next > -1 ? !1 : (n.moveBaseColumn(n.baseIndent + e.value), !0);
|
|
82
83
|
},
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
84
|
+
[v.OrderedList]: me,
|
|
85
|
+
[v.BulletList]: me,
|
|
86
|
+
[v.Document]() {
|
|
86
87
|
return !0;
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
function
|
|
90
|
+
function y(e) {
|
|
90
91
|
return e == 32 || e == 9 || e == 10 || e == 13;
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
for (; t < e.length &&
|
|
93
|
+
function b(e, t = 0) {
|
|
94
|
+
for (; t < e.length && y(e.charCodeAt(t));) t++;
|
|
94
95
|
return t;
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
-
for (; t > n &&
|
|
97
|
+
function ge(e, t, n) {
|
|
98
|
+
for (; t > n && y(e.charCodeAt(t - 1));) t--;
|
|
98
99
|
return t;
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
+
function _e(e) {
|
|
101
102
|
if (e.next != 96 && e.next != 126) return -1;
|
|
102
103
|
let t = e.pos + 1;
|
|
103
104
|
for (; t < e.text.length && e.text.charCodeAt(t) == e.next;) t++;
|
|
@@ -107,35 +108,35 @@ function b(e) {
|
|
|
107
108
|
}
|
|
108
109
|
return t;
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function ve(e) {
|
|
111
112
|
return e.next == 62 ? e.text.charCodeAt(e.pos + 1) == 32 ? 2 : 1 : -1;
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
+
function x(e, t, n) {
|
|
114
115
|
if (e.next != 42 && e.next != 45 && e.next != 95) return -1;
|
|
115
116
|
let r = 1;
|
|
116
117
|
for (let t = e.pos + 1; t < e.text.length; t++) {
|
|
117
118
|
let n = e.text.charCodeAt(t);
|
|
118
119
|
if (n == e.next) r++;
|
|
119
|
-
else if (!
|
|
120
|
+
else if (!y(n)) return -1;
|
|
120
121
|
}
|
|
121
|
-
return n && e.next == 45 &&
|
|
122
|
+
return n && e.next == 45 && xe(e) > -1 && e.depth == t.stack.length && t.parser.leafBlockParsers.indexOf(Oe.SetextHeading) > -1 || r < 3 ? -1 : 1;
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function ye(e, t) {
|
|
124
125
|
for (let n = e.stack.length - 1; n >= 0; n--) if (e.stack[n].type == t) return !0;
|
|
125
126
|
return !1;
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
return (e.next == 45 || e.next == 43 || e.next == 42) && (e.pos == e.text.length - 1 ||
|
|
128
|
+
function S(e, t, n) {
|
|
129
|
+
return (e.next == 45 || e.next == 43 || e.next == 42) && (e.pos == e.text.length - 1 || y(e.text.charCodeAt(e.pos + 1))) && (!n || ye(t, v.BulletList) || e.skipSpace(e.pos + 2) < e.text.length) ? 1 : -1;
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
+
function C(e, t, n) {
|
|
131
132
|
let r = e.pos, i = e.next;
|
|
132
133
|
for (; i >= 48 && i <= 57;) {
|
|
133
134
|
if (r++, r == e.text.length) return -1;
|
|
134
135
|
i = e.text.charCodeAt(r);
|
|
135
136
|
}
|
|
136
|
-
return r == e.pos || r > e.pos + 9 || i != 46 && i != 41 || r < e.text.length - 1 && !
|
|
137
|
+
return r == e.pos || r > e.pos + 9 || i != 46 && i != 41 || r < e.text.length - 1 && !y(e.text.charCodeAt(r + 1)) || n && !ye(t, v.OrderedList) && (e.skipSpace(r + 1) == e.text.length || r > e.pos + 1 || e.next != 49) ? -1 : r + 1 - e.pos;
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
+
function be(e) {
|
|
139
140
|
if (e.next != 35) return -1;
|
|
140
141
|
let t = e.pos + 1;
|
|
141
142
|
for (; t < e.text.length && e.text.charCodeAt(t) == 35;) t++;
|
|
@@ -143,120 +144,120 @@ function ye(e) {
|
|
|
143
144
|
let n = t - e.pos;
|
|
144
145
|
return n > 6 ? -1 : n;
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function xe(e) {
|
|
147
148
|
if (e.next != 45 && e.next != 61 || e.indent >= e.baseIndent + 4) return -1;
|
|
148
149
|
let t = e.pos + 1;
|
|
149
150
|
for (; t < e.text.length && e.text.charCodeAt(t) == e.next;) t++;
|
|
150
151
|
let n = t;
|
|
151
|
-
for (; t < e.text.length &&
|
|
152
|
+
for (; t < e.text.length && y(e.text.charCodeAt(t));) t++;
|
|
152
153
|
return t == e.text.length ? n : -1;
|
|
153
154
|
}
|
|
154
|
-
var
|
|
155
|
+
var w = /^[ \t]*$/, Se = /-->/, Ce = /\?>/, T = [
|
|
155
156
|
[/^<(?:script|pre|style)(?:\s|>|$)/i, /<\/(?:script|pre|style)>/i],
|
|
156
|
-
[/^\s*<!--/,
|
|
157
|
-
[/^\s*<\?/,
|
|
157
|
+
[/^\s*<!--/, Se],
|
|
158
|
+
[/^\s*<\?/, Ce],
|
|
158
159
|
[/^\s*<![A-Z]/, />/],
|
|
159
160
|
[/^\s*<!\[CDATA\[/, /\]\]>/],
|
|
160
|
-
[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,
|
|
161
|
-
[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,
|
|
161
|
+
[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i, w],
|
|
162
|
+
[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i, w]
|
|
162
163
|
];
|
|
163
|
-
function
|
|
164
|
+
function we(e, t, n) {
|
|
164
165
|
if (e.next != 60) return -1;
|
|
165
166
|
let r = e.text.slice(e.pos);
|
|
166
|
-
for (let e = 0, t =
|
|
167
|
+
for (let e = 0, t = T.length - +!!n; e < t; e++) if (T[e][0].test(r)) return e;
|
|
167
168
|
return -1;
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function Te(e, t) {
|
|
170
171
|
let n = e.countIndent(t, e.pos, e.indent), r = e.skipSpace(t), i = e.countIndent(r, t, n);
|
|
171
172
|
return i >= n + 5 || r == e.text.length ? n + 1 : i;
|
|
172
173
|
}
|
|
173
|
-
function
|
|
174
|
+
function E(e, t, n) {
|
|
174
175
|
let r = e.length - 1;
|
|
175
|
-
r >= 0 && e[r].to == t && e[r].type ==
|
|
176
|
+
r >= 0 && e[r].to == t && e[r].type == v.CodeText ? e[r].to = n : e.push(P(v.CodeText, t, n));
|
|
176
177
|
}
|
|
177
|
-
var
|
|
178
|
+
var D = {
|
|
178
179
|
LinkReference: void 0,
|
|
179
180
|
IndentedCode(e, t) {
|
|
180
181
|
let n = t.baseIndent + 4;
|
|
181
182
|
if (t.indent < n) return !1;
|
|
182
183
|
let r = t.findColumn(n), i = e.lineStart + r, a = e.lineStart + t.text.length, o = [], s = [];
|
|
183
|
-
for (
|
|
184
|
-
|
|
184
|
+
for (E(o, i, a); e.nextLine() && t.depth >= e.stack.length;) if (t.pos == t.text.length) {
|
|
185
|
+
E(s, e.lineStart - 1, e.lineStart);
|
|
185
186
|
for (let e of t.markers) s.push(e);
|
|
186
187
|
} else if (t.indent < n) break;
|
|
187
188
|
else {
|
|
188
189
|
if (s.length) {
|
|
189
|
-
for (let e of s) e.type ==
|
|
190
|
+
for (let e of s) e.type == v.CodeText ? E(o, e.from, e.to) : o.push(e);
|
|
190
191
|
s = [];
|
|
191
192
|
}
|
|
192
|
-
|
|
193
|
+
E(o, e.lineStart - 1, e.lineStart);
|
|
193
194
|
for (let e of t.markers) o.push(e);
|
|
194
195
|
a = e.lineStart + t.text.length;
|
|
195
196
|
let n = e.lineStart + t.findColumn(t.baseIndent + 4);
|
|
196
|
-
n < a &&
|
|
197
|
+
n < a && E(o, n, a);
|
|
197
198
|
}
|
|
198
|
-
return s.length && (s = s.filter((e) => e.type !=
|
|
199
|
+
return s.length && (s = s.filter((e) => e.type != v.CodeText), s.length && (t.markers = s.concat(t.markers))), e.addNode(e.buffer.writeElements(o, -i).finish(v.CodeBlock, a - i), i), !0;
|
|
199
200
|
},
|
|
200
201
|
FencedCode(e, t) {
|
|
201
|
-
let n =
|
|
202
|
+
let n = _e(t);
|
|
202
203
|
if (n < 0) return !1;
|
|
203
|
-
let r = e.lineStart + t.pos, i = t.next, a = n - t.pos, o = t.skipSpace(n), s =
|
|
204
|
-
o < s && c.push(
|
|
204
|
+
let r = e.lineStart + t.pos, i = t.next, a = n - t.pos, o = t.skipSpace(n), s = ge(t.text, t.text.length, o), c = [P(v.CodeMark, r, r + a)];
|
|
205
|
+
o < s && c.push(P(v.CodeInfo, e.lineStart + o, e.lineStart + s));
|
|
205
206
|
for (let n = !0, r = !0, o = !1; e.nextLine() && t.depth >= e.stack.length; n = !1) {
|
|
206
207
|
let s = t.pos;
|
|
207
208
|
if (t.indent - t.baseIndent < 4) for (; s < t.text.length && t.text.charCodeAt(s) == i;) s++;
|
|
208
209
|
if (s - t.pos >= a && t.skipSpace(s) == t.text.length) {
|
|
209
210
|
for (let e of t.markers) c.push(e);
|
|
210
|
-
r && o &&
|
|
211
|
+
r && o && E(c, e.lineStart - 1, e.lineStart), c.push(P(v.CodeMark, e.lineStart + t.pos, e.lineStart + s)), e.nextLine();
|
|
211
212
|
break;
|
|
212
213
|
}
|
|
213
214
|
{
|
|
214
|
-
o = !0, n || (
|
|
215
|
+
o = !0, n || (E(c, e.lineStart - 1, e.lineStart), r = !1);
|
|
215
216
|
for (let e of t.markers) c.push(e);
|
|
216
217
|
let i = e.lineStart + t.basePos, a = e.lineStart + t.text.length;
|
|
217
|
-
i < a && (
|
|
218
|
+
i < a && (E(c, i, a), r = !1);
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
|
-
return e.addNode(e.buffer.writeElements(c, -r).finish(
|
|
221
|
+
return e.addNode(e.buffer.writeElements(c, -r).finish(v.FencedCode, e.prevLineEnd() - r), r), !0;
|
|
221
222
|
},
|
|
222
223
|
Blockquote(e, t) {
|
|
223
|
-
let n =
|
|
224
|
-
return n < 0 ? !1 : (e.startContext(
|
|
224
|
+
let n = ve(t);
|
|
225
|
+
return n < 0 ? !1 : (e.startContext(v.Blockquote, t.pos), e.addNode(v.QuoteMark, e.lineStart + t.pos, e.lineStart + t.pos + 1), t.moveBase(t.pos + n), null);
|
|
225
226
|
},
|
|
226
227
|
HorizontalRule(e, t) {
|
|
227
|
-
if (
|
|
228
|
+
if (x(t, e, !1) < 0) return !1;
|
|
228
229
|
let n = e.lineStart + t.pos;
|
|
229
|
-
return e.nextLine(), e.addNode(
|
|
230
|
+
return e.nextLine(), e.addNode(v.HorizontalRule, n), !0;
|
|
230
231
|
},
|
|
231
232
|
BulletList(e, t) {
|
|
232
|
-
let n =
|
|
233
|
+
let n = S(t, e, !1);
|
|
233
234
|
if (n < 0) return !1;
|
|
234
|
-
e.block.type !=
|
|
235
|
-
let r =
|
|
236
|
-
return e.startContext(
|
|
235
|
+
e.block.type != v.BulletList && e.startContext(v.BulletList, t.basePos, t.next);
|
|
236
|
+
let r = Te(t, t.pos + 1);
|
|
237
|
+
return e.startContext(v.ListItem, t.basePos, r - t.baseIndent), e.addNode(v.ListMark, e.lineStart + t.pos, e.lineStart + t.pos + n), t.moveBaseColumn(r), null;
|
|
237
238
|
},
|
|
238
239
|
OrderedList(e, t) {
|
|
239
|
-
let n =
|
|
240
|
+
let n = C(t, e, !1);
|
|
240
241
|
if (n < 0) return !1;
|
|
241
|
-
e.block.type !=
|
|
242
|
-
let r =
|
|
243
|
-
return e.startContext(
|
|
242
|
+
e.block.type != v.OrderedList && e.startContext(v.OrderedList, t.basePos, t.text.charCodeAt(t.pos + n - 1));
|
|
243
|
+
let r = Te(t, t.pos + n);
|
|
244
|
+
return e.startContext(v.ListItem, t.basePos, r - t.baseIndent), e.addNode(v.ListMark, e.lineStart + t.pos, e.lineStart + t.pos + n), t.moveBaseColumn(r), null;
|
|
244
245
|
},
|
|
245
246
|
ATXHeading(e, t) {
|
|
246
|
-
let n =
|
|
247
|
+
let n = be(t);
|
|
247
248
|
if (n < 0) return !1;
|
|
248
|
-
let r = t.pos, i = e.lineStart + r, a =
|
|
249
|
+
let r = t.pos, i = e.lineStart + r, a = ge(t.text, t.text.length, r), o = a;
|
|
249
250
|
for (; o > r && t.text.charCodeAt(o - 1) == t.next;) o--;
|
|
250
|
-
(o == a || o == r || !
|
|
251
|
-
let s = e.buffer.write(
|
|
252
|
-
o < t.text.length && s.write(
|
|
253
|
-
let c = s.finish(
|
|
251
|
+
(o == a || o == r || !y(t.text.charCodeAt(o - 1))) && (o = t.text.length);
|
|
252
|
+
let s = e.buffer.write(v.HeaderMark, 0, n).writeElements(e.parser.parseInline(t.text.slice(r + n + 1, o), i + n + 1), -i);
|
|
253
|
+
o < t.text.length && s.write(v.HeaderMark, o - r, a - r);
|
|
254
|
+
let c = s.finish(v.ATXHeading1 - 1 + n, t.text.length - r);
|
|
254
255
|
return e.nextLine(), e.addNode(c, i), !0;
|
|
255
256
|
},
|
|
256
257
|
HTMLBlock(e, t) {
|
|
257
|
-
let n =
|
|
258
|
+
let n = we(t, e, !1);
|
|
258
259
|
if (n < 0) return !1;
|
|
259
|
-
let r = e.lineStart + t.pos, i =
|
|
260
|
+
let r = e.lineStart + t.pos, i = T[n][1], a = [], o = i != w;
|
|
260
261
|
for (; !i.test(t.text) && e.nextLine();) {
|
|
261
262
|
if (t.depth < e.stack.length) {
|
|
262
263
|
o = !1;
|
|
@@ -265,11 +266,11 @@ var O = {
|
|
|
265
266
|
for (let e of t.markers) a.push(e);
|
|
266
267
|
}
|
|
267
268
|
o && e.nextLine();
|
|
268
|
-
let s = i ==
|
|
269
|
+
let s = i == Se ? v.CommentBlock : i == Ce ? v.ProcessingInstructionBlock : v.HTMLBlock, c = e.prevLineEnd();
|
|
269
270
|
return e.addNode(e.buffer.writeElements(a, -r).finish(s, c - r), r), !0;
|
|
270
271
|
},
|
|
271
272
|
SetextHeading: void 0
|
|
272
|
-
},
|
|
273
|
+
}, Ee = class {
|
|
273
274
|
constructor(e) {
|
|
274
275
|
this.stage = 0, this.elts = [], this.pos = 0, this.start = e.start, this.advance(e.content);
|
|
275
276
|
}
|
|
@@ -279,10 +280,10 @@ var O = {
|
|
|
279
280
|
return i > -1 && i < r.length && this.complete(e, n, i);
|
|
280
281
|
}
|
|
281
282
|
finish(e, t) {
|
|
282
|
-
return (this.stage == 2 || this.stage == 3) &&
|
|
283
|
+
return (this.stage == 2 || this.stage == 3) && b(t.content, this.pos) == t.content.length && this.complete(e, t, t.content.length);
|
|
283
284
|
}
|
|
284
285
|
complete(e, t, n) {
|
|
285
|
-
return e.addLeafElement(t,
|
|
286
|
+
return e.addLeafElement(t, P(v.LinkReference, this.start, this.start + n, this.elts)), !0;
|
|
286
287
|
}
|
|
287
288
|
nextStage(e) {
|
|
288
289
|
return e ? (this.pos = e.to - this.start, this.elts.push(e), this.stage++, !0) : (e === !1 && (this.stage = -1), !1);
|
|
@@ -290,63 +291,63 @@ var O = {
|
|
|
290
291
|
advance(e) {
|
|
291
292
|
for (;;) if (this.stage == -1) return -1;
|
|
292
293
|
else if (this.stage == 0) {
|
|
293
|
-
if (!this.nextStage(
|
|
294
|
+
if (!this.nextStage(Ve(e, this.pos, this.start, !0))) return -1;
|
|
294
295
|
if (e.charCodeAt(this.pos) != 58) return this.stage = -1;
|
|
295
|
-
this.elts.push(
|
|
296
|
+
this.elts.push(P(v.LinkMark, this.pos + this.start, this.pos + this.start + 1)), this.pos++;
|
|
296
297
|
} else if (this.stage == 1) {
|
|
297
|
-
if (!this.nextStage(
|
|
298
|
+
if (!this.nextStage(ze(e, b(e, this.pos), this.start))) return -1;
|
|
298
299
|
} else if (this.stage == 2) {
|
|
299
|
-
let t =
|
|
300
|
+
let t = b(e, this.pos), n = 0;
|
|
300
301
|
if (t > this.pos) {
|
|
301
|
-
let r =
|
|
302
|
+
let r = Be(e, t, this.start);
|
|
302
303
|
if (r) {
|
|
303
|
-
let t =
|
|
304
|
+
let t = O(e, r.to - this.start);
|
|
304
305
|
t > 0 && (this.nextStage(r), n = t);
|
|
305
306
|
}
|
|
306
307
|
}
|
|
307
|
-
return n ||=
|
|
308
|
-
} else return
|
|
308
|
+
return n ||= O(e, this.pos), n > 0 && n < e.length ? n : -1;
|
|
309
|
+
} else return O(e, this.pos);
|
|
309
310
|
}
|
|
310
311
|
};
|
|
311
|
-
function
|
|
312
|
+
function O(e, t) {
|
|
312
313
|
for (; t < e.length; t++) {
|
|
313
314
|
let n = e.charCodeAt(t);
|
|
314
315
|
if (n == 10) break;
|
|
315
|
-
if (!
|
|
316
|
+
if (!y(n)) return -1;
|
|
316
317
|
}
|
|
317
318
|
return t;
|
|
318
319
|
}
|
|
319
|
-
var
|
|
320
|
+
var De = class {
|
|
320
321
|
nextLine(e, t, n) {
|
|
321
|
-
let r = t.depth < e.stack.length ? -1 :
|
|
322
|
+
let r = t.depth < e.stack.length ? -1 : xe(t), i = t.next;
|
|
322
323
|
if (r < 0) return !1;
|
|
323
|
-
let a =
|
|
324
|
-
return e.nextLine(), e.addLeafElement(n,
|
|
324
|
+
let a = P(v.HeaderMark, e.lineStart + t.pos, e.lineStart + r);
|
|
325
|
+
return e.nextLine(), e.addLeafElement(n, P(i == 61 ? v.SetextHeading1 : v.SetextHeading2, n.start, e.prevLineEnd(), [...e.parser.parseInline(n.content, n.start), a])), !0;
|
|
325
326
|
}
|
|
326
327
|
finish() {
|
|
327
328
|
return !1;
|
|
328
329
|
}
|
|
329
|
-
},
|
|
330
|
+
}, Oe = {
|
|
330
331
|
LinkReference(e, t) {
|
|
331
|
-
return t.content.charCodeAt(0) == 91 ? new
|
|
332
|
+
return t.content.charCodeAt(0) == 91 ? new Ee(t) : null;
|
|
332
333
|
},
|
|
333
334
|
SetextHeading() {
|
|
334
|
-
return new
|
|
335
|
+
return new De();
|
|
335
336
|
}
|
|
336
|
-
},
|
|
337
|
-
(e, t) =>
|
|
338
|
-
(e, t) =>
|
|
339
|
-
(e, t) =>
|
|
340
|
-
(e, t) => C(t, e, !0) >= 0,
|
|
341
|
-
(e, t) => w(t, e, !0) >= 0,
|
|
337
|
+
}, ke = [
|
|
338
|
+
(e, t) => be(t) >= 0,
|
|
339
|
+
(e, t) => _e(t) >= 0,
|
|
340
|
+
(e, t) => ve(t) >= 0,
|
|
342
341
|
(e, t) => S(t, e, !0) >= 0,
|
|
343
|
-
(e, t) =>
|
|
344
|
-
|
|
342
|
+
(e, t) => C(t, e, !0) >= 0,
|
|
343
|
+
(e, t) => x(t, e, !0) >= 0,
|
|
344
|
+
(e, t) => we(t, e, !0) >= 0
|
|
345
|
+
], Ae = {
|
|
345
346
|
text: "",
|
|
346
347
|
end: 0
|
|
347
|
-
},
|
|
348
|
+
}, je = class {
|
|
348
349
|
constructor(e, t, n, r) {
|
|
349
|
-
this.parser = e, this.input = t, this.ranges = r, this.line = new
|
|
350
|
+
this.parser = e, this.input = t, this.ranges = r, this.line = new pe(), this.atEnd = !1, this.reusePlaceholders = /* @__PURE__ */ new Map(), this.stoppedAt = null, this.rangeI = 0, this.to = r[r.length - 1].to, this.lineStart = this.absoluteLineStart = this.absoluteLineEnd = r[0].from, this.block = de.create(v.Document, 0, this.lineStart, 0, 0), this.stack = [this.block], this.fragments = n.length ? new Ue(n, t) : null, this.readLine();
|
|
350
351
|
}
|
|
351
352
|
get parsedPos() {
|
|
352
353
|
return this.absoluteLineStart;
|
|
@@ -380,7 +381,7 @@ var Ee = class {
|
|
|
380
381
|
break;
|
|
381
382
|
}
|
|
382
383
|
if (e.pos == e.text.length) return this.nextLine() ? null : this.finish();
|
|
383
|
-
let t = new
|
|
384
|
+
let t = new fe(this.lineStart + e.pos, e.text.slice(e.pos));
|
|
384
385
|
for (let e of this.parser.leafBlockParsers) if (e) {
|
|
385
386
|
let n = e(this, t);
|
|
386
387
|
n && t.parsers.push(n);
|
|
@@ -402,7 +403,7 @@ var Ee = class {
|
|
|
402
403
|
reuseFragment(e) {
|
|
403
404
|
if (!this.fragments.moveTo(this.absoluteLineStart + e, this.absoluteLineStart) || !this.fragments.matches(this.block.hash)) return !1;
|
|
404
405
|
let t = this.fragments.takeNodes(this);
|
|
405
|
-
return t ? (this.absoluteLineStart += t, this.lineStart =
|
|
406
|
+
return t ? (this.absoluteLineStart += t, this.lineStart = We(this.absoluteLineStart, this.ranges), this.moveRangeI(), this.absoluteLineStart < this.to ? (this.lineStart++, this.absoluteLineStart++, this.readLine()) : (this.atEnd = !0, this.readLine()), !0) : !1;
|
|
406
407
|
}
|
|
407
408
|
get depth() {
|
|
408
409
|
return this.stack.length;
|
|
@@ -420,7 +421,7 @@ var Ee = class {
|
|
|
420
421
|
for (; this.rangeI < this.ranges.length - 1 && this.absoluteLineStart >= this.ranges[this.rangeI].to;) this.rangeI++, this.absoluteLineStart = Math.max(this.absoluteLineStart, this.ranges[this.rangeI].from);
|
|
421
422
|
}
|
|
422
423
|
scanLine(e) {
|
|
423
|
-
let t =
|
|
424
|
+
let t = Ae;
|
|
424
425
|
if (t.end = e, e >= this.to) t.text = "";
|
|
425
426
|
else if (t.text = this.lineChunkAt(e), t.end += t.text.length, this.ranges.length > 1) {
|
|
426
427
|
let e = this.absoluteLineStart, n = this.rangeI;
|
|
@@ -436,7 +437,7 @@ var Ee = class {
|
|
|
436
437
|
let { line: e } = this, { text: t, end: n } = this.scanLine(this.absoluteLineStart);
|
|
437
438
|
for (this.absoluteLineEnd = n, e.reset(t); e.depth < this.stack.length; e.depth++) {
|
|
438
439
|
let t = this.stack[e.depth], n = this.parser.skipContextMarkup[t.type];
|
|
439
|
-
if (!n) throw Error("Unhandled block context " +
|
|
440
|
+
if (!n) throw Error("Unhandled block context " + v[t.type]);
|
|
440
441
|
let r = this.line.markers.length;
|
|
441
442
|
if (!n(t, this, e)) {
|
|
442
443
|
this.line.markers.length > r && (t.end = this.line.markers[this.line.markers.length - 1].to), e.forward();
|
|
@@ -458,19 +459,19 @@ var Ee = class {
|
|
|
458
459
|
return this.atEnd ? this.lineStart : this.lineStart - 1;
|
|
459
460
|
}
|
|
460
461
|
startContext(e, t, n = 0) {
|
|
461
|
-
this.block =
|
|
462
|
+
this.block = de.create(e, n, this.lineStart + t, this.block.hash, this.lineStart + this.line.text.length), this.stack.push(this.block);
|
|
462
463
|
}
|
|
463
464
|
startComposite(e, t, n = 0) {
|
|
464
465
|
this.startContext(this.parser.getNodeType(e), t, n);
|
|
465
466
|
}
|
|
466
467
|
addNode(e, t, n) {
|
|
467
|
-
typeof e == "number" && (e = new
|
|
468
|
+
typeof e == "number" && (e = new h(this.parser.nodeSet.types[e], M, M, (n ?? this.prevLineEnd()) - t)), this.block.addChild(e, t - this.block.from);
|
|
468
469
|
}
|
|
469
470
|
addElement(e) {
|
|
470
471
|
this.block.addChild(e.toTree(this.parser.nodeSet), e.from - this.block.from);
|
|
471
472
|
}
|
|
472
473
|
addLeafElement(e, t) {
|
|
473
|
-
this.addNode(this.buffer.writeElements(
|
|
474
|
+
this.addNode(this.buffer.writeElements(U(t.children, e.marks), -t.from).finish(t.type, t.to - t.from), t.from);
|
|
474
475
|
}
|
|
475
476
|
finishContext() {
|
|
476
477
|
let e = this.stack.pop(), t = this.stack[this.stack.length - 1];
|
|
@@ -481,91 +482,91 @@ var Ee = class {
|
|
|
481
482
|
return this.addGaps(this.block.toTree(this.parser.nodeSet, this.lineStart));
|
|
482
483
|
}
|
|
483
484
|
addGaps(e) {
|
|
484
|
-
return this.ranges.length > 1 ?
|
|
485
|
+
return this.ranges.length > 1 ? Me(this.ranges, 0, e.topNode, this.ranges[0].from, this.reusePlaceholders) : e;
|
|
485
486
|
}
|
|
486
487
|
finishLeaf(e) {
|
|
487
488
|
for (let t of e.parsers) if (t.finish(this, e)) return;
|
|
488
|
-
let t =
|
|
489
|
-
this.addNode(this.buffer.writeElements(t, -e.start).finish(
|
|
489
|
+
let t = U(this.parser.parseInline(e.content, e.start), e.marks);
|
|
490
|
+
this.addNode(this.buffer.writeElements(t, -e.start).finish(v.Paragraph, e.content.length), e.start);
|
|
490
491
|
}
|
|
491
492
|
elt(e, t, n, r) {
|
|
492
|
-
return typeof e == "string" ?
|
|
493
|
+
return typeof e == "string" ? P(this.parser.getNodeType(e), t, n, r) : new Ie(e, t);
|
|
493
494
|
}
|
|
494
495
|
get buffer() {
|
|
495
|
-
return new
|
|
496
|
+
return new Fe(this.parser.nodeSet);
|
|
496
497
|
}
|
|
497
498
|
};
|
|
498
|
-
function
|
|
499
|
-
let
|
|
500
|
-
function
|
|
501
|
-
for (;
|
|
502
|
-
let
|
|
503
|
-
|
|
499
|
+
function Me(e, t, n, r, i) {
|
|
500
|
+
let a = e[t].to, o = [], s = [], c = n.from + r;
|
|
501
|
+
function l(n, i) {
|
|
502
|
+
for (; i ? n >= a : n > a;) {
|
|
503
|
+
let i = e[t + 1].from - a;
|
|
504
|
+
r += i, n += i, t++, a = e[t].to;
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
|
-
for (let
|
|
507
|
-
u
|
|
508
|
-
let n =
|
|
509
|
-
f ? d = f :
|
|
507
|
+
for (let u = n.firstChild; u; u = u.nextSibling) {
|
|
508
|
+
l(u.from + r, !0);
|
|
509
|
+
let n = u.from + r, d, f = i.get(u.tree);
|
|
510
|
+
f ? d = f : u.to + r > a ? (d = Me(e, t, u, r, i), l(u.to + r, !1)) : d = u.toTree(), o.push(d), s.push(n - c);
|
|
510
511
|
}
|
|
511
|
-
return
|
|
512
|
+
return l(n.to + r, !1), new h(n.type, o, s, n.to + r - c, n.tree ? n.tree.propValues : void 0);
|
|
512
513
|
}
|
|
513
|
-
var
|
|
514
|
+
var Ne = class e extends s {
|
|
514
515
|
constructor(e, t, n, r, i, a, o, s, c) {
|
|
515
516
|
super(), this.nodeSet = e, this.blockParsers = t, this.leafBlockParsers = n, this.blockNames = r, this.endLeafBlock = i, this.skipContextMarkup = a, this.inlineParsers = o, this.inlineNames = s, this.wrappers = c, this.nodeTypes = Object.create(null);
|
|
516
517
|
for (let t of e.types) this.nodeTypes[t.name] = t.id;
|
|
517
518
|
}
|
|
518
519
|
createParse(e, t, n) {
|
|
519
|
-
let r = new
|
|
520
|
+
let r = new je(this, e, t, n);
|
|
520
521
|
for (let i of this.wrappers) r = i(r, e, t, n);
|
|
521
522
|
return r;
|
|
522
523
|
}
|
|
523
524
|
configure(t) {
|
|
524
|
-
let
|
|
525
|
-
if (!
|
|
526
|
-
let { nodeSet:
|
|
527
|
-
if (
|
|
528
|
-
|
|
529
|
-
let
|
|
530
|
-
for (let
|
|
531
|
-
let { name:
|
|
532
|
-
if (
|
|
533
|
-
|
|
534
|
-
let
|
|
525
|
+
let n = A(t);
|
|
526
|
+
if (!n) return this;
|
|
527
|
+
let { nodeSet: r, skipContextMarkup: i } = this, a = this.blockParsers.slice(), s = this.leafBlockParsers.slice(), c = this.blockNames.slice(), f = this.inlineParsers.slice(), m = this.inlineNames.slice(), h = this.endLeafBlock.slice(), g = this.wrappers;
|
|
528
|
+
if (k(n.defineNodes)) {
|
|
529
|
+
i = Object.assign({}, i);
|
|
530
|
+
let e = r.types.slice(), t;
|
|
531
|
+
for (let r of n.defineNodes) {
|
|
532
|
+
let { name: n, block: a, composite: s, style: c } = typeof r == "string" ? { name: r } : r;
|
|
533
|
+
if (e.some((e) => e.name == n)) continue;
|
|
534
|
+
s && (i[e.length] = (e, t, n) => s(t, n, e.value));
|
|
535
|
+
let u = e.length, d = s ? ["Block", "BlockContext"] : a ? u >= v.ATXHeading1 && u <= v.SetextHeading2 ? [
|
|
535
536
|
"Block",
|
|
536
537
|
"LeafBlock",
|
|
537
538
|
"Heading"
|
|
538
539
|
] : ["Block", "LeafBlock"] : void 0;
|
|
539
|
-
|
|
540
|
-
id:
|
|
541
|
-
name:
|
|
542
|
-
props:
|
|
543
|
-
})),
|
|
540
|
+
e.push(p.define({
|
|
541
|
+
id: u,
|
|
542
|
+
name: n,
|
|
543
|
+
props: d && [[l.group, d]]
|
|
544
|
+
})), c && (t ||= {}, Array.isArray(c) || c instanceof o ? t[n] = c : Object.assign(t, c));
|
|
544
545
|
}
|
|
545
|
-
|
|
546
|
+
r = new u(e), t && (r = r.extend(d(t)));
|
|
546
547
|
}
|
|
547
|
-
if (
|
|
548
|
+
if (k(n.props) && (r = r.extend(...n.props)), k(n.remove)) for (let e of n.remove) {
|
|
548
549
|
let t = this.blockNames.indexOf(e), n = this.inlineNames.indexOf(e);
|
|
549
|
-
t > -1 && (
|
|
550
|
+
t > -1 && (a[t] = s[t] = void 0), n > -1 && (f[n] = void 0);
|
|
550
551
|
}
|
|
551
|
-
if (
|
|
552
|
-
let t =
|
|
553
|
-
if (t > -1)
|
|
552
|
+
if (k(n.parseBlock)) for (let e of n.parseBlock) {
|
|
553
|
+
let t = c.indexOf(e.name);
|
|
554
|
+
if (t > -1) a[t] = e.parse, s[t] = e.leaf;
|
|
554
555
|
else {
|
|
555
|
-
let t = e.before ?
|
|
556
|
-
|
|
556
|
+
let t = e.before ? j(c, e.before) : e.after ? j(c, e.after) + 1 : c.length - 1;
|
|
557
|
+
a.splice(t, 0, e.parse), s.splice(t, 0, e.leaf), c.splice(t, 0, e.name);
|
|
557
558
|
}
|
|
558
|
-
e.endLeaf &&
|
|
559
|
+
e.endLeaf && h.push(e.endLeaf);
|
|
559
560
|
}
|
|
560
|
-
if (
|
|
561
|
-
let t =
|
|
562
|
-
if (t > -1)
|
|
561
|
+
if (k(n.parseInline)) for (let e of n.parseInline) {
|
|
562
|
+
let t = m.indexOf(e.name);
|
|
563
|
+
if (t > -1) f[t] = e.parse;
|
|
563
564
|
else {
|
|
564
|
-
let t = e.before ?
|
|
565
|
-
|
|
565
|
+
let t = e.before ? j(m, e.before) : e.after ? j(m, e.after) + 1 : m.length - 1;
|
|
566
|
+
f.splice(t, 0, e.parse), m.splice(t, 0, e.name);
|
|
566
567
|
}
|
|
567
568
|
}
|
|
568
|
-
return
|
|
569
|
+
return n.wrap && (g = g.concat(n.wrap)), new e(r, a, s, c, h, i, f, m, g);
|
|
569
570
|
}
|
|
570
571
|
getNodeType(e) {
|
|
571
572
|
let t = this.nodeTypes[e];
|
|
@@ -573,7 +574,7 @@ var je = class n extends t {
|
|
|
573
574
|
return t;
|
|
574
575
|
}
|
|
575
576
|
parseInline(e, t) {
|
|
576
|
-
let n = new
|
|
577
|
+
let n = new H(this, e, t);
|
|
577
578
|
outer: for (let e = t; e < n.end;) {
|
|
578
579
|
let t = n.char(e);
|
|
579
580
|
for (let r of this.inlineParsers) if (r) {
|
|
@@ -588,17 +589,17 @@ var je = class n extends t {
|
|
|
588
589
|
return n.resolveMarkers(0);
|
|
589
590
|
}
|
|
590
591
|
};
|
|
591
|
-
function
|
|
592
|
+
function k(e) {
|
|
592
593
|
return e != null && e.length > 0;
|
|
593
594
|
}
|
|
594
|
-
function
|
|
595
|
+
function A(e) {
|
|
595
596
|
if (!Array.isArray(e)) return e;
|
|
596
597
|
if (e.length == 0) return null;
|
|
597
|
-
let t =
|
|
598
|
+
let t = A(e[0]);
|
|
598
599
|
if (e.length == 1) return t;
|
|
599
|
-
let n =
|
|
600
|
+
let n = A(e.slice(1));
|
|
600
601
|
if (!n || !t) return t || n;
|
|
601
|
-
let r = (e, t) => (e ||
|
|
602
|
+
let r = (e, t) => (e || M).concat(t || M), i = t.wrap, a = n.wrap;
|
|
602
603
|
return {
|
|
603
604
|
props: r(t.props, n.props),
|
|
604
605
|
defineNodes: r(t.defineNodes, n.defineNodes),
|
|
@@ -608,19 +609,19 @@ function M(e) {
|
|
|
608
609
|
wrap: i ? a ? (e, t, n, r) => i(a(e, t, n, r), t, n, r) : i : a
|
|
609
610
|
};
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
+
function j(e, t) {
|
|
612
613
|
let n = e.indexOf(t);
|
|
613
614
|
if (n < 0) throw RangeError(`Position specified relative to unknown parser ${t}`);
|
|
614
615
|
return n;
|
|
615
616
|
}
|
|
616
|
-
var
|
|
617
|
-
for (let
|
|
618
|
-
id:
|
|
619
|
-
name:
|
|
620
|
-
props:
|
|
621
|
-
top:
|
|
617
|
+
var Pe = [p.none];
|
|
618
|
+
for (let e = 1, t; t = v[e]; e++) Pe[e] = p.define({
|
|
619
|
+
id: e,
|
|
620
|
+
name: t,
|
|
621
|
+
props: e >= v.Escape ? [] : [[l.group, e in he ? ["Block", "BlockContext"] : ["Block", "LeafBlock"]]],
|
|
622
|
+
top: t == "Document"
|
|
622
623
|
});
|
|
623
|
-
var
|
|
624
|
+
var M = [], Fe = class {
|
|
624
625
|
constructor(e) {
|
|
625
626
|
this.nodeSet = e, this.content = [], this.nodes = [];
|
|
626
627
|
}
|
|
@@ -632,7 +633,7 @@ var P = [], Ne = class {
|
|
|
632
633
|
return this;
|
|
633
634
|
}
|
|
634
635
|
finish(e, t) {
|
|
635
|
-
return
|
|
636
|
+
return h.build({
|
|
636
637
|
buffer: this.content,
|
|
637
638
|
nodeSet: this.nodeSet,
|
|
638
639
|
reused: this.nodes,
|
|
@@ -640,8 +641,8 @@ var P = [], Ne = class {
|
|
|
640
641
|
length: t
|
|
641
642
|
});
|
|
642
643
|
}
|
|
643
|
-
},
|
|
644
|
-
constructor(e, t, n, r =
|
|
644
|
+
}, N = class {
|
|
645
|
+
constructor(e, t, n, r = M) {
|
|
645
646
|
this.type = e, this.from = t, this.to = n, this.children = r;
|
|
646
647
|
}
|
|
647
648
|
writeTo(e, t) {
|
|
@@ -649,9 +650,9 @@ var P = [], Ne = class {
|
|
|
649
650
|
e.writeElements(this.children, t), e.content.push(this.type, this.from + t, this.to + t, e.content.length + 4 - n);
|
|
650
651
|
}
|
|
651
652
|
toTree(e) {
|
|
652
|
-
return new
|
|
653
|
+
return new Fe(e).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);
|
|
653
654
|
}
|
|
654
|
-
},
|
|
655
|
+
}, Ie = class {
|
|
655
656
|
constructor(e, t) {
|
|
656
657
|
this.tree = e, this.from = t;
|
|
657
658
|
}
|
|
@@ -662,7 +663,7 @@ var P = [], Ne = class {
|
|
|
662
663
|
return this.tree.type.id;
|
|
663
664
|
}
|
|
664
665
|
get children() {
|
|
665
|
-
return
|
|
666
|
+
return M;
|
|
666
667
|
}
|
|
667
668
|
writeTo(e, t) {
|
|
668
669
|
e.nodes.push(this.tree), e.content.push(e.nodes.length - 1, this.from + t, this.to + t, -1);
|
|
@@ -671,34 +672,34 @@ var P = [], Ne = class {
|
|
|
671
672
|
return this.tree;
|
|
672
673
|
}
|
|
673
674
|
};
|
|
674
|
-
function
|
|
675
|
-
return new
|
|
675
|
+
function P(e, t, n, r) {
|
|
676
|
+
return new N(e, t, n, r);
|
|
676
677
|
}
|
|
677
|
-
var
|
|
678
|
+
var F = {
|
|
678
679
|
resolve: "Emphasis",
|
|
679
680
|
mark: "EmphasisMark"
|
|
680
|
-
},
|
|
681
|
+
}, I = {
|
|
681
682
|
resolve: "Emphasis",
|
|
682
683
|
mark: "EmphasisMark"
|
|
683
|
-
},
|
|
684
|
+
}, L = {}, R = {}, z = class {
|
|
684
685
|
constructor(e, t, n, r, i = n - t) {
|
|
685
686
|
this.type = e, this.from = t, this.to = n, this.side = r, this.size = i;
|
|
686
687
|
}
|
|
687
|
-
},
|
|
688
|
+
}, Le = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", B = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;
|
|
688
689
|
try {
|
|
689
|
-
|
|
690
|
+
B = /* @__PURE__ */ RegExp("[\\p{S}|\\p{P}]", "u");
|
|
690
691
|
} catch {}
|
|
691
|
-
var
|
|
692
|
+
var V = {
|
|
692
693
|
Escape(e, t, n) {
|
|
693
694
|
if (t != 92 || n == e.end - 1) return -1;
|
|
694
695
|
let r = e.char(n + 1);
|
|
695
|
-
for (let t = 0; t < 32; t++) if (
|
|
696
|
+
for (let t = 0; t < 32; t++) if (Le.charCodeAt(t) == r) return e.append(P(v.Escape, n, n + 2));
|
|
696
697
|
return -1;
|
|
697
698
|
},
|
|
698
699
|
Entity(e, t, n) {
|
|
699
700
|
if (t != 38) return -1;
|
|
700
701
|
let r = /^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n + 1, n + 31));
|
|
701
|
-
return r ? e.append(
|
|
702
|
+
return r ? e.append(P(v.Entity, n, n + 1 + r[0].length)) : -1;
|
|
702
703
|
},
|
|
703
704
|
InlineCode(e, t, n) {
|
|
704
705
|
if (t != 96 || n && e.char(n - 1) == 96) return -1;
|
|
@@ -706,57 +707,57 @@ var U = {
|
|
|
706
707
|
for (; r < e.end && e.char(r) == 96;) r++;
|
|
707
708
|
let i = r - n, a = 0;
|
|
708
709
|
for (; r < e.end; r++) if (e.char(r) == 96) {
|
|
709
|
-
if (a++, a == i && e.char(r + 1) != 96) return e.append(
|
|
710
|
+
if (a++, a == i && e.char(r + 1) != 96) return e.append(P(v.InlineCode, n, r + 1, [P(v.CodeMark, n, n + i), P(v.CodeMark, r + 1 - i, r + 1)]));
|
|
710
711
|
} else a = 0;
|
|
711
712
|
return -1;
|
|
712
713
|
},
|
|
713
714
|
HTMLTag(e, t, n) {
|
|
714
715
|
if (t != 60 || n == e.end - 1) return -1;
|
|
715
716
|
let r = e.slice(n + 1, e.end), i = /^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);
|
|
716
|
-
if (i) return e.append(
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
717
|
+
if (i) return e.append(P(v.Autolink, n, n + 1 + i[0].length, [
|
|
718
|
+
P(v.LinkMark, n, n + 1),
|
|
719
|
+
P(v.URL, n + 1, n + i[0].length),
|
|
720
|
+
P(v.LinkMark, n + i[0].length, n + 1 + i[0].length)
|
|
720
721
|
]));
|
|
721
722
|
let a = /^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);
|
|
722
|
-
if (a) return e.append(
|
|
723
|
+
if (a) return e.append(P(v.Comment, n, n + 1 + a[0].length));
|
|
723
724
|
let o = /^\?[^]*?\?>/.exec(r);
|
|
724
|
-
if (o) return e.append(
|
|
725
|
+
if (o) return e.append(P(v.ProcessingInstruction, n, n + 1 + o[0].length));
|
|
725
726
|
let s = /^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);
|
|
726
|
-
return s ? e.append(
|
|
727
|
+
return s ? e.append(P(v.HTMLTag, n, n + 1 + s[0].length)) : -1;
|
|
727
728
|
},
|
|
728
729
|
Emphasis(e, t, n) {
|
|
729
730
|
if (t != 95 && t != 42) return -1;
|
|
730
731
|
let r = n + 1;
|
|
731
732
|
for (; e.char(r) == t;) r++;
|
|
732
|
-
let i = e.slice(n - 1, n), a = e.slice(r, r + 1), o =
|
|
733
|
-
return e.append(new
|
|
733
|
+
let i = e.slice(n - 1, n), a = e.slice(r, r + 1), o = B.test(i), s = B.test(a), c = /\s|^$/.test(i), l = /\s|^$/.test(a), u = !l && (!s || c || o), d = !c && (!o || l || s), f = u && (t == 42 || !d || o), p = d && (t == 42 || !u || s);
|
|
734
|
+
return e.append(new z(t == 95 ? F : I, n, r, !!f | (p ? 2 : 0)));
|
|
734
735
|
},
|
|
735
736
|
HardBreak(e, t, n) {
|
|
736
|
-
if (t == 92 && e.char(n + 1) == 10) return e.append(
|
|
737
|
+
if (t == 92 && e.char(n + 1) == 10) return e.append(P(v.HardBreak, n, n + 2));
|
|
737
738
|
if (t == 32) {
|
|
738
739
|
let t = n + 1;
|
|
739
740
|
for (; e.char(t) == 32;) t++;
|
|
740
|
-
if (e.char(t) == 10 && t >= n + 2) return e.append(
|
|
741
|
+
if (e.char(t) == 10 && t >= n + 2) return e.append(P(v.HardBreak, n, t + 1));
|
|
741
742
|
}
|
|
742
743
|
return -1;
|
|
743
744
|
},
|
|
744
745
|
Link(e, t, n) {
|
|
745
|
-
return t == 91 ? e.append(new
|
|
746
|
+
return t == 91 ? e.append(new z(L, n, n + 1, 1)) : -1;
|
|
746
747
|
},
|
|
747
748
|
Image(e, t, n) {
|
|
748
|
-
return t == 33 && e.char(n + 1) == 91 ? e.append(new
|
|
749
|
+
return t == 33 && e.char(n + 1) == 91 ? e.append(new z(R, n, n + 2, 1)) : -1;
|
|
749
750
|
},
|
|
750
751
|
LinkEnd(e, t, n) {
|
|
751
752
|
if (t != 93) return -1;
|
|
752
753
|
for (let t = e.parts.length - 1; t >= 0; t--) {
|
|
753
754
|
let r = e.parts[t];
|
|
754
|
-
if (r instanceof
|
|
755
|
+
if (r instanceof z && (r.type == L || r.type == R)) {
|
|
755
756
|
if (!r.side || e.skipSpace(r.to) == n && !/[(\[]/.test(e.slice(n + 1, n + 2))) return e.parts[t] = null, -1;
|
|
756
|
-
let i = e.takeContent(t), a = e.parts[t] =
|
|
757
|
-
if (r.type ==
|
|
757
|
+
let i = e.takeContent(t), a = e.parts[t] = Re(e, i, r.type == L ? v.Link : v.Image, r.from, n + 1);
|
|
758
|
+
if (r.type == L) for (let n = 0; n < t; n++) {
|
|
758
759
|
let t = e.parts[n];
|
|
759
|
-
t instanceof
|
|
760
|
+
t instanceof z && t.type == L && (t.side = 0);
|
|
760
761
|
}
|
|
761
762
|
return a.to;
|
|
762
763
|
}
|
|
@@ -764,22 +765,22 @@ var U = {
|
|
|
764
765
|
return -1;
|
|
765
766
|
}
|
|
766
767
|
};
|
|
767
|
-
function
|
|
768
|
+
function Re(e, t, n, r, i) {
|
|
768
769
|
let { text: a } = e, o = e.char(i), s = i;
|
|
769
|
-
if (t.unshift(
|
|
770
|
-
let n = e.skipSpace(i + 1), r =
|
|
771
|
-
r && (n = e.skipSpace(r.to), n != r.to && (o =
|
|
770
|
+
if (t.unshift(P(v.LinkMark, r, r + (n == v.Image ? 2 : 1))), t.push(P(v.LinkMark, i - 1, i)), o == 40) {
|
|
771
|
+
let n = e.skipSpace(i + 1), r = ze(a, n - e.offset, e.offset), o;
|
|
772
|
+
r && (n = e.skipSpace(r.to), n != r.to && (o = Be(a, n - e.offset, e.offset), o && (n = e.skipSpace(o.to)))), e.char(n) == 41 && (t.push(P(v.LinkMark, i, i + 1)), s = n + 1, r && t.push(r), o && t.push(o), t.push(P(v.LinkMark, n, s)));
|
|
772
773
|
} else if (o == 91) {
|
|
773
|
-
let n =
|
|
774
|
+
let n = Ve(a, i - e.offset, e.offset, !1);
|
|
774
775
|
n && (t.push(n), s = n.to);
|
|
775
776
|
}
|
|
776
|
-
return
|
|
777
|
+
return P(n, r, s, t);
|
|
777
778
|
}
|
|
778
|
-
function
|
|
779
|
+
function ze(e, t, n) {
|
|
779
780
|
if (e.charCodeAt(t) == 60) {
|
|
780
781
|
for (let r = t + 1; r < e.length; r++) {
|
|
781
782
|
let i = e.charCodeAt(r);
|
|
782
|
-
if (i == 62) return
|
|
783
|
+
if (i == 62) return P(v.URL, t + n, r + 1 + n);
|
|
783
784
|
if (i == 60 || i == 10) return !1;
|
|
784
785
|
}
|
|
785
786
|
return null;
|
|
@@ -788,7 +789,7 @@ function Le(e, t, n) {
|
|
|
788
789
|
let r = 0, i = t;
|
|
789
790
|
for (let t = !1; i < e.length; i++) {
|
|
790
791
|
let n = e.charCodeAt(i);
|
|
791
|
-
if (
|
|
792
|
+
if (y(n)) break;
|
|
792
793
|
if (t) t = !1;
|
|
793
794
|
else if (n == 40) r++;
|
|
794
795
|
else if (n == 41) {
|
|
@@ -796,34 +797,34 @@ function Le(e, t, n) {
|
|
|
796
797
|
r--;
|
|
797
798
|
} else n == 92 && (t = !0);
|
|
798
799
|
}
|
|
799
|
-
return i > t ?
|
|
800
|
+
return i > t ? P(v.URL, t + n, i + n) : i == e.length && null;
|
|
800
801
|
}
|
|
801
802
|
}
|
|
802
|
-
function
|
|
803
|
+
function Be(e, t, n) {
|
|
803
804
|
let r = e.charCodeAt(t);
|
|
804
805
|
if (r != 39 && r != 34 && r != 40) return !1;
|
|
805
806
|
let i = r == 40 ? 41 : r;
|
|
806
807
|
for (let r = t + 1, a = !1; r < e.length; r++) {
|
|
807
808
|
let o = e.charCodeAt(r);
|
|
808
809
|
if (a) a = !1;
|
|
809
|
-
else if (o == i) return
|
|
810
|
+
else if (o == i) return P(v.LinkTitle, t + n, r + 1 + n);
|
|
810
811
|
else o == 92 && (a = !0);
|
|
811
812
|
}
|
|
812
813
|
return null;
|
|
813
814
|
}
|
|
814
|
-
function
|
|
815
|
+
function Ve(e, t, n, r) {
|
|
815
816
|
for (let i = !1, a = t + 1, o = Math.min(e.length, a + 999); a < o; a++) {
|
|
816
817
|
let o = e.charCodeAt(a);
|
|
817
818
|
if (i) i = !1;
|
|
818
|
-
else if (o == 93) return !r &&
|
|
819
|
+
else if (o == 93) return !r && P(v.LinkLabel, t + n, a + 1 + n);
|
|
819
820
|
else {
|
|
820
|
-
if (r && !
|
|
821
|
+
if (r && !y(o) && (r = !1), o == 91) return !1;
|
|
821
822
|
o == 92 && (i = !0);
|
|
822
823
|
}
|
|
823
824
|
}
|
|
824
825
|
return null;
|
|
825
826
|
}
|
|
826
|
-
var
|
|
827
|
+
var H = class {
|
|
827
828
|
constructor(e, t, n) {
|
|
828
829
|
this.parser = e, this.text = t, this.offset = n, this.parts = [];
|
|
829
830
|
}
|
|
@@ -840,12 +841,12 @@ var W = class {
|
|
|
840
841
|
return this.parts.push(e), e.to;
|
|
841
842
|
}
|
|
842
843
|
addDelimiter(e, t, n, r, i) {
|
|
843
|
-
return this.append(new
|
|
844
|
+
return this.append(new z(e, t, n, !!r | (i ? 2 : 0)));
|
|
844
845
|
}
|
|
845
846
|
get hasOpenLink() {
|
|
846
847
|
for (let e = this.parts.length - 1; e >= 0; e--) {
|
|
847
848
|
let t = this.parts[e];
|
|
848
|
-
if (t instanceof
|
|
849
|
+
if (t instanceof z && (t.type == L || t.type == R)) return !0;
|
|
849
850
|
}
|
|
850
851
|
return !1;
|
|
851
852
|
}
|
|
@@ -855,11 +856,11 @@ var W = class {
|
|
|
855
856
|
resolveMarkers(e) {
|
|
856
857
|
for (let t = e; t < this.parts.length; t++) {
|
|
857
858
|
let n = this.parts[t];
|
|
858
|
-
if (!(n instanceof
|
|
859
|
-
let r = n.type ==
|
|
859
|
+
if (!(n instanceof z && n.type.resolve && n.side & 2)) continue;
|
|
860
|
+
let r = n.type == F || n.type == I, i = n.to - n.from, a, o = t - 1;
|
|
860
861
|
for (; o >= e; o--) {
|
|
861
862
|
let e = this.parts[o];
|
|
862
|
-
if (e instanceof
|
|
863
|
+
if (e instanceof z && e.side & 1 && e.type == n.type && !(r && (n.side & 1 || e.side & 2) && (e.size + n.size) % 3 == 0 && (e.size % 3 || n.size % 3))) {
|
|
863
864
|
a = e;
|
|
864
865
|
break;
|
|
865
866
|
}
|
|
@@ -871,22 +872,22 @@ var W = class {
|
|
|
871
872
|
l = a.to - e, u = n.from + e, s = e == 1 ? "Emphasis" : "StrongEmphasis";
|
|
872
873
|
}
|
|
873
874
|
a.type.mark && c.push(this.elt(a.type.mark, l, a.to));
|
|
874
|
-
for (let e = o + 1; e < t; e++) this.parts[e] instanceof
|
|
875
|
+
for (let e = o + 1; e < t; e++) this.parts[e] instanceof N && c.push(this.parts[e]), this.parts[e] = null;
|
|
875
876
|
n.type.mark && c.push(this.elt(n.type.mark, n.from, u));
|
|
876
877
|
let d = this.elt(s, l, u, c);
|
|
877
|
-
this.parts[o] = r && a.from != l ? new
|
|
878
|
+
this.parts[o] = r && a.from != l ? new z(a.type, a.from, l, a.side, a.size) : null, (this.parts[t] = r && n.to != u ? new z(n.type, u, n.to, n.side, n.size) : null) ? this.parts.splice(t, 0, d) : this.parts[t] = d;
|
|
878
879
|
}
|
|
879
880
|
let t = [];
|
|
880
881
|
for (let n = e; n < this.parts.length; n++) {
|
|
881
882
|
let e = this.parts[n];
|
|
882
|
-
e instanceof
|
|
883
|
+
e instanceof N && t.push(e);
|
|
883
884
|
}
|
|
884
885
|
return t;
|
|
885
886
|
}
|
|
886
887
|
findOpeningDelimiter(e) {
|
|
887
888
|
for (let t = this.parts.length - 1; t >= 0; t--) {
|
|
888
889
|
let n = this.parts[t];
|
|
889
|
-
if (n instanceof
|
|
890
|
+
if (n instanceof z && n.type == e && n.side & 1) return t;
|
|
890
891
|
}
|
|
891
892
|
return null;
|
|
892
893
|
}
|
|
@@ -896,17 +897,17 @@ var W = class {
|
|
|
896
897
|
}
|
|
897
898
|
getDelimiterAt(e) {
|
|
898
899
|
let t = this.parts[e];
|
|
899
|
-
return t instanceof
|
|
900
|
+
return t instanceof z ? t : null;
|
|
900
901
|
}
|
|
901
902
|
skipSpace(e) {
|
|
902
|
-
return
|
|
903
|
+
return b(this.text, e - this.offset) + this.offset;
|
|
903
904
|
}
|
|
904
905
|
elt(e, t, n, r) {
|
|
905
|
-
return typeof e == "string" ?
|
|
906
|
+
return typeof e == "string" ? P(this.parser.getNodeType(e), t, n, r) : new Ie(e, t);
|
|
906
907
|
}
|
|
907
908
|
};
|
|
908
|
-
|
|
909
|
-
function
|
|
909
|
+
H.linkStart = L, H.imageStart = R, H.emphasisAsterisk = I, H.emphasisUnderscore = F;
|
|
910
|
+
function U(e, t) {
|
|
910
911
|
if (!t.length) return e;
|
|
911
912
|
if (!e.length) return t;
|
|
912
913
|
let n = e.slice(), r = 0;
|
|
@@ -914,17 +915,17 @@ function G(e, t) {
|
|
|
914
915
|
for (; r < n.length && n[r].to < e.to;) r++;
|
|
915
916
|
if (r < n.length && n[r].from < e.from) {
|
|
916
917
|
let t = n[r];
|
|
917
|
-
t instanceof
|
|
918
|
+
t instanceof N && (n[r] = new N(t.type, t.from, t.to, U(t.children, [e])));
|
|
918
919
|
} else n.splice(r++, 0, e);
|
|
919
920
|
}
|
|
920
921
|
return n;
|
|
921
922
|
}
|
|
922
|
-
var
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
],
|
|
923
|
+
var He = [
|
|
924
|
+
v.CodeBlock,
|
|
925
|
+
v.ListItem,
|
|
926
|
+
v.OrderedList,
|
|
927
|
+
v.BulletList
|
|
928
|
+
], Ue = class {
|
|
928
929
|
constructor(e, t) {
|
|
929
930
|
this.fragments = e, this.input = t, this.i = 0, this.fragment = null, this.fragmentEnd = -1, this.cursor = null, e.length && (this.fragment = e[this.i++]);
|
|
930
931
|
}
|
|
@@ -948,30 +949,30 @@ var Be = [
|
|
|
948
949
|
if (!n.childAfter(r)) return !1;
|
|
949
950
|
}
|
|
950
951
|
}
|
|
951
|
-
matches(
|
|
952
|
-
let
|
|
953
|
-
return
|
|
952
|
+
matches(e) {
|
|
953
|
+
let t = this.cursor.tree;
|
|
954
|
+
return t && t.prop(l.contextHash) == e;
|
|
954
955
|
}
|
|
955
956
|
takeNodes(e) {
|
|
956
|
-
let t = this.cursor, n = this.fragment.offset,
|
|
957
|
+
let t = this.cursor, n = this.fragment.offset, r = this.fragmentEnd - +!!this.fragment.openEnd, i = e.absoluteLineStart, a = i, o = e.block.children.length, s = a, c = o;
|
|
957
958
|
for (;;) {
|
|
958
|
-
if (t.to - n >
|
|
959
|
+
if (t.to - n > r || t.to - n > e.to) {
|
|
959
960
|
if (t.type.isAnonymous && t.firstChild()) continue;
|
|
960
961
|
break;
|
|
961
962
|
}
|
|
962
|
-
let
|
|
963
|
-
if (t.to - n <= e.ranges[e.rangeI].to) e.addNode(t.tree,
|
|
963
|
+
let i = We(t.from - n, e.ranges);
|
|
964
|
+
if (t.to - n <= e.ranges[e.rangeI].to) e.addNode(t.tree, i);
|
|
964
965
|
else {
|
|
965
|
-
let n = new
|
|
966
|
-
e.reusePlaceholders.set(n, t.tree), e.addNode(n,
|
|
966
|
+
let n = new h(e.parser.nodeSet.types[v.Paragraph], [], [], 0, e.block.hashProp);
|
|
967
|
+
e.reusePlaceholders.set(n, t.tree), e.addNode(n, i);
|
|
967
968
|
}
|
|
968
|
-
if (t.type.is("Block") && (
|
|
969
|
+
if (t.type.is("Block") && (He.indexOf(t.type.id) < 0 ? (a = t.to - n, o = e.block.children.length) : (a = s, o = c), s = t.to - n, c = e.block.children.length), !t.nextSibling()) break;
|
|
969
970
|
}
|
|
970
|
-
for (; e.block.children.length >
|
|
971
|
-
return
|
|
971
|
+
for (; e.block.children.length > o;) e.block.children.pop(), e.block.positions.pop();
|
|
972
|
+
return a - i;
|
|
972
973
|
}
|
|
973
974
|
};
|
|
974
|
-
function
|
|
975
|
+
function We(e, t) {
|
|
975
976
|
let n = e;
|
|
976
977
|
for (let r = 1; r < t.length; r++) {
|
|
977
978
|
let i = t[r - 1].to, a = t[r].from;
|
|
@@ -979,31 +980,31 @@ function He(e, t) {
|
|
|
979
980
|
}
|
|
980
981
|
return n;
|
|
981
982
|
}
|
|
982
|
-
var
|
|
983
|
-
"Blockquote/...":
|
|
984
|
-
HorizontalRule:
|
|
985
|
-
"ATXHeading1/... SetextHeading1/...":
|
|
986
|
-
"ATXHeading2/... SetextHeading2/...":
|
|
987
|
-
"ATXHeading3/...":
|
|
988
|
-
"ATXHeading4/...":
|
|
989
|
-
"ATXHeading5/...":
|
|
990
|
-
"ATXHeading6/...":
|
|
991
|
-
"Comment CommentBlock":
|
|
992
|
-
Escape:
|
|
993
|
-
Entity:
|
|
994
|
-
"Emphasis/...":
|
|
995
|
-
"StrongEmphasis/...":
|
|
996
|
-
"Link/... Image/...":
|
|
997
|
-
"OrderedList/... BulletList/...":
|
|
998
|
-
"BlockQuote/...":
|
|
999
|
-
"InlineCode CodeText":
|
|
1000
|
-
"URL Autolink":
|
|
1001
|
-
"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":
|
|
1002
|
-
"CodeInfo LinkLabel":
|
|
1003
|
-
LinkTitle:
|
|
1004
|
-
Paragraph:
|
|
1005
|
-
}),
|
|
1006
|
-
function
|
|
983
|
+
var Ge = d({
|
|
984
|
+
"Blockquote/...": f.quote,
|
|
985
|
+
HorizontalRule: f.contentSeparator,
|
|
986
|
+
"ATXHeading1/... SetextHeading1/...": f.heading1,
|
|
987
|
+
"ATXHeading2/... SetextHeading2/...": f.heading2,
|
|
988
|
+
"ATXHeading3/...": f.heading3,
|
|
989
|
+
"ATXHeading4/...": f.heading4,
|
|
990
|
+
"ATXHeading5/...": f.heading5,
|
|
991
|
+
"ATXHeading6/...": f.heading6,
|
|
992
|
+
"Comment CommentBlock": f.comment,
|
|
993
|
+
Escape: f.escape,
|
|
994
|
+
Entity: f.character,
|
|
995
|
+
"Emphasis/...": f.emphasis,
|
|
996
|
+
"StrongEmphasis/...": f.strong,
|
|
997
|
+
"Link/... Image/...": f.link,
|
|
998
|
+
"OrderedList/... BulletList/...": f.list,
|
|
999
|
+
"BlockQuote/...": f.quote,
|
|
1000
|
+
"InlineCode CodeText": f.monospace,
|
|
1001
|
+
"URL Autolink": f.url,
|
|
1002
|
+
"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark": f.processingInstruction,
|
|
1003
|
+
"CodeInfo LinkLabel": f.labelName,
|
|
1004
|
+
LinkTitle: f.string,
|
|
1005
|
+
Paragraph: f.content
|
|
1006
|
+
}), Ke = new Ne(new u(Pe).extend(Ge), Object.keys(D).map((e) => D[e]), Object.keys(D).map((e) => Oe[e]), Object.keys(D), ke, he, Object.keys(V).map((e) => V[e]), Object.keys(V), []);
|
|
1007
|
+
function qe(e, t, n) {
|
|
1007
1008
|
let r = [];
|
|
1008
1009
|
for (let i = e.firstChild, a = t;; i = i.nextSibling) {
|
|
1009
1010
|
let e = i ? i.from : n;
|
|
@@ -1015,51 +1016,51 @@ function Ge(e, t, n) {
|
|
|
1015
1016
|
}
|
|
1016
1017
|
return r;
|
|
1017
1018
|
}
|
|
1018
|
-
function
|
|
1019
|
+
function Je(e) {
|
|
1019
1020
|
let { codeParser: t, htmlParser: n } = e;
|
|
1020
|
-
return { wrap:
|
|
1021
|
+
return { wrap: c((e, r) => {
|
|
1021
1022
|
let i = e.type.id;
|
|
1022
|
-
if (t && (i ==
|
|
1023
|
+
if (t && (i == v.CodeBlock || i == v.FencedCode)) {
|
|
1023
1024
|
let n = "";
|
|
1024
|
-
if (i ==
|
|
1025
|
-
let t = e.node.getChild(
|
|
1025
|
+
if (i == v.FencedCode) {
|
|
1026
|
+
let t = e.node.getChild(v.CodeInfo);
|
|
1026
1027
|
t && (n = r.read(t.from, t.to));
|
|
1027
1028
|
}
|
|
1028
1029
|
let a = t(n);
|
|
1029
1030
|
if (a) return {
|
|
1030
1031
|
parser: a,
|
|
1031
|
-
overlay: (e) => e.type.id ==
|
|
1032
|
-
bracketed: i ==
|
|
1032
|
+
overlay: (e) => e.type.id == v.CodeText,
|
|
1033
|
+
bracketed: i == v.FencedCode
|
|
1033
1034
|
};
|
|
1034
|
-
} else if (n && (i ==
|
|
1035
|
+
} else if (n && (i == v.HTMLBlock || i == v.HTMLTag || i == v.CommentBlock)) return {
|
|
1035
1036
|
parser: n,
|
|
1036
|
-
overlay:
|
|
1037
|
+
overlay: qe(e.node, e.from, e.to)
|
|
1037
1038
|
};
|
|
1038
1039
|
return null;
|
|
1039
1040
|
}) };
|
|
1040
1041
|
}
|
|
1041
|
-
var
|
|
1042
|
+
var Ye = {
|
|
1042
1043
|
resolve: "Strikethrough",
|
|
1043
1044
|
mark: "StrikethroughMark"
|
|
1044
|
-
},
|
|
1045
|
+
}, Xe = {
|
|
1045
1046
|
defineNodes: [{
|
|
1046
1047
|
name: "Strikethrough",
|
|
1047
|
-
style: { "Strikethrough/...":
|
|
1048
|
+
style: { "Strikethrough/...": f.strikethrough }
|
|
1048
1049
|
}, {
|
|
1049
1050
|
name: "StrikethroughMark",
|
|
1050
|
-
style:
|
|
1051
|
+
style: f.processingInstruction
|
|
1051
1052
|
}],
|
|
1052
1053
|
parseInline: [{
|
|
1053
1054
|
name: "Strikethrough",
|
|
1054
1055
|
parse(e, t, n) {
|
|
1055
1056
|
if (t != 126 || e.char(n + 1) != 126 || e.char(n + 2) == 126) return -1;
|
|
1056
|
-
let r = e.slice(n - 1, n), i = e.slice(n + 2, n + 3), a = /\s|^$/.test(r), o = /\s|^$/.test(i), s =
|
|
1057
|
-
return e.addDelimiter(
|
|
1057
|
+
let r = e.slice(n - 1, n), i = e.slice(n + 2, n + 3), a = /\s|^$/.test(r), o = /\s|^$/.test(i), s = B.test(r), c = B.test(i);
|
|
1058
|
+
return e.addDelimiter(Ye, n, n + 2, !o && (!c || a || s), !a && (!s || o || c));
|
|
1058
1059
|
},
|
|
1059
1060
|
after: "Emphasis"
|
|
1060
1061
|
}]
|
|
1061
1062
|
};
|
|
1062
|
-
function
|
|
1063
|
+
function W(e, t, n = 0, r, i = 0) {
|
|
1063
1064
|
let a = 0, o = !0, s = -1, c = -1, l = !1, u = () => {
|
|
1064
1065
|
r.push(e.elt("TableCell", i + s, i + c, e.parser.parseInline(t.slice(s, c), i + s)));
|
|
1065
1066
|
};
|
|
@@ -1069,7 +1070,7 @@ function K(e, t, n = 0, r, i = 0) {
|
|
|
1069
1070
|
}
|
|
1070
1071
|
return s > -1 && (a++, r && u()), a;
|
|
1071
1072
|
}
|
|
1072
|
-
function
|
|
1073
|
+
function Ze(e, t) {
|
|
1073
1074
|
for (let n = t; n < e.length; n++) {
|
|
1074
1075
|
let t = e.charCodeAt(n);
|
|
1075
1076
|
if (t == 124) return !0;
|
|
@@ -1077,7 +1078,7 @@ function Ye(e, t) {
|
|
|
1077
1078
|
}
|
|
1078
1079
|
return !1;
|
|
1079
1080
|
}
|
|
1080
|
-
var
|
|
1081
|
+
var Qe = /^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/, $e = class {
|
|
1081
1082
|
constructor() {
|
|
1082
1083
|
this.rows = null;
|
|
1083
1084
|
}
|
|
@@ -1085,20 +1086,20 @@ var Xe = /^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/, Ze = class {
|
|
|
1085
1086
|
if (this.rows == null) {
|
|
1086
1087
|
this.rows = !1;
|
|
1087
1088
|
let r;
|
|
1088
|
-
if ((t.next == 45 || t.next == 58 || t.next == 124) &&
|
|
1089
|
+
if ((t.next == 45 || t.next == 58 || t.next == 124) && Qe.test(r = t.text.slice(t.pos))) {
|
|
1089
1090
|
let i = [];
|
|
1090
|
-
|
|
1091
|
+
W(e, n.content, 0, i, n.start) == W(e, r, 0) && (this.rows = [e.elt("TableHeader", n.start, n.start + n.content.length, i), e.elt("TableDelimiter", e.lineStart + t.pos, e.lineStart + t.text.length)]);
|
|
1091
1092
|
}
|
|
1092
1093
|
} else if (this.rows) {
|
|
1093
1094
|
let n = [];
|
|
1094
|
-
|
|
1095
|
+
W(e, t.text, t.pos, n, e.lineStart), this.rows.push(e.elt("TableRow", e.lineStart + t.pos, e.lineStart + t.text.length, n));
|
|
1095
1096
|
}
|
|
1096
1097
|
return !1;
|
|
1097
1098
|
}
|
|
1098
1099
|
finish(e, t) {
|
|
1099
1100
|
return this.rows ? (e.addLeafElement(t, e.elt("Table", t.start, t.start + t.content.length, this.rows)), !0) : !1;
|
|
1100
1101
|
}
|
|
1101
|
-
},
|
|
1102
|
+
}, et = {
|
|
1102
1103
|
defineNodes: [
|
|
1103
1104
|
{
|
|
1104
1105
|
name: "Table",
|
|
@@ -1106,134 +1107,134 @@ var Xe = /^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/, Ze = class {
|
|
|
1106
1107
|
},
|
|
1107
1108
|
{
|
|
1108
1109
|
name: "TableHeader",
|
|
1109
|
-
style: { "TableHeader/...":
|
|
1110
|
+
style: { "TableHeader/...": f.heading }
|
|
1110
1111
|
},
|
|
1111
1112
|
"TableRow",
|
|
1112
1113
|
{
|
|
1113
1114
|
name: "TableCell",
|
|
1114
|
-
style:
|
|
1115
|
+
style: f.content
|
|
1115
1116
|
},
|
|
1116
1117
|
{
|
|
1117
1118
|
name: "TableDelimiter",
|
|
1118
|
-
style:
|
|
1119
|
+
style: f.processingInstruction
|
|
1119
1120
|
}
|
|
1120
1121
|
],
|
|
1121
1122
|
parseBlock: [{
|
|
1122
1123
|
name: "Table",
|
|
1123
1124
|
leaf(e, t) {
|
|
1124
|
-
return
|
|
1125
|
+
return Ze(t.content, 0) ? new $e() : null;
|
|
1125
1126
|
},
|
|
1126
1127
|
endLeaf(e, t, n) {
|
|
1127
|
-
if (n.parsers.some((e) => e instanceof
|
|
1128
|
+
if (n.parsers.some((e) => e instanceof $e) || !Ze(t.text, t.basePos)) return !1;
|
|
1128
1129
|
let r = e.peekLine();
|
|
1129
|
-
return
|
|
1130
|
+
return Qe.test(r) && W(e, t.text, t.basePos) == W(e, r, t.basePos);
|
|
1130
1131
|
},
|
|
1131
1132
|
before: "SetextHeading"
|
|
1132
1133
|
}]
|
|
1133
|
-
},
|
|
1134
|
+
}, tt = class {
|
|
1134
1135
|
nextLine() {
|
|
1135
1136
|
return !1;
|
|
1136
1137
|
}
|
|
1137
1138
|
finish(e, t) {
|
|
1138
1139
|
return e.addLeafElement(t, e.elt("Task", t.start, t.start + t.content.length, [e.elt("TaskMarker", t.start, t.start + 3), ...e.parser.parseInline(t.content.slice(3), t.start + 3)])), !0;
|
|
1139
1140
|
}
|
|
1140
|
-
},
|
|
1141
|
+
}, nt = {
|
|
1141
1142
|
defineNodes: [{
|
|
1142
1143
|
name: "Task",
|
|
1143
1144
|
block: !0,
|
|
1144
|
-
style:
|
|
1145
|
+
style: f.list
|
|
1145
1146
|
}, {
|
|
1146
1147
|
name: "TaskMarker",
|
|
1147
|
-
style:
|
|
1148
|
+
style: f.atom
|
|
1148
1149
|
}],
|
|
1149
1150
|
parseBlock: [{
|
|
1150
1151
|
name: "TaskList",
|
|
1151
1152
|
leaf(e, t) {
|
|
1152
|
-
return /^\[[ xX]\][ \t]/.test(t.content) && e.parentType().name == "ListItem" ? new
|
|
1153
|
+
return /^\[[ xX]\][ \t]/.test(t.content) && e.parentType().name == "ListItem" ? new tt() : null;
|
|
1153
1154
|
},
|
|
1154
1155
|
after: "SetextHeading"
|
|
1155
1156
|
}]
|
|
1156
|
-
},
|
|
1157
|
-
function
|
|
1157
|
+
}, rt = /(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy, it = /[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy, at = /[\w-]+\.[\w-]+($|[/:])/, ot = /[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy, st = /\/[a-zA-Z\d@.]+/gy;
|
|
1158
|
+
function ct(e, t, n, r) {
|
|
1158
1159
|
let i = 0;
|
|
1159
1160
|
for (let a = t; a < n; a++) e[a] == r && i++;
|
|
1160
1161
|
return i;
|
|
1161
1162
|
}
|
|
1162
|
-
function
|
|
1163
|
-
|
|
1164
|
-
let n =
|
|
1165
|
-
if (!n ||
|
|
1163
|
+
function lt(e, t) {
|
|
1164
|
+
it.lastIndex = t;
|
|
1165
|
+
let n = it.exec(e);
|
|
1166
|
+
if (!n || at.exec(n[0])[0].indexOf("_") > -1) return -1;
|
|
1166
1167
|
let r = t + n[0].length;
|
|
1167
1168
|
for (;;) {
|
|
1168
1169
|
let n = e[r - 1], i;
|
|
1169
|
-
if (/[?!.,:*_~]/.test(n) || n == ")" &&
|
|
1170
|
+
if (/[?!.,:*_~]/.test(n) || n == ")" && ct(e, t, r, ")") > ct(e, t, r, "(")) r--;
|
|
1170
1171
|
else if (n == ";" && (i = /&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t, r)))) r = t + i.index;
|
|
1171
1172
|
else break;
|
|
1172
1173
|
}
|
|
1173
1174
|
return r;
|
|
1174
1175
|
}
|
|
1175
|
-
function
|
|
1176
|
-
|
|
1177
|
-
let n =
|
|
1176
|
+
function ut(e, t) {
|
|
1177
|
+
ot.lastIndex = t;
|
|
1178
|
+
let n = ot.exec(e);
|
|
1178
1179
|
if (!n) return -1;
|
|
1179
1180
|
let r = n[0][n[0].length - 1];
|
|
1180
1181
|
return r == "_" || r == "-" ? -1 : t + n[0].length - +(r == ".");
|
|
1181
1182
|
}
|
|
1182
|
-
var
|
|
1183
|
-
Qe,
|
|
1183
|
+
var dt = [
|
|
1184
1184
|
et,
|
|
1185
|
-
|
|
1185
|
+
nt,
|
|
1186
|
+
Xe,
|
|
1186
1187
|
{ parseInline: [{
|
|
1187
1188
|
name: "Autolink",
|
|
1188
1189
|
parse(e, t, n) {
|
|
1189
1190
|
let r = n - e.offset;
|
|
1190
1191
|
if (r && /\w/.test(e.text[r - 1])) return -1;
|
|
1191
|
-
|
|
1192
|
-
let i =
|
|
1193
|
-
return !i || (i[1] || i[2] ? (a =
|
|
1192
|
+
rt.lastIndex = r;
|
|
1193
|
+
let i = rt.exec(e.text), a = -1;
|
|
1194
|
+
return !i || (i[1] || i[2] ? (a = lt(e.text, r + i[0].length), a > -1 && e.hasOpenLink && (a = r + /([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r, a))[0].length)) : i[3] ? a = ut(e.text, r) : (a = ut(e.text, r + i[0].length), a > -1 && i[0] == "xmpp:" && (st.lastIndex = a, i = st.exec(e.text), i && (a = i.index + i[0].length))), a < 0) ? -1 : (e.addElement(e.elt("URL", n, a + e.offset)), a + e.offset);
|
|
1194
1195
|
}
|
|
1195
1196
|
}] }
|
|
1196
1197
|
];
|
|
1197
|
-
function
|
|
1198
|
+
function ft(e, t, n) {
|
|
1198
1199
|
return (r, i, a) => {
|
|
1199
1200
|
if (i != e || r.char(a + 1) == e) return -1;
|
|
1200
1201
|
let o = [r.elt(n, a, a + 1)];
|
|
1201
1202
|
for (let i = a + 1; i < r.end; i++) {
|
|
1202
1203
|
let s = r.char(i);
|
|
1203
1204
|
if (s == e) return r.addElement(r.elt(t, a, i + 1, o.concat(r.elt(n, i, i + 1))));
|
|
1204
|
-
if (s == 92 && o.push(r.elt("Escape", i, i++ + 2)),
|
|
1205
|
+
if (s == 92 && o.push(r.elt("Escape", i, i++ + 2)), y(s)) break;
|
|
1205
1206
|
}
|
|
1206
1207
|
return -1;
|
|
1207
1208
|
};
|
|
1208
1209
|
}
|
|
1209
|
-
var
|
|
1210
|
+
var pt = {
|
|
1210
1211
|
defineNodes: [{
|
|
1211
1212
|
name: "Superscript",
|
|
1212
|
-
style:
|
|
1213
|
+
style: f.special(f.content)
|
|
1213
1214
|
}, {
|
|
1214
1215
|
name: "SuperscriptMark",
|
|
1215
|
-
style:
|
|
1216
|
+
style: f.processingInstruction
|
|
1216
1217
|
}],
|
|
1217
1218
|
parseInline: [{
|
|
1218
1219
|
name: "Superscript",
|
|
1219
|
-
parse:
|
|
1220
|
+
parse: ft(94, "Superscript", "SuperscriptMark")
|
|
1220
1221
|
}]
|
|
1221
|
-
},
|
|
1222
|
+
}, mt = {
|
|
1222
1223
|
defineNodes: [{
|
|
1223
1224
|
name: "Subscript",
|
|
1224
|
-
style:
|
|
1225
|
+
style: f.special(f.content)
|
|
1225
1226
|
}, {
|
|
1226
1227
|
name: "SubscriptMark",
|
|
1227
|
-
style:
|
|
1228
|
+
style: f.processingInstruction
|
|
1228
1229
|
}],
|
|
1229
1230
|
parseInline: [{
|
|
1230
1231
|
name: "Subscript",
|
|
1231
|
-
parse:
|
|
1232
|
+
parse: ft(126, "Subscript", "SubscriptMark")
|
|
1232
1233
|
}]
|
|
1233
|
-
},
|
|
1234
|
+
}, ht = {
|
|
1234
1235
|
defineNodes: [{
|
|
1235
1236
|
name: "Emoji",
|
|
1236
|
-
style:
|
|
1237
|
+
style: f.character
|
|
1237
1238
|
}],
|
|
1238
1239
|
parseInline: [{
|
|
1239
1240
|
name: "Emoji",
|
|
@@ -1242,39 +1243,39 @@ var dt = {
|
|
|
1242
1243
|
return t != 58 || !(r = /^[a-zA-Z_0-9]+:/.exec(e.slice(n + 1, e.end))) ? -1 : e.addElement(e.elt("Emoji", n, n + 1 + r[0].length));
|
|
1243
1244
|
}
|
|
1244
1245
|
}]
|
|
1245
|
-
},
|
|
1246
|
+
}, gt = /*@__PURE__*/ te({ commentTokens: { block: {
|
|
1246
1247
|
open: "<!--",
|
|
1247
1248
|
close: "-->"
|
|
1248
|
-
} } }),
|
|
1249
|
-
/*@__PURE__*/
|
|
1249
|
+
} } }), _t = /*@__PURE__*/ new l(), vt = /*@__PURE__*/ Ke.configure({ props: [
|
|
1250
|
+
/*@__PURE__*/ g.add((e) => !e.is("Block") || e.is("Document") || G(e) != null || yt(e) ? void 0 : (e, t) => ({
|
|
1250
1251
|
from: t.doc.lineAt(e.from).to,
|
|
1251
1252
|
to: e.to
|
|
1252
1253
|
})),
|
|
1253
|
-
/*@__PURE__*/
|
|
1254
|
+
/*@__PURE__*/ _t.add(G),
|
|
1254
1255
|
/*@__PURE__*/ se.add({ Document: () => null }),
|
|
1255
|
-
/*@__PURE__*/
|
|
1256
|
+
/*@__PURE__*/ m.add({ Document: gt })
|
|
1256
1257
|
] });
|
|
1257
|
-
function
|
|
1258
|
+
function G(e) {
|
|
1258
1259
|
let t = /^(?:ATX|Setext)Heading(\d)$/.exec(e.name);
|
|
1259
1260
|
return t ? +t[1] : void 0;
|
|
1260
1261
|
}
|
|
1261
|
-
function
|
|
1262
|
+
function yt(e) {
|
|
1262
1263
|
return e.name == "OrderedList" || e.name == "BulletList";
|
|
1263
1264
|
}
|
|
1264
|
-
function
|
|
1265
|
+
function bt(e, t) {
|
|
1265
1266
|
let n = e;
|
|
1266
1267
|
for (;;) {
|
|
1267
1268
|
let e = n.nextSibling, r;
|
|
1268
|
-
if (!e || (r =
|
|
1269
|
+
if (!e || (r = G(e.type)) != null && r <= t) break;
|
|
1269
1270
|
n = e;
|
|
1270
1271
|
}
|
|
1271
1272
|
return n.to;
|
|
1272
1273
|
}
|
|
1273
|
-
var
|
|
1274
|
-
for (let r =
|
|
1275
|
-
let e = r.type.prop(
|
|
1274
|
+
var xt = /*@__PURE__*/ ae.of((e, t, n) => {
|
|
1275
|
+
for (let r = _(e).resolveInner(n, -1); r && !(r.from < t); r = r.parent) {
|
|
1276
|
+
let e = r.type.prop(_t);
|
|
1276
1277
|
if (e == null) continue;
|
|
1277
|
-
let t =
|
|
1278
|
+
let t = bt(r, e);
|
|
1278
1279
|
if (t > n) return {
|
|
1279
1280
|
from: n,
|
|
1280
1281
|
to: t
|
|
@@ -1282,30 +1283,30 @@ var yt = /*@__PURE__*/ ie.of((e, t, n) => {
|
|
|
1282
1283
|
}
|
|
1283
1284
|
return null;
|
|
1284
1285
|
});
|
|
1285
|
-
function
|
|
1286
|
-
return new
|
|
1286
|
+
function K(e) {
|
|
1287
|
+
return new ie(gt, e, [], "markdown");
|
|
1287
1288
|
}
|
|
1288
|
-
var
|
|
1289
|
-
lt,
|
|
1290
|
-
ft,
|
|
1289
|
+
var St = /*@__PURE__*/ K(vt), q = /*@__PURE__*/ K(/* @__PURE__ */ vt.configure([
|
|
1291
1290
|
dt,
|
|
1291
|
+
mt,
|
|
1292
1292
|
pt,
|
|
1293
|
-
|
|
1293
|
+
ht,
|
|
1294
|
+
{ props: [/*@__PURE__*/ g.add({ Table: (e, t) => ({
|
|
1294
1295
|
from: t.doc.lineAt(e.from).to,
|
|
1295
1296
|
to: e.to
|
|
1296
1297
|
}) })] }
|
|
1297
1298
|
]));
|
|
1298
|
-
function
|
|
1299
|
+
function Ct(e, t) {
|
|
1299
1300
|
return (n) => {
|
|
1300
1301
|
if (n && e) {
|
|
1301
1302
|
let t = null;
|
|
1302
|
-
if (n = /\S*/.exec(n)[0], t = typeof e == "function" ? e(n) :
|
|
1303
|
+
if (n = /\S*/.exec(n)[0], t = typeof e == "function" ? e(n) : ne.matchLanguageName(e, n, !0), t instanceof ne) return t.support ? t.support.language.parser : re.getSkippingParser(t.load());
|
|
1303
1304
|
if (t) return t.parser;
|
|
1304
1305
|
}
|
|
1305
1306
|
return t ? t.parser : null;
|
|
1306
1307
|
};
|
|
1307
1308
|
}
|
|
1308
|
-
var
|
|
1309
|
+
var J = class {
|
|
1309
1310
|
constructor(e, t, n, r, i, a, o) {
|
|
1310
1311
|
this.node = e, this.from = t, this.to = n, this.spaceBefore = r, this.spaceAfter = i, this.type = a, this.item = o;
|
|
1311
1312
|
}
|
|
@@ -1319,11 +1320,11 @@ var X = class {
|
|
|
1319
1320
|
return n + (t ? this.spaceAfter : "");
|
|
1320
1321
|
}
|
|
1321
1322
|
marker(e, t) {
|
|
1322
|
-
let n = this.node.name == "OrderedList" ? String(+
|
|
1323
|
+
let n = this.node.name == "OrderedList" ? String(+wt(this.item, e)[2] + t) : "";
|
|
1323
1324
|
return this.spaceBefore + n + this.type + this.spaceAfter;
|
|
1324
1325
|
}
|
|
1325
1326
|
};
|
|
1326
|
-
function
|
|
1327
|
+
function Y(e, t) {
|
|
1327
1328
|
let n = [], r = [];
|
|
1328
1329
|
for (let t = e; t; t = t.parent) {
|
|
1329
1330
|
if (t.name == "FencedCode") return r;
|
|
@@ -1331,26 +1332,26 @@ function St(e, t) {
|
|
|
1331
1332
|
}
|
|
1332
1333
|
for (let e = n.length - 1; e >= 0; e--) {
|
|
1333
1334
|
let i = n[e], a, o = t.lineAt(i.from), s = i.from - o.from;
|
|
1334
|
-
if (i.name == "Blockquote" && (a = /^ *>( ?)/.exec(o.text.slice(s)))) r.push(new
|
|
1335
|
+
if (i.name == "Blockquote" && (a = /^ *>( ?)/.exec(o.text.slice(s)))) r.push(new J(i, s, s + a[0].length, "", a[1], ">", null));
|
|
1335
1336
|
else if (i.name == "ListItem" && i.parent.name == "OrderedList" && (a = /^( *)\d+([.)])( *)/.exec(o.text.slice(s)))) {
|
|
1336
1337
|
let e = a[3], t = a[0].length;
|
|
1337
|
-
e.length >= 4 && (e = e.slice(0, e.length - 4), t -= 4), r.push(new
|
|
1338
|
+
e.length >= 4 && (e = e.slice(0, e.length - 4), t -= 4), r.push(new J(i.parent, s, s + t, a[1], e, a[2], i));
|
|
1338
1339
|
} else if (i.name == "ListItem" && i.parent.name == "BulletList" && (a = /^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))) {
|
|
1339
1340
|
let e = a[4], t = a[0].length;
|
|
1340
1341
|
e.length > 4 && (e = e.slice(0, e.length - 4), t -= 4);
|
|
1341
1342
|
let n = a[2];
|
|
1342
|
-
a[3] && (n += a[3].replace(/[xX]/, " ")), r.push(new
|
|
1343
|
+
a[3] && (n += a[3].replace(/[xX]/, " ")), r.push(new J(i.parent, s, s + t, a[1], e, n, i));
|
|
1343
1344
|
}
|
|
1344
1345
|
}
|
|
1345
1346
|
return r;
|
|
1346
1347
|
}
|
|
1347
|
-
function
|
|
1348
|
+
function wt(e, t) {
|
|
1348
1349
|
return /^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from, e.from + 10));
|
|
1349
1350
|
}
|
|
1350
|
-
function
|
|
1351
|
+
function X(e, t, n, r = 0) {
|
|
1351
1352
|
for (let i = -1, a = e;;) {
|
|
1352
1353
|
if (a.name == "ListItem") {
|
|
1353
|
-
let e =
|
|
1354
|
+
let e = wt(a, t), o = +e[2];
|
|
1354
1355
|
if (i >= 0) {
|
|
1355
1356
|
if (o != i + 1) return;
|
|
1356
1357
|
n.push({
|
|
@@ -1366,175 +1367,175 @@ function Z(e, t, n, r = 0) {
|
|
|
1366
1367
|
a = e;
|
|
1367
1368
|
}
|
|
1368
1369
|
}
|
|
1369
|
-
function
|
|
1370
|
+
function Z(e, t) {
|
|
1370
1371
|
let n = /^[ \t]*/.exec(e)[0].length;
|
|
1371
|
-
if (!n || t.facet(
|
|
1372
|
-
let
|
|
1373
|
-
for (let e =
|
|
1374
|
-
return
|
|
1372
|
+
if (!n || t.facet(oe) != " ") return e;
|
|
1373
|
+
let i = r(e, 4, n), a = "";
|
|
1374
|
+
for (let e = i; e > 0;) e >= 4 ? (a += " ", e -= 4) : (a += " ", e--);
|
|
1375
|
+
return a + e.slice(n);
|
|
1375
1376
|
}
|
|
1376
|
-
var
|
|
1377
|
-
let
|
|
1378
|
-
if (!
|
|
1379
|
-
let
|
|
1380
|
-
for (;
|
|
1381
|
-
if (!
|
|
1382
|
-
let
|
|
1383
|
-
if (
|
|
1384
|
-
let
|
|
1385
|
-
if (
|
|
1386
|
-
if (
|
|
1387
|
-
let r =
|
|
1388
|
-
if (r.to >=
|
|
1389
|
-
let e =
|
|
1390
|
-
e && e.item ? (t =
|
|
1391
|
-
let
|
|
1377
|
+
var Tt = /*@__PURE__*/ ((e = {}) => ({ state: t, dispatch: i }) => {
|
|
1378
|
+
let a = _(t), { doc: o } = t, s = null, c = t.changeByRange((i) => {
|
|
1379
|
+
if (!i.empty || !q.isActiveAt(t, i.from, -1) && !q.isActiveAt(t, i.from, 1)) return s = { range: i };
|
|
1380
|
+
let c = i.from, l = o.lineAt(c), u = Y(a.resolveInner(c, -1), o);
|
|
1381
|
+
for (; u.length && u[u.length - 1].from > c - l.from;) u.pop();
|
|
1382
|
+
if (!u.length) return s = { range: i };
|
|
1383
|
+
let d = u[u.length - 1];
|
|
1384
|
+
if (d.to - d.spaceAfter.length > c - l.from) return s = { range: i };
|
|
1385
|
+
let f = c >= d.to - d.spaceAfter.length && !/\S/.test(l.text.slice(d.to));
|
|
1386
|
+
if (d.item && f) {
|
|
1387
|
+
if (d.item.from < l.from && !/^[\s>]*$/.test(l.text.slice(0, d.to))) return s = { range: i };
|
|
1388
|
+
let r = d.node.firstChild, a = d.node.getChild("ListItem", "ListItem");
|
|
1389
|
+
if (r.to >= c || a && a.to < c || l.from > 0 && !/[^\s>]/.test(o.lineAt(l.from - 1).text) || e.nonTightLists === !1) {
|
|
1390
|
+
let e = u.length > 1 ? u[u.length - 2] : null, t, r = "";
|
|
1391
|
+
e && e.item ? (t = l.from + e.from, r = e.marker(o, 1)) : t = l.from + (e ? e.to : 0);
|
|
1392
|
+
let i = [{
|
|
1392
1393
|
from: t,
|
|
1393
|
-
to:
|
|
1394
|
-
insert:
|
|
1394
|
+
to: c,
|
|
1395
|
+
insert: r
|
|
1395
1396
|
}];
|
|
1396
|
-
return
|
|
1397
|
-
range:
|
|
1398
|
-
changes:
|
|
1397
|
+
return d.node.name == "OrderedList" && X(d.item, o, i, -2), e && e.node.name == "OrderedList" && X(e.item, o, i), {
|
|
1398
|
+
range: n.cursor(t + r.length),
|
|
1399
|
+
changes: i
|
|
1399
1400
|
};
|
|
1400
1401
|
}
|
|
1401
1402
|
{
|
|
1402
|
-
let e =
|
|
1403
|
+
let e = Ot(u, t, l);
|
|
1403
1404
|
return {
|
|
1404
|
-
range:
|
|
1405
|
+
range: n.cursor(c + e.length + 1),
|
|
1405
1406
|
changes: {
|
|
1406
|
-
from:
|
|
1407
|
+
from: l.from,
|
|
1407
1408
|
insert: e + t.lineBreak
|
|
1408
1409
|
}
|
|
1409
1410
|
};
|
|
1410
1411
|
}
|
|
1411
1412
|
}
|
|
1412
|
-
if (
|
|
1413
|
-
let e =
|
|
1414
|
-
if (
|
|
1415
|
-
let
|
|
1416
|
-
from: e.from +
|
|
1413
|
+
if (d.node.name == "Blockquote" && f && l.from) {
|
|
1414
|
+
let e = o.lineAt(l.from - 1), n = />\s*$/.exec(e.text);
|
|
1415
|
+
if (n && n.index == d.from) {
|
|
1416
|
+
let r = t.changes([{
|
|
1417
|
+
from: e.from + n.index,
|
|
1417
1418
|
to: e.to
|
|
1418
1419
|
}, {
|
|
1419
|
-
from:
|
|
1420
|
-
to:
|
|
1420
|
+
from: l.from + d.from,
|
|
1421
|
+
to: l.to
|
|
1421
1422
|
}]);
|
|
1422
1423
|
return {
|
|
1423
|
-
range:
|
|
1424
|
-
changes:
|
|
1424
|
+
range: i.map(r),
|
|
1425
|
+
changes: r
|
|
1425
1426
|
};
|
|
1426
1427
|
}
|
|
1427
1428
|
}
|
|
1428
|
-
let
|
|
1429
|
-
|
|
1430
|
-
let
|
|
1431
|
-
if (!
|
|
1432
|
-
let
|
|
1433
|
-
for (;
|
|
1434
|
-
return
|
|
1435
|
-
from:
|
|
1436
|
-
to:
|
|
1437
|
-
insert: t.lineBreak +
|
|
1429
|
+
let p = [];
|
|
1430
|
+
d.node.name == "OrderedList" && X(d.item, o, p);
|
|
1431
|
+
let m = d.item && d.item.from < l.from, h = "";
|
|
1432
|
+
if (!m || /^[\s\d.)\-+*>]*/.exec(l.text)[0].length >= d.to) for (let e = 0, t = u.length - 1; e <= t; e++) h += e == t && !m ? u[e].marker(o, 1) : u[e].blank(e < t ? r(l.text, 4, u[e + 1].from) - h.length : null);
|
|
1433
|
+
let g = c;
|
|
1434
|
+
for (; g > l.from && /\s/.test(l.text.charAt(g - l.from - 1));) g--;
|
|
1435
|
+
return h = Z(h, t), Dt(d.node, t.doc) && (h = Ot(u, t, l) + t.lineBreak + h), p.push({
|
|
1436
|
+
from: g,
|
|
1437
|
+
to: c,
|
|
1438
|
+
insert: t.lineBreak + h
|
|
1438
1439
|
}), {
|
|
1439
|
-
range:
|
|
1440
|
-
changes:
|
|
1440
|
+
range: n.cursor(g + h.length + 1),
|
|
1441
|
+
changes: p
|
|
1441
1442
|
};
|
|
1442
1443
|
});
|
|
1443
|
-
return !
|
|
1444
|
+
return !s && (i(t.update(c, {
|
|
1444
1445
|
scrollIntoView: !0,
|
|
1445
1446
|
userEvent: "input"
|
|
1446
1447
|
})), !0);
|
|
1447
1448
|
})();
|
|
1448
|
-
function
|
|
1449
|
+
function Et(e) {
|
|
1449
1450
|
return e.name == "QuoteMark" || e.name == "ListMark";
|
|
1450
1451
|
}
|
|
1451
|
-
function
|
|
1452
|
+
function Dt(e, t) {
|
|
1452
1453
|
if (e.name != "OrderedList" && e.name != "BulletList") return !1;
|
|
1453
1454
|
let n = e.firstChild, r = e.getChild("ListItem", "ListItem");
|
|
1454
1455
|
if (!r) return !1;
|
|
1455
1456
|
let i = t.lineAt(n.to), a = t.lineAt(r.from), o = /^[\s>]*$/.test(i.text);
|
|
1456
1457
|
return i.number + +!o < a.number;
|
|
1457
1458
|
}
|
|
1458
|
-
function
|
|
1459
|
-
let
|
|
1460
|
-
for (let t = 0,
|
|
1461
|
-
return
|
|
1459
|
+
function Ot(e, t, n) {
|
|
1460
|
+
let i = "";
|
|
1461
|
+
for (let t = 0, a = e.length - 2; t <= a; t++) i += e[t].blank(t < a ? r(n.text, 4, e[t + 1].from) - i.length : null, t < a);
|
|
1462
|
+
return Z(i, t);
|
|
1462
1463
|
}
|
|
1463
|
-
function
|
|
1464
|
+
function kt(e, t) {
|
|
1464
1465
|
let n = e.resolveInner(t, -1), r = t;
|
|
1465
|
-
|
|
1466
|
-
for (let e; e = n.childBefore(r);) if (
|
|
1466
|
+
Et(n) && (r = n.from, n = n.parent);
|
|
1467
|
+
for (let e; e = n.childBefore(r);) if (Et(e)) r = e.from;
|
|
1467
1468
|
else if (e.name == "OrderedList" || e.name == "BulletList") n = e.lastChild, r = n.to;
|
|
1468
1469
|
else break;
|
|
1469
1470
|
return n;
|
|
1470
1471
|
}
|
|
1471
|
-
var
|
|
1472
|
+
var At = [{
|
|
1472
1473
|
key: "Enter",
|
|
1473
|
-
run:
|
|
1474
|
+
run: Tt
|
|
1474
1475
|
}, {
|
|
1475
1476
|
key: "Backspace",
|
|
1476
1477
|
run: ({ state: e, dispatch: t }) => {
|
|
1477
|
-
let
|
|
1478
|
-
let
|
|
1479
|
-
if (t.empty &&
|
|
1480
|
-
let t =
|
|
1481
|
-
if (
|
|
1482
|
-
let
|
|
1483
|
-
if (
|
|
1484
|
-
range:
|
|
1478
|
+
let i = _(e), a = null, o = e.changeByRange((t) => {
|
|
1479
|
+
let o = t.from, { doc: s } = e;
|
|
1480
|
+
if (t.empty && q.isActiveAt(e, t.from)) {
|
|
1481
|
+
let t = s.lineAt(o), a = Y(kt(i, o), s);
|
|
1482
|
+
if (a.length) {
|
|
1483
|
+
let i = a[a.length - 1], s = i.to - i.spaceAfter.length + +!!i.spaceAfter;
|
|
1484
|
+
if (o - t.from > s && !/\S/.test(t.text.slice(s, o - t.from))) return {
|
|
1485
|
+
range: n.cursor(t.from + s),
|
|
1485
1486
|
changes: {
|
|
1486
|
-
from: t.from +
|
|
1487
|
-
to:
|
|
1487
|
+
from: t.from + s,
|
|
1488
|
+
to: o
|
|
1488
1489
|
}
|
|
1489
1490
|
};
|
|
1490
|
-
if (
|
|
1491
|
-
let
|
|
1492
|
-
if (
|
|
1493
|
-
let
|
|
1494
|
-
return
|
|
1495
|
-
range:
|
|
1491
|
+
if (o - t.from == s && (i.item && t.from <= i.item.from || /^[\s>]*$/.test(t.text.slice(0, i.to)))) {
|
|
1492
|
+
let a = t.from + i.from;
|
|
1493
|
+
if (i.item && i.node.from < i.item.from && /\S/.test(t.text.slice(i.from, i.to))) {
|
|
1494
|
+
let o = i.blank(r(t.text, 4, i.to) - r(t.text, 4, i.from));
|
|
1495
|
+
return a == t.from && (o = Z(o, e)), {
|
|
1496
|
+
range: n.cursor(a + o.length),
|
|
1496
1497
|
changes: {
|
|
1497
|
-
from:
|
|
1498
|
-
to: t.from +
|
|
1499
|
-
insert:
|
|
1498
|
+
from: a,
|
|
1499
|
+
to: t.from + i.to,
|
|
1500
|
+
insert: o
|
|
1500
1501
|
}
|
|
1501
1502
|
};
|
|
1502
1503
|
}
|
|
1503
|
-
if (
|
|
1504
|
-
range:
|
|
1504
|
+
if (a < o) return {
|
|
1505
|
+
range: n.cursor(a),
|
|
1505
1506
|
changes: {
|
|
1506
|
-
from:
|
|
1507
|
-
to:
|
|
1507
|
+
from: a,
|
|
1508
|
+
to: o
|
|
1508
1509
|
}
|
|
1509
1510
|
};
|
|
1510
1511
|
}
|
|
1511
1512
|
}
|
|
1512
1513
|
}
|
|
1513
|
-
return
|
|
1514
|
+
return a = { range: t };
|
|
1514
1515
|
});
|
|
1515
|
-
return !
|
|
1516
|
+
return !a && (t(e.update(o, {
|
|
1516
1517
|
scrollIntoView: !0,
|
|
1517
1518
|
userEvent: "delete"
|
|
1518
1519
|
})), !0);
|
|
1519
1520
|
}
|
|
1520
|
-
}],
|
|
1521
|
-
function jt(
|
|
1522
|
-
let { codeLanguages:
|
|
1523
|
-
if (!(
|
|
1524
|
-
let u =
|
|
1525
|
-
|
|
1526
|
-
let p =
|
|
1527
|
-
u.push(
|
|
1521
|
+
}], Q = /*@__PURE__*/ ce({ matchClosingTags: !1 });
|
|
1522
|
+
function jt(t = {}) {
|
|
1523
|
+
let { codeLanguages: n, defaultCodeLanguage: r, addKeymap: a = !0, base: { parser: o } = St, completeHTMLTags: s = !0, pasteURLAsLink: c = !0, htmlTagLanguage: l = Q } = t;
|
|
1524
|
+
if (!(o instanceof Ne)) throw RangeError("Base parser provided to `markdown` should be a Markdown parser");
|
|
1525
|
+
let u = t.extensions ? [t.extensions] : [], d = [l.support, xt], f;
|
|
1526
|
+
c && d.push(Ft), r instanceof ee ? (d.push(r.support), f = r.language) : r && (f = r);
|
|
1527
|
+
let p = n || f ? Ct(n, f) : void 0;
|
|
1528
|
+
u.push(Je({
|
|
1528
1529
|
codeParser: p,
|
|
1529
|
-
htmlParser:
|
|
1530
|
-
})),
|
|
1531
|
-
let
|
|
1532
|
-
return
|
|
1530
|
+
htmlParser: l.language.parser
|
|
1531
|
+
})), a && d.push(e.high(i.of(At)));
|
|
1532
|
+
let m = K(o.configure(u));
|
|
1533
|
+
return s && d.push(m.data.of({ autocomplete: Mt })), new ee(m, d);
|
|
1533
1534
|
}
|
|
1534
1535
|
function Mt(e) {
|
|
1535
1536
|
let { state: t, pos: n } = e, r = /<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n - 25, n));
|
|
1536
1537
|
if (!r) return null;
|
|
1537
|
-
let i =
|
|
1538
|
+
let i = _(t).resolveInner(n, -1);
|
|
1538
1539
|
for (; i && !i.type.isTop;) {
|
|
1539
1540
|
if (i.name == "CodeBlock" || i.name == "FencedCode" || i.name == "ProcessingInstructionBlock" || i.name == "CommentBlock" || i.name == "Link" || i.name == "Image") return null;
|
|
1540
1541
|
i = i.parent;
|
|
@@ -1549,15 +1550,15 @@ function Mt(e) {
|
|
|
1549
1550
|
var $ = null;
|
|
1550
1551
|
function Nt() {
|
|
1551
1552
|
if ($) return $;
|
|
1552
|
-
let e =
|
|
1553
|
+
let e = le(new ue(t.create({ extensions: Q }), 0, !0));
|
|
1553
1554
|
return $ = e ? e.options : [];
|
|
1554
1555
|
}
|
|
1555
|
-
var Pt = /code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i, Ft = /*@__PURE__*/
|
|
1556
|
+
var Pt = /code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i, Ft = /*@__PURE__*/ a.domEventHandlers({ paste: (e, t) => {
|
|
1556
1557
|
let { main: n } = t.state.selection;
|
|
1557
1558
|
if (n.empty) return !1;
|
|
1558
1559
|
let r = e.clipboardData?.getData("text/plain");
|
|
1559
|
-
if (!r || !/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r) || (/^www\./.test(r) && (r = "https://" + r), !
|
|
1560
|
-
let i =
|
|
1560
|
+
if (!r || !/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r) || (/^www\./.test(r) && (r = "https://" + r), !q.isActiveAt(t.state, n.from, 1))) return !1;
|
|
1561
|
+
let i = _(t.state), a = !1;
|
|
1561
1562
|
return i.iterate({
|
|
1562
1563
|
from: n.from,
|
|
1563
1564
|
to: n.to,
|