@lvce-editor/markdown-worker 1.9.0 → 2.0.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/dist/markdownWorkerMain.js +752 -383
- package/package.json +5 -1
|
@@ -521,7 +521,7 @@ const create$4 = (method, params) => {
|
|
|
521
521
|
};
|
|
522
522
|
};
|
|
523
523
|
const callbacks = Object.create(null);
|
|
524
|
-
const set$
|
|
524
|
+
const set$3 = (id, fn) => {
|
|
525
525
|
callbacks[id] = fn;
|
|
526
526
|
};
|
|
527
527
|
const get$1 = id => {
|
|
@@ -540,7 +540,7 @@ const registerPromise = () => {
|
|
|
540
540
|
resolve,
|
|
541
541
|
promise
|
|
542
542
|
} = Promise.withResolvers();
|
|
543
|
-
set$
|
|
543
|
+
set$3(id, resolve);
|
|
544
544
|
return {
|
|
545
545
|
id,
|
|
546
546
|
promise
|
|
@@ -885,10 +885,10 @@ const send = (transport, method, ...params) => {
|
|
|
885
885
|
const message = create$4(method, params);
|
|
886
886
|
transport.send(message);
|
|
887
887
|
};
|
|
888
|
-
const invoke = (ipc, method, ...params) => {
|
|
888
|
+
const invoke$1 = (ipc, method, ...params) => {
|
|
889
889
|
return invokeHelper(ipc, method, params, false);
|
|
890
890
|
};
|
|
891
|
-
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
891
|
+
const invokeAndTransfer$1 = (ipc, method, ...params) => {
|
|
892
892
|
return invokeHelper(ipc, method, params, true);
|
|
893
893
|
};
|
|
894
894
|
|
|
@@ -924,10 +924,10 @@ const createRpc = ipc => {
|
|
|
924
924
|
send(ipc, method, ...params);
|
|
925
925
|
},
|
|
926
926
|
invoke(method, ...params) {
|
|
927
|
-
return invoke(ipc, method, ...params);
|
|
927
|
+
return invoke$1(ipc, method, ...params);
|
|
928
928
|
},
|
|
929
929
|
invokeAndTransfer(method, ...params) {
|
|
930
|
-
return invokeAndTransfer(ipc, method, ...params);
|
|
930
|
+
return invokeAndTransfer$1(ipc, method, ...params);
|
|
931
931
|
},
|
|
932
932
|
async dispose() {
|
|
933
933
|
await ipc?.dispose();
|
|
@@ -999,6 +999,25 @@ const WebWorkerRpcClient = {
|
|
|
999
999
|
__proto__: null,
|
|
1000
1000
|
create: create$1
|
|
1001
1001
|
};
|
|
1002
|
+
const createMockRpc = ({
|
|
1003
|
+
commandMap
|
|
1004
|
+
}) => {
|
|
1005
|
+
const invocations = [];
|
|
1006
|
+
const invoke = (method, ...params) => {
|
|
1007
|
+
invocations.push([method, ...params]);
|
|
1008
|
+
const command = commandMap[method];
|
|
1009
|
+
if (!command) {
|
|
1010
|
+
throw new Error(`command ${method} not found`);
|
|
1011
|
+
}
|
|
1012
|
+
return command(...params);
|
|
1013
|
+
};
|
|
1014
|
+
const mockRpc = {
|
|
1015
|
+
invoke,
|
|
1016
|
+
invokeAndTransfer: invoke,
|
|
1017
|
+
invocations
|
|
1018
|
+
};
|
|
1019
|
+
return mockRpc;
|
|
1020
|
+
};
|
|
1002
1021
|
|
|
1003
1022
|
const terminate = () => {
|
|
1004
1023
|
globalThis.close();
|
|
@@ -1036,39 +1055,10 @@ const Cite$1 = 56;
|
|
|
1036
1055
|
const Data$1 = 57;
|
|
1037
1056
|
const Time$1 = 58;
|
|
1038
1057
|
const Tfoot$1 = 59;
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
Article: Article$1,
|
|
1044
|
-
Aside: Aside$1,
|
|
1045
|
-
Br: Br$1,
|
|
1046
|
-
Cite: Cite$1,
|
|
1047
|
-
Data: Data$1,
|
|
1048
|
-
Dd: Dd$1,
|
|
1049
|
-
Div: Div$1,
|
|
1050
|
-
Dl: Dl$1,
|
|
1051
|
-
Figcaption: Figcaption$1,
|
|
1052
|
-
Figure: Figure$1,
|
|
1053
|
-
Footer: Footer$1,
|
|
1054
|
-
H1: H1$1,
|
|
1055
|
-
H2: H2$1,
|
|
1056
|
-
H3: H3$1,
|
|
1057
|
-
H4: H4$1,
|
|
1058
|
-
H5: H5$1,
|
|
1059
|
-
Header: Header$1,
|
|
1060
|
-
Hr: Hr$1,
|
|
1061
|
-
Img: Img$1,
|
|
1062
|
-
Li: Li$1,
|
|
1063
|
-
Nav: Nav$1,
|
|
1064
|
-
Ol: Ol$1,
|
|
1065
|
-
P: P$2,
|
|
1066
|
-
Pre: Pre$1,
|
|
1067
|
-
Search: Search$1,
|
|
1068
|
-
Section: Section$1,
|
|
1069
|
-
Span: Span$1,
|
|
1070
|
-
Tfoot: Tfoot$1,
|
|
1071
|
-
Time: Time$1};
|
|
1058
|
+
|
|
1059
|
+
const DebugWorker = 55;
|
|
1060
|
+
const RendererWorker$1 = 1;
|
|
1061
|
+
|
|
1072
1062
|
const text = data => {
|
|
1073
1063
|
return {
|
|
1074
1064
|
type: Text$1,
|
|
@@ -1133,69 +1123,69 @@ const Tfoot = 'tfoot';
|
|
|
1133
1123
|
const getVirtualDomTag = text => {
|
|
1134
1124
|
switch (text) {
|
|
1135
1125
|
case H1:
|
|
1136
|
-
return
|
|
1126
|
+
return H1$1;
|
|
1137
1127
|
case H2:
|
|
1138
|
-
return
|
|
1128
|
+
return H2$1;
|
|
1139
1129
|
case H3:
|
|
1140
|
-
return
|
|
1130
|
+
return H3$1;
|
|
1141
1131
|
case H4:
|
|
1142
|
-
return
|
|
1132
|
+
return H4$1;
|
|
1143
1133
|
case H5:
|
|
1144
|
-
return
|
|
1134
|
+
return H5$1;
|
|
1145
1135
|
case Div:
|
|
1146
|
-
return
|
|
1136
|
+
return Div$1;
|
|
1147
1137
|
case Article:
|
|
1148
|
-
return
|
|
1138
|
+
return Article$1;
|
|
1149
1139
|
case Aside:
|
|
1150
|
-
return
|
|
1140
|
+
return Aside$1;
|
|
1151
1141
|
case Footer:
|
|
1152
|
-
return
|
|
1142
|
+
return Footer$1;
|
|
1153
1143
|
case Header:
|
|
1154
|
-
return
|
|
1144
|
+
return Header$1;
|
|
1155
1145
|
case Nav:
|
|
1156
|
-
return
|
|
1146
|
+
return Nav$1;
|
|
1157
1147
|
case Section:
|
|
1158
|
-
return
|
|
1148
|
+
return Section$1;
|
|
1159
1149
|
case Search:
|
|
1160
|
-
return
|
|
1150
|
+
return Search$1;
|
|
1161
1151
|
case Dd:
|
|
1162
|
-
return
|
|
1152
|
+
return Dd$1;
|
|
1163
1153
|
case Dl:
|
|
1164
|
-
return
|
|
1154
|
+
return Dl$1;
|
|
1165
1155
|
case Figcaption:
|
|
1166
|
-
return
|
|
1156
|
+
return Figcaption$1;
|
|
1167
1157
|
case Figure:
|
|
1168
|
-
return
|
|
1158
|
+
return Figure$1;
|
|
1169
1159
|
case Hr:
|
|
1170
|
-
return
|
|
1160
|
+
return Hr$1;
|
|
1171
1161
|
case Li:
|
|
1172
|
-
return
|
|
1162
|
+
return Li$1;
|
|
1173
1163
|
case Ol:
|
|
1174
|
-
return
|
|
1164
|
+
return Ol$1;
|
|
1175
1165
|
case P$1:
|
|
1176
|
-
return
|
|
1166
|
+
return P$2;
|
|
1177
1167
|
case Pre:
|
|
1178
|
-
return
|
|
1168
|
+
return Pre$1;
|
|
1179
1169
|
case A:
|
|
1180
|
-
return
|
|
1170
|
+
return A$1;
|
|
1181
1171
|
case Abbr:
|
|
1182
|
-
return
|
|
1172
|
+
return Abbr$1;
|
|
1183
1173
|
case Br:
|
|
1184
|
-
return
|
|
1174
|
+
return Br$1;
|
|
1185
1175
|
case Cite:
|
|
1186
|
-
return
|
|
1176
|
+
return Cite$1;
|
|
1187
1177
|
case Data:
|
|
1188
|
-
return
|
|
1178
|
+
return Data$1;
|
|
1189
1179
|
case Time:
|
|
1190
|
-
return
|
|
1180
|
+
return Time$1;
|
|
1191
1181
|
case Tfoot:
|
|
1192
|
-
return
|
|
1182
|
+
return Tfoot$1;
|
|
1193
1183
|
case Img:
|
|
1194
|
-
return
|
|
1184
|
+
return Img$1;
|
|
1195
1185
|
case Span:
|
|
1196
|
-
return
|
|
1186
|
+
return Span$1;
|
|
1197
1187
|
default:
|
|
1198
|
-
return
|
|
1188
|
+
return Div$1;
|
|
1199
1189
|
}
|
|
1200
1190
|
};
|
|
1201
1191
|
|
|
@@ -1544,7 +1534,7 @@ const getMarkdownVirtualDom = html => {
|
|
|
1544
1534
|
const childDom = parseHtml(html, allowedMarkdownAttributes);
|
|
1545
1535
|
const markdownChildCount = getVirtualDomChildCount(childDom);
|
|
1546
1536
|
return [{
|
|
1547
|
-
type:
|
|
1537
|
+
type: Div$1,
|
|
1548
1538
|
className: Markdown,
|
|
1549
1539
|
role: Document,
|
|
1550
1540
|
onContextMenu: HandleReadmeContextMenu,
|
|
@@ -1560,7 +1550,7 @@ const handleMessagePort = async (port, rpcId) => {
|
|
|
1560
1550
|
};
|
|
1561
1551
|
|
|
1562
1552
|
/**
|
|
1563
|
-
* marked v16.
|
|
1553
|
+
* marked v16.4.1 - a markdown parser
|
|
1564
1554
|
* Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
|
|
1565
1555
|
* https://github.com/markedjs/marked
|
|
1566
1556
|
*/
|
|
@@ -1584,15 +1574,15 @@ function L() {
|
|
|
1584
1574
|
walkTokens: null
|
|
1585
1575
|
};
|
|
1586
1576
|
}
|
|
1587
|
-
var
|
|
1588
|
-
function
|
|
1589
|
-
|
|
1577
|
+
var T = L();
|
|
1578
|
+
function G(u) {
|
|
1579
|
+
T = u;
|
|
1590
1580
|
}
|
|
1591
|
-
var
|
|
1581
|
+
var I = {
|
|
1592
1582
|
exec: () => null
|
|
1593
1583
|
};
|
|
1594
|
-
function h(
|
|
1595
|
-
let t = typeof
|
|
1584
|
+
function h(u, e = "") {
|
|
1585
|
+
let t = typeof u == "string" ? u : u.source,
|
|
1596
1586
|
n = {
|
|
1597
1587
|
replace: (r, i) => {
|
|
1598
1588
|
let s = typeof i == "string" ? i : i.source;
|
|
@@ -1653,114 +1643,115 @@ var m = {
|
|
|
1653
1643
|
spaceLine: /^ +$/gm,
|
|
1654
1644
|
notSpaceStart: /^\S*/,
|
|
1655
1645
|
endingNewline: /\n$/,
|
|
1656
|
-
listItemRegex:
|
|
1657
|
-
nextBulletRegex:
|
|
1658
|
-
hrRegex:
|
|
1659
|
-
fencesBeginRegex:
|
|
1660
|
-
headingBeginRegex:
|
|
1661
|
-
htmlBeginRegex:
|
|
1646
|
+
listItemRegex: u => new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
1647
|
+
nextBulletRegex: u => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
1648
|
+
hrRegex: u => new RegExp(`^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
|
|
1649
|
+
fencesBeginRegex: u => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`),
|
|
1650
|
+
headingBeginRegex: u => new RegExp(`^ {0,${Math.min(3, u - 1)}}#`),
|
|
1651
|
+
htmlBeginRegex: u => new RegExp(`^ {0,${Math.min(3, u - 1)}}<(?:[a-z].*>|!--)`, "i")
|
|
1662
1652
|
},
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1653
|
+
be = /^(?:[ \t]*(?:\n|$))+/,
|
|
1654
|
+
Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,
|
|
1655
|
+
Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
1656
|
+
E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,
|
|
1667
1657
|
Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
Q = /(?!\s*\])(
|
|
1675
|
-
|
|
1676
|
-
|
|
1658
|
+
F = /(?:[*+-]|\d{1,9}[.)])/,
|
|
1659
|
+
ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1660
|
+
oe = h(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(),
|
|
1661
|
+
we = h(ie).replace(/bull/g, F).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),
|
|
1662
|
+
j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
|
|
1663
|
+
ye = /^[^\n]+/,
|
|
1664
|
+
Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,
|
|
1665
|
+
Pe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),
|
|
1666
|
+
Se = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex(),
|
|
1677
1667
|
v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",
|
|
1678
1668
|
U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/,
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1669
|
+
$e = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),
|
|
1670
|
+
ae = h(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(),
|
|
1671
|
+
_e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(),
|
|
1682
1672
|
K = {
|
|
1683
|
-
blockquote:
|
|
1684
|
-
code:
|
|
1685
|
-
def:
|
|
1686
|
-
fences:
|
|
1673
|
+
blockquote: _e,
|
|
1674
|
+
code: Re,
|
|
1675
|
+
def: Pe,
|
|
1676
|
+
fences: Te,
|
|
1687
1677
|
heading: Oe,
|
|
1688
|
-
hr:
|
|
1689
|
-
html:
|
|
1690
|
-
lheading:
|
|
1691
|
-
list:
|
|
1692
|
-
newline:
|
|
1693
|
-
paragraph:
|
|
1694
|
-
table:
|
|
1695
|
-
text:
|
|
1678
|
+
hr: E,
|
|
1679
|
+
html: $e,
|
|
1680
|
+
lheading: oe,
|
|
1681
|
+
list: Se,
|
|
1682
|
+
newline: be,
|
|
1683
|
+
paragraph: ae,
|
|
1684
|
+
table: I,
|
|
1685
|
+
text: ye
|
|
1696
1686
|
},
|
|
1697
|
-
re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",
|
|
1698
|
-
|
|
1687
|
+
re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(),
|
|
1688
|
+
Le = {
|
|
1699
1689
|
...K,
|
|
1700
|
-
lheading:
|
|
1690
|
+
lheading: we,
|
|
1701
1691
|
table: re,
|
|
1702
|
-
paragraph: h(
|
|
1692
|
+
paragraph: h(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex()
|
|
1703
1693
|
},
|
|
1704
|
-
|
|
1694
|
+
Me = {
|
|
1705
1695
|
...K,
|
|
1706
1696
|
html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
1707
1697
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1708
1698
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1709
|
-
fences:
|
|
1699
|
+
fences: I,
|
|
1710
1700
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1711
|
-
paragraph: h(
|
|
1712
|
-
]`).replace("lheading",
|
|
1701
|
+
paragraph: h(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
|
|
1702
|
+
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1713
1703
|
},
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1704
|
+
ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
1705
|
+
Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
|
|
1706
|
+
le = /^( {2,}|\\)\n(?!\s*$)/,
|
|
1707
|
+
Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
1718
1708
|
D = /[\p{P}\p{S}]/u,
|
|
1719
1709
|
W = /[\s\p{P}\p{S}]/u,
|
|
1720
|
-
|
|
1710
|
+
ue = /[^\s\p{P}\p{S}]/u,
|
|
1721
1711
|
Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(),
|
|
1722
|
-
|
|
1712
|
+
pe = /(?!~)[\p{P}\p{S}]/u,
|
|
1723
1713
|
Ce = /(?!~)[\s\p{P}\p{S}]/u,
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
Ze = h(
|
|
1732
|
-
Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g,
|
|
1733
|
-
|
|
1734
|
-
|
|
1714
|
+
Be = /(?:[^\s\p{P}\p{S}]|~)/u,
|
|
1715
|
+
qe = h(/link|code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code", /(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(),
|
|
1716
|
+
ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,
|
|
1717
|
+
ve = h(ce, "u").replace(/punct/g, D).getRegex(),
|
|
1718
|
+
De = h(ce, "u").replace(/punct/g, pe).getRegex(),
|
|
1719
|
+
he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",
|
|
1720
|
+
He = h(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(),
|
|
1721
|
+
Ze = h(he, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex(),
|
|
1722
|
+
Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(),
|
|
1723
|
+
Ne = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(),
|
|
1724
|
+
Fe = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),
|
|
1735
1725
|
je = h(U).replace("(?:-->|$)", "-->").getRegex(),
|
|
1736
|
-
|
|
1737
|
-
q = /(?:\[(
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1726
|
+
Qe = h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),
|
|
1727
|
+
q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,
|
|
1728
|
+
Ue = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),
|
|
1729
|
+
de = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(),
|
|
1730
|
+
ke = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(),
|
|
1731
|
+
Ke = h("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(),
|
|
1732
|
+
se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,
|
|
1742
1733
|
X = {
|
|
1743
|
-
_backpedal:
|
|
1744
|
-
anyPunctuation:
|
|
1745
|
-
autolink:
|
|
1746
|
-
blockSkip:
|
|
1747
|
-
br:
|
|
1748
|
-
code:
|
|
1749
|
-
del:
|
|
1750
|
-
emStrongLDelim:
|
|
1751
|
-
emStrongRDelimAst:
|
|
1734
|
+
_backpedal: I,
|
|
1735
|
+
anyPunctuation: Ne,
|
|
1736
|
+
autolink: Fe,
|
|
1737
|
+
blockSkip: qe,
|
|
1738
|
+
br: le,
|
|
1739
|
+
code: Ae,
|
|
1740
|
+
del: I,
|
|
1741
|
+
emStrongLDelim: ve,
|
|
1742
|
+
emStrongRDelimAst: He,
|
|
1752
1743
|
emStrongRDelimUnd: Ge,
|
|
1753
|
-
escape:
|
|
1754
|
-
link:
|
|
1755
|
-
nolink:
|
|
1744
|
+
escape: ze,
|
|
1745
|
+
link: Ue,
|
|
1746
|
+
nolink: ke,
|
|
1756
1747
|
punctuation: Ee,
|
|
1757
|
-
reflink:
|
|
1758
|
-
reflinkSearch:
|
|
1759
|
-
tag:
|
|
1760
|
-
text:
|
|
1761
|
-
url:
|
|
1748
|
+
reflink: de,
|
|
1749
|
+
reflinkSearch: Ke,
|
|
1750
|
+
tag: Qe,
|
|
1751
|
+
text: Ie,
|
|
1752
|
+
url: I
|
|
1762
1753
|
},
|
|
1763
|
-
|
|
1754
|
+
We = {
|
|
1764
1755
|
...X,
|
|
1765
1756
|
link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(),
|
|
1766
1757
|
reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex()
|
|
@@ -1768,55 +1759,55 @@ var m = {
|
|
|
1768
1759
|
N = {
|
|
1769
1760
|
...X,
|
|
1770
1761
|
emStrongRDelimAst: Ze,
|
|
1771
|
-
emStrongLDelim:
|
|
1772
|
-
url: h(/^((?:
|
|
1762
|
+
emStrongLDelim: De,
|
|
1763
|
+
url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
1773
1764
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1774
|
-
del: /^(~~?)(?=[^\s~])((
|
|
1775
|
-
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|
|
|
1765
|
+
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1766
|
+
text: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex()
|
|
1776
1767
|
},
|
|
1777
|
-
|
|
1768
|
+
Xe = {
|
|
1778
1769
|
...N,
|
|
1779
|
-
br: h(
|
|
1770
|
+
br: h(le).replace("{2,}", "*").getRegex(),
|
|
1780
1771
|
text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1781
1772
|
},
|
|
1782
|
-
|
|
1773
|
+
C = {
|
|
1783
1774
|
normal: K,
|
|
1784
|
-
gfm:
|
|
1785
|
-
pedantic:
|
|
1775
|
+
gfm: Le,
|
|
1776
|
+
pedantic: Me
|
|
1786
1777
|
},
|
|
1787
1778
|
M = {
|
|
1788
1779
|
normal: X,
|
|
1789
1780
|
gfm: N,
|
|
1790
|
-
breaks:
|
|
1791
|
-
pedantic:
|
|
1781
|
+
breaks: Xe,
|
|
1782
|
+
pedantic: We
|
|
1792
1783
|
};
|
|
1793
|
-
var
|
|
1784
|
+
var Je = {
|
|
1794
1785
|
"&": "&",
|
|
1795
1786
|
"<": "<",
|
|
1796
1787
|
">": ">",
|
|
1797
1788
|
'"': """,
|
|
1798
1789
|
"'": "'"
|
|
1799
1790
|
},
|
|
1800
|
-
|
|
1801
|
-
function w(
|
|
1791
|
+
ge = u => Je[u];
|
|
1792
|
+
function w(u, e) {
|
|
1802
1793
|
if (e) {
|
|
1803
|
-
if (m.escapeTest.test(
|
|
1804
|
-
} else if (m.escapeTestNoEncode.test(
|
|
1805
|
-
return
|
|
1794
|
+
if (m.escapeTest.test(u)) return u.replace(m.escapeReplace, ge);
|
|
1795
|
+
} else if (m.escapeTestNoEncode.test(u)) return u.replace(m.escapeReplaceNoEncode, ge);
|
|
1796
|
+
return u;
|
|
1806
1797
|
}
|
|
1807
|
-
function J(
|
|
1798
|
+
function J(u) {
|
|
1808
1799
|
try {
|
|
1809
|
-
|
|
1800
|
+
u = encodeURI(u).replace(m.percentDecode, "%");
|
|
1810
1801
|
} catch {
|
|
1811
1802
|
return null;
|
|
1812
1803
|
}
|
|
1813
|
-
return
|
|
1804
|
+
return u;
|
|
1814
1805
|
}
|
|
1815
|
-
function V(
|
|
1816
|
-
let t =
|
|
1806
|
+
function V(u, e) {
|
|
1807
|
+
let t = u.replace(m.findPipe, (i, s, o) => {
|
|
1817
1808
|
let a = false,
|
|
1818
|
-
|
|
1819
|
-
for (; --
|
|
1809
|
+
l = s;
|
|
1810
|
+
for (; --l >= 0 && o[l] === "\\";) a = !a;
|
|
1820
1811
|
return a ? "|" : " |";
|
|
1821
1812
|
}),
|
|
1822
1813
|
n = t.split(m.splitPipe),
|
|
@@ -1825,29 +1816,29 @@ function V(l, e) {
|
|
|
1825
1816
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
1826
1817
|
return n;
|
|
1827
1818
|
}
|
|
1828
|
-
function z(
|
|
1829
|
-
let n =
|
|
1819
|
+
function z(u, e, t) {
|
|
1820
|
+
let n = u.length;
|
|
1830
1821
|
if (n === 0) return "";
|
|
1831
1822
|
let r = 0;
|
|
1832
1823
|
for (; r < n;) {
|
|
1833
|
-
let i =
|
|
1824
|
+
let i = u.charAt(n - r - 1);
|
|
1834
1825
|
if (i === e && true) r++;else break;
|
|
1835
1826
|
}
|
|
1836
|
-
return
|
|
1827
|
+
return u.slice(0, n - r);
|
|
1837
1828
|
}
|
|
1838
|
-
function
|
|
1839
|
-
if (
|
|
1829
|
+
function fe(u, e) {
|
|
1830
|
+
if (u.indexOf(e[1]) === -1) return -1;
|
|
1840
1831
|
let t = 0;
|
|
1841
|
-
for (let n = 0; n <
|
|
1832
|
+
for (let n = 0; n < u.length; n++) if (u[n] === "\\") n++;else if (u[n] === e[0]) t++;else if (u[n] === e[1] && (t--, t < 0)) return n;
|
|
1842
1833
|
return t > 0 ? -2 : -1;
|
|
1843
1834
|
}
|
|
1844
|
-
function
|
|
1835
|
+
function me(u, e, t, n, r) {
|
|
1845
1836
|
let i = e.href,
|
|
1846
1837
|
s = e.title || null,
|
|
1847
|
-
o =
|
|
1838
|
+
o = u[1].replace(r.other.outputLinkReplace, "$1");
|
|
1848
1839
|
n.state.inLink = true;
|
|
1849
1840
|
let a = {
|
|
1850
|
-
type:
|
|
1841
|
+
type: u[0].charAt(0) === "!" ? "image" : "link",
|
|
1851
1842
|
raw: t,
|
|
1852
1843
|
href: i,
|
|
1853
1844
|
title: s,
|
|
@@ -1856,8 +1847,8 @@ function fe(l, e, t, n, r) {
|
|
|
1856
1847
|
};
|
|
1857
1848
|
return n.state.inLink = false, a;
|
|
1858
1849
|
}
|
|
1859
|
-
function
|
|
1860
|
-
let n =
|
|
1850
|
+
function Ve(u, e, t) {
|
|
1851
|
+
let n = u.match(t.other.indentCodeCompensation);
|
|
1861
1852
|
if (n === null) return e;
|
|
1862
1853
|
let r = n[1];
|
|
1863
1854
|
return e.split(`
|
|
@@ -1874,7 +1865,7 @@ var y = class {
|
|
|
1874
1865
|
rules;
|
|
1875
1866
|
lexer;
|
|
1876
1867
|
constructor(e) {
|
|
1877
|
-
this.options = e ||
|
|
1868
|
+
this.options = e || T;
|
|
1878
1869
|
}
|
|
1879
1870
|
space(e) {
|
|
1880
1871
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1900,7 +1891,7 @@ var y = class {
|
|
|
1900
1891
|
let t = this.rules.block.fences.exec(e);
|
|
1901
1892
|
if (t) {
|
|
1902
1893
|
let n = t[0],
|
|
1903
|
-
r =
|
|
1894
|
+
r = Ve(n, t[3] || "", this.rules);
|
|
1904
1895
|
return {
|
|
1905
1896
|
type: "code",
|
|
1906
1897
|
raw: n,
|
|
@@ -1946,35 +1937,35 @@ var y = class {
|
|
|
1946
1937
|
for (; n.length > 0;) {
|
|
1947
1938
|
let o = false,
|
|
1948
1939
|
a = [],
|
|
1949
|
-
|
|
1950
|
-
for (
|
|
1951
|
-
n = n.slice(
|
|
1952
|
-
let
|
|
1940
|
+
l;
|
|
1941
|
+
for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) a.push(n[l]), o = true;else if (!o) a.push(n[l]);else break;
|
|
1942
|
+
n = n.slice(l);
|
|
1943
|
+
let c = a.join(`
|
|
1953
1944
|
`),
|
|
1954
|
-
|
|
1945
|
+
p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1955
1946
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1956
1947
|
r = r ? `${r}
|
|
1957
|
-
${
|
|
1958
|
-
${
|
|
1959
|
-
let
|
|
1960
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(
|
|
1961
|
-
let
|
|
1962
|
-
if (
|
|
1963
|
-
if (
|
|
1964
|
-
let
|
|
1965
|
-
|
|
1948
|
+
${c}` : c, i = i ? `${i}
|
|
1949
|
+
${p}` : p;
|
|
1950
|
+
let g = this.lexer.state.top;
|
|
1951
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, s, true), this.lexer.state.top = g, n.length === 0) break;
|
|
1952
|
+
let d = s.at(-1);
|
|
1953
|
+
if (d?.type === "code") break;
|
|
1954
|
+
if (d?.type === "blockquote") {
|
|
1955
|
+
let R = d,
|
|
1956
|
+
f = R.raw + `
|
|
1966
1957
|
` + n.join(`
|
|
1967
1958
|
`),
|
|
1968
|
-
|
|
1969
|
-
s[s.length - 1] =
|
|
1959
|
+
O = this.blockquote(f);
|
|
1960
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
1970
1961
|
break;
|
|
1971
|
-
} else if (
|
|
1972
|
-
let
|
|
1973
|
-
|
|
1962
|
+
} else if (d?.type === "list") {
|
|
1963
|
+
let R = d,
|
|
1964
|
+
f = R.raw + `
|
|
1974
1965
|
` + n.join(`
|
|
1975
1966
|
`),
|
|
1976
|
-
|
|
1977
|
-
s[s.length - 1] =
|
|
1967
|
+
O = this.list(f);
|
|
1968
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - d.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
1978
1969
|
`);
|
|
1979
1970
|
continue;
|
|
1980
1971
|
}
|
|
@@ -2004,61 +1995,61 @@ ${c}` : c;
|
|
|
2004
1995
|
let s = this.rules.other.listItemRegex(n),
|
|
2005
1996
|
o = false;
|
|
2006
1997
|
for (; e;) {
|
|
2007
|
-
let
|
|
2008
|
-
|
|
2009
|
-
|
|
1998
|
+
let l = false,
|
|
1999
|
+
c = "",
|
|
2000
|
+
p = "";
|
|
2010
2001
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
2011
|
-
|
|
2012
|
-
let
|
|
2013
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs,
|
|
2014
|
-
|
|
2002
|
+
c = t[0], e = e.substring(c.length);
|
|
2003
|
+
let g = t[2].split(`
|
|
2004
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, H => " ".repeat(3 * H.length)),
|
|
2005
|
+
d = e.split(`
|
|
2015
2006
|
`, 1)[0],
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
if (this.options.pedantic ? (
|
|
2019
|
-
`, e = e.substring(
|
|
2020
|
-
let
|
|
2021
|
-
ee = this.rules.other.hrRegex(
|
|
2022
|
-
te = this.rules.other.fencesBeginRegex(
|
|
2023
|
-
ne = this.rules.other.headingBeginRegex(
|
|
2024
|
-
|
|
2007
|
+
R = !g.trim(),
|
|
2008
|
+
f = 0;
|
|
2009
|
+
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(d) && (c += d + `
|
|
2010
|
+
`, e = e.substring(d.length + 1), l = true), !l) {
|
|
2011
|
+
let H = this.rules.other.nextBulletRegex(f),
|
|
2012
|
+
ee = this.rules.other.hrRegex(f),
|
|
2013
|
+
te = this.rules.other.fencesBeginRegex(f),
|
|
2014
|
+
ne = this.rules.other.headingBeginRegex(f),
|
|
2015
|
+
xe = this.rules.other.htmlBeginRegex(f);
|
|
2025
2016
|
for (; e;) {
|
|
2026
|
-
let
|
|
2017
|
+
let Z = e.split(`
|
|
2027
2018
|
`, 1)[0],
|
|
2028
2019
|
A;
|
|
2029
|
-
if (
|
|
2030
|
-
if (A.search(this.rules.other.nonSpaceChar) >=
|
|
2031
|
-
` + A.slice(
|
|
2032
|
-
if (
|
|
2033
|
-
|
|
2034
|
-
` +
|
|
2020
|
+
if (d = Z, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), A = d) : A = d.replace(this.rules.other.tabCharGlobal, " "), te.test(d) || ne.test(d) || xe.test(d) || H.test(d) || ee.test(d)) break;
|
|
2021
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !d.trim()) p += `
|
|
2022
|
+
` + A.slice(f);else {
|
|
2023
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g)) break;
|
|
2024
|
+
p += `
|
|
2025
|
+
` + d;
|
|
2035
2026
|
}
|
|
2036
|
-
!
|
|
2037
|
-
`, e = e.substring(
|
|
2027
|
+
!R && !d.trim() && (R = true), c += Z + `
|
|
2028
|
+
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
2038
2029
|
}
|
|
2039
2030
|
}
|
|
2040
|
-
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(
|
|
2041
|
-
let
|
|
2031
|
+
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(c) && (o = true));
|
|
2032
|
+
let O = null,
|
|
2042
2033
|
Y;
|
|
2043
|
-
this.options.gfm && (
|
|
2034
|
+
this.options.gfm && (O = this.rules.other.listIsTask.exec(p), O && (Y = O[0] !== "[ ] ", p = p.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
|
|
2044
2035
|
type: "list_item",
|
|
2045
|
-
raw:
|
|
2046
|
-
task: !!
|
|
2036
|
+
raw: c,
|
|
2037
|
+
task: !!O,
|
|
2047
2038
|
checked: Y,
|
|
2048
2039
|
loose: false,
|
|
2049
|
-
text:
|
|
2040
|
+
text: p,
|
|
2050
2041
|
tokens: []
|
|
2051
|
-
}), i.raw +=
|
|
2042
|
+
}), i.raw += c;
|
|
2052
2043
|
}
|
|
2053
2044
|
let a = i.items.at(-1);
|
|
2054
2045
|
if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();else return;
|
|
2055
2046
|
i.raw = i.raw.trimEnd();
|
|
2056
|
-
for (let
|
|
2057
|
-
let
|
|
2058
|
-
|
|
2059
|
-
i.loose =
|
|
2047
|
+
for (let l = 0; l < i.items.length; l++) if (this.lexer.state.top = false, i.items[l].tokens = this.lexer.blockTokens(i.items[l].text, []), !i.loose) {
|
|
2048
|
+
let c = i.items[l].tokens.filter(g => g.type === "space"),
|
|
2049
|
+
p = c.length > 0 && c.some(g => this.rules.other.anyLine.test(g.raw));
|
|
2050
|
+
i.loose = p;
|
|
2060
2051
|
}
|
|
2061
|
-
if (i.loose) for (let
|
|
2052
|
+
if (i.loose) for (let l = 0; l < i.items.length; l++) i.items[l].loose = true;
|
|
2062
2053
|
return i;
|
|
2063
2054
|
}
|
|
2064
2055
|
}
|
|
@@ -2109,11 +2100,11 @@ ${c}` : c;
|
|
|
2109
2100
|
header: true,
|
|
2110
2101
|
align: s.align[o]
|
|
2111
2102
|
});
|
|
2112
|
-
for (let o of i) s.rows.push(V(o, s.header.length).map((a,
|
|
2103
|
+
for (let o of i) s.rows.push(V(o, s.header.length).map((a, l) => ({
|
|
2113
2104
|
text: a,
|
|
2114
2105
|
tokens: this.lexer.inline(a),
|
|
2115
2106
|
header: false,
|
|
2116
|
-
align: s.align[
|
|
2107
|
+
align: s.align[l]
|
|
2117
2108
|
})));
|
|
2118
2109
|
return s;
|
|
2119
2110
|
}
|
|
@@ -2178,7 +2169,7 @@ ${c}` : c;
|
|
|
2178
2169
|
let s = z(n.slice(0, -1), "\\");
|
|
2179
2170
|
if ((n.length - s.length) % 2 === 0) return;
|
|
2180
2171
|
} else {
|
|
2181
|
-
let s =
|
|
2172
|
+
let s = fe(t[2], "()");
|
|
2182
2173
|
if (s === -2) return;
|
|
2183
2174
|
if (s > -1) {
|
|
2184
2175
|
let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
@@ -2191,7 +2182,7 @@ ${c}` : c;
|
|
|
2191
2182
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
2192
2183
|
s && (r = s[1], i = s[3]);
|
|
2193
2184
|
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
2194
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
2185
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), me(t, {
|
|
2195
2186
|
href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
2196
2187
|
title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
|
|
2197
2188
|
}, t[0], this.lexer, this.rules);
|
|
@@ -2210,7 +2201,7 @@ ${c}` : c;
|
|
|
2210
2201
|
text: s
|
|
2211
2202
|
};
|
|
2212
2203
|
}
|
|
2213
|
-
return
|
|
2204
|
+
return me(n, i, n[0], this.lexer, this.rules);
|
|
2214
2205
|
}
|
|
2215
2206
|
}
|
|
2216
2207
|
emStrong(e, t, n = "") {
|
|
@@ -2220,37 +2211,37 @@ ${c}` : c;
|
|
|
2220
2211
|
let s = [...r[0]].length - 1,
|
|
2221
2212
|
o,
|
|
2222
2213
|
a,
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
for (
|
|
2214
|
+
l = s,
|
|
2215
|
+
c = 0,
|
|
2216
|
+
p = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
2217
|
+
for (p.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = p.exec(t)) != null;) {
|
|
2227
2218
|
if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
|
|
2228
2219
|
if (a = [...o].length, r[3] || r[4]) {
|
|
2229
|
-
|
|
2220
|
+
l += a;
|
|
2230
2221
|
continue;
|
|
2231
2222
|
} else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
|
|
2232
|
-
|
|
2223
|
+
c += a;
|
|
2233
2224
|
continue;
|
|
2234
2225
|
}
|
|
2235
|
-
if (
|
|
2236
|
-
a = Math.min(a, a +
|
|
2237
|
-
let
|
|
2238
|
-
|
|
2226
|
+
if (l -= a, l > 0) continue;
|
|
2227
|
+
a = Math.min(a, a + l + c);
|
|
2228
|
+
let g = [...r[0]][0].length,
|
|
2229
|
+
d = e.slice(0, s + r.index + g + a);
|
|
2239
2230
|
if (Math.min(s, a) % 2) {
|
|
2240
|
-
let
|
|
2231
|
+
let f = d.slice(1, -1);
|
|
2241
2232
|
return {
|
|
2242
2233
|
type: "em",
|
|
2243
|
-
raw:
|
|
2244
|
-
text:
|
|
2245
|
-
tokens: this.lexer.inlineTokens(
|
|
2234
|
+
raw: d,
|
|
2235
|
+
text: f,
|
|
2236
|
+
tokens: this.lexer.inlineTokens(f)
|
|
2246
2237
|
};
|
|
2247
2238
|
}
|
|
2248
|
-
let
|
|
2239
|
+
let R = d.slice(2, -2);
|
|
2249
2240
|
return {
|
|
2250
2241
|
type: "strong",
|
|
2251
|
-
raw:
|
|
2252
|
-
text:
|
|
2253
|
-
tokens: this.lexer.inlineTokens(
|
|
2242
|
+
raw: d,
|
|
2243
|
+
text: R,
|
|
2244
|
+
tokens: this.lexer.inlineTokens(R)
|
|
2254
2245
|
};
|
|
2255
2246
|
}
|
|
2256
2247
|
}
|
|
@@ -2336,36 +2327,36 @@ ${c}` : c;
|
|
|
2336
2327
|
}
|
|
2337
2328
|
}
|
|
2338
2329
|
};
|
|
2339
|
-
var
|
|
2330
|
+
var x = class u {
|
|
2340
2331
|
tokens;
|
|
2341
2332
|
options;
|
|
2342
2333
|
state;
|
|
2343
2334
|
tokenizer;
|
|
2344
2335
|
inlineQueue;
|
|
2345
2336
|
constructor(e) {
|
|
2346
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
2337
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2347
2338
|
inLink: false,
|
|
2348
2339
|
inRawBlock: false,
|
|
2349
2340
|
top: true
|
|
2350
2341
|
};
|
|
2351
2342
|
let t = {
|
|
2352
2343
|
other: m,
|
|
2353
|
-
block:
|
|
2344
|
+
block: C.normal,
|
|
2354
2345
|
inline: M.normal
|
|
2355
2346
|
};
|
|
2356
|
-
this.options.pedantic ? (t.block =
|
|
2347
|
+
this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
2357
2348
|
}
|
|
2358
2349
|
static get rules() {
|
|
2359
2350
|
return {
|
|
2360
|
-
block:
|
|
2351
|
+
block: C,
|
|
2361
2352
|
inline: M
|
|
2362
2353
|
};
|
|
2363
2354
|
}
|
|
2364
2355
|
static lex(e, t) {
|
|
2365
|
-
return new
|
|
2356
|
+
return new u(t).lex(e);
|
|
2366
2357
|
}
|
|
2367
2358
|
static lexInline(e, t) {
|
|
2368
|
-
return new
|
|
2359
|
+
return new u(t).inlineTokens(e);
|
|
2369
2360
|
}
|
|
2370
2361
|
lex(e) {
|
|
2371
2362
|
e = e.replace(m.carriageReturn, `
|
|
@@ -2447,8 +2438,8 @@ var b = class l {
|
|
|
2447
2438
|
let s = 1 / 0,
|
|
2448
2439
|
o = e.slice(1),
|
|
2449
2440
|
a;
|
|
2450
|
-
this.options.extensions.startBlock.forEach(
|
|
2451
|
-
a =
|
|
2441
|
+
this.options.extensions.startBlock.forEach(l => {
|
|
2442
|
+
a = l.call({
|
|
2452
2443
|
lexer: this
|
|
2453
2444
|
}, o), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
|
|
2454
2445
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
@@ -2495,12 +2486,15 @@ var b = class l {
|
|
|
2495
2486
|
}
|
|
2496
2487
|
for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
2497
2488
|
for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null;) n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
2489
|
+
n = this.options.hooks?.emStrongMask?.call({
|
|
2490
|
+
lexer: this
|
|
2491
|
+
}, n) ?? n;
|
|
2498
2492
|
let i = false,
|
|
2499
2493
|
s = "";
|
|
2500
2494
|
for (; e;) {
|
|
2501
2495
|
i || (s = ""), i = false;
|
|
2502
2496
|
let o;
|
|
2503
|
-
if (this.options.extensions?.inline?.some(
|
|
2497
|
+
if (this.options.extensions?.inline?.some(l => (o = l.call({
|
|
2504
2498
|
lexer: this
|
|
2505
2499
|
}, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
|
|
2506
2500
|
if (o = this.tokenizer.escape(e)) {
|
|
@@ -2517,8 +2511,8 @@ var b = class l {
|
|
|
2517
2511
|
}
|
|
2518
2512
|
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
2519
2513
|
e = e.substring(o.raw.length);
|
|
2520
|
-
let
|
|
2521
|
-
o.type === "text" &&
|
|
2514
|
+
let l = t.at(-1);
|
|
2515
|
+
o.type === "text" && l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
2522
2516
|
continue;
|
|
2523
2517
|
}
|
|
2524
2518
|
if (o = this.tokenizer.emStrong(e, n, s)) {
|
|
@@ -2547,27 +2541,27 @@ var b = class l {
|
|
|
2547
2541
|
}
|
|
2548
2542
|
let a = e;
|
|
2549
2543
|
if (this.options.extensions?.startInline) {
|
|
2550
|
-
let
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
this.options.extensions.startInline.forEach(
|
|
2554
|
-
|
|
2544
|
+
let l = 1 / 0,
|
|
2545
|
+
c = e.slice(1),
|
|
2546
|
+
p;
|
|
2547
|
+
this.options.extensions.startInline.forEach(g => {
|
|
2548
|
+
p = g.call({
|
|
2555
2549
|
lexer: this
|
|
2556
|
-
},
|
|
2557
|
-
}),
|
|
2550
|
+
}, c), typeof p == "number" && p >= 0 && (l = Math.min(l, p));
|
|
2551
|
+
}), l < 1 / 0 && l >= 0 && (a = e.substring(0, l + 1));
|
|
2558
2552
|
}
|
|
2559
2553
|
if (o = this.tokenizer.inlineText(a)) {
|
|
2560
2554
|
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (s = o.raw.slice(-1)), i = true;
|
|
2561
|
-
let
|
|
2562
|
-
|
|
2555
|
+
let l = t.at(-1);
|
|
2556
|
+
l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
2563
2557
|
continue;
|
|
2564
2558
|
}
|
|
2565
2559
|
if (e) {
|
|
2566
|
-
let
|
|
2560
|
+
let l = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
2567
2561
|
if (this.options.silent) {
|
|
2568
|
-
console.error(
|
|
2562
|
+
console.error(l);
|
|
2569
2563
|
break;
|
|
2570
|
-
} else throw new Error(
|
|
2564
|
+
} else throw new Error(l);
|
|
2571
2565
|
}
|
|
2572
2566
|
}
|
|
2573
2567
|
return t;
|
|
@@ -2577,7 +2571,7 @@ var P = class {
|
|
|
2577
2571
|
options;
|
|
2578
2572
|
parser;
|
|
2579
2573
|
constructor(e) {
|
|
2580
|
-
this.options = e ||
|
|
2574
|
+
this.options = e || T;
|
|
2581
2575
|
}
|
|
2582
2576
|
space(e) {
|
|
2583
2577
|
return "";
|
|
@@ -2748,7 +2742,7 @@ ${e}</tr>
|
|
|
2748
2742
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
|
|
2749
2743
|
}
|
|
2750
2744
|
};
|
|
2751
|
-
var
|
|
2745
|
+
var $ = class {
|
|
2752
2746
|
strong({
|
|
2753
2747
|
text: e
|
|
2754
2748
|
}) {
|
|
@@ -2793,18 +2787,18 @@ var S = class {
|
|
|
2793
2787
|
return "";
|
|
2794
2788
|
}
|
|
2795
2789
|
};
|
|
2796
|
-
var
|
|
2790
|
+
var b = class u {
|
|
2797
2791
|
options;
|
|
2798
2792
|
renderer;
|
|
2799
2793
|
textRenderer;
|
|
2800
2794
|
constructor(e) {
|
|
2801
|
-
this.options = e ||
|
|
2795
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new P(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $();
|
|
2802
2796
|
}
|
|
2803
2797
|
static parse(e, t) {
|
|
2804
|
-
return new
|
|
2798
|
+
return new u(t).parse(e);
|
|
2805
2799
|
}
|
|
2806
2800
|
static parseInline(e, t) {
|
|
2807
|
-
return new
|
|
2801
|
+
return new u(t).parseInline(e);
|
|
2808
2802
|
}
|
|
2809
2803
|
parse(e, t = true) {
|
|
2810
2804
|
let n = "";
|
|
@@ -2977,13 +2971,14 @@ var R = class l {
|
|
|
2977
2971
|
return n;
|
|
2978
2972
|
}
|
|
2979
2973
|
};
|
|
2980
|
-
var
|
|
2974
|
+
var S = class {
|
|
2981
2975
|
options;
|
|
2982
2976
|
block;
|
|
2983
2977
|
constructor(e) {
|
|
2984
|
-
this.options = e ||
|
|
2978
|
+
this.options = e || T;
|
|
2985
2979
|
}
|
|
2986
|
-
static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
2980
|
+
static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
2981
|
+
static passThroughHooksRespectAsync = new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
2987
2982
|
preprocess(e) {
|
|
2988
2983
|
return e;
|
|
2989
2984
|
}
|
|
@@ -2993,11 +2988,14 @@ var $ = class {
|
|
|
2993
2988
|
processAllTokens(e) {
|
|
2994
2989
|
return e;
|
|
2995
2990
|
}
|
|
2991
|
+
emStrongMask(e) {
|
|
2992
|
+
return e;
|
|
2993
|
+
}
|
|
2996
2994
|
provideLexer() {
|
|
2997
|
-
return this.block ?
|
|
2995
|
+
return this.block ? x.lex : x.lexInline;
|
|
2998
2996
|
}
|
|
2999
2997
|
provideParser() {
|
|
3000
|
-
return this.block ?
|
|
2998
|
+
return this.block ? b.parse : b.parseInline;
|
|
3001
2999
|
}
|
|
3002
3000
|
};
|
|
3003
3001
|
var B = class {
|
|
@@ -3005,12 +3003,12 @@ var B = class {
|
|
|
3005
3003
|
options = this.setOptions;
|
|
3006
3004
|
parse = this.parseMarkdown(true);
|
|
3007
3005
|
parseInline = this.parseMarkdown(false);
|
|
3008
|
-
Parser =
|
|
3006
|
+
Parser = b;
|
|
3009
3007
|
Renderer = P;
|
|
3010
|
-
TextRenderer =
|
|
3011
|
-
Lexer =
|
|
3008
|
+
TextRenderer = $;
|
|
3009
|
+
Lexer = x;
|
|
3012
3010
|
Tokenizer = y;
|
|
3013
|
-
Hooks =
|
|
3011
|
+
Hooks = S;
|
|
3014
3012
|
constructor(...e) {
|
|
3015
3013
|
this.use(...e);
|
|
3016
3014
|
}
|
|
@@ -3072,10 +3070,10 @@ var B = class {
|
|
|
3072
3070
|
if (["options", "parser"].includes(s)) continue;
|
|
3073
3071
|
let o = s,
|
|
3074
3072
|
a = n.renderer[o],
|
|
3075
|
-
|
|
3076
|
-
i[o] = (...
|
|
3077
|
-
let
|
|
3078
|
-
return
|
|
3073
|
+
l = i[o];
|
|
3074
|
+
i[o] = (...c) => {
|
|
3075
|
+
let p = a.apply(i, c);
|
|
3076
|
+
return p === false && (p = l.apply(i, c)), p || "";
|
|
3079
3077
|
};
|
|
3080
3078
|
}
|
|
3081
3079
|
r.renderer = i;
|
|
@@ -3087,29 +3085,36 @@ var B = class {
|
|
|
3087
3085
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
3088
3086
|
let o = s,
|
|
3089
3087
|
a = n.tokenizer[o],
|
|
3090
|
-
|
|
3091
|
-
i[o] = (...
|
|
3092
|
-
let
|
|
3093
|
-
return
|
|
3088
|
+
l = i[o];
|
|
3089
|
+
i[o] = (...c) => {
|
|
3090
|
+
let p = a.apply(i, c);
|
|
3091
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
3094
3092
|
};
|
|
3095
3093
|
}
|
|
3096
3094
|
r.tokenizer = i;
|
|
3097
3095
|
}
|
|
3098
3096
|
if (n.hooks) {
|
|
3099
|
-
let i = this.defaults.hooks || new
|
|
3097
|
+
let i = this.defaults.hooks || new S();
|
|
3100
3098
|
for (let s in n.hooks) {
|
|
3101
3099
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
3102
3100
|
if (["options", "block"].includes(s)) continue;
|
|
3103
3101
|
let o = s,
|
|
3104
3102
|
a = n.hooks[o],
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
if (this.defaults.async
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
let
|
|
3112
|
-
return
|
|
3103
|
+
l = i[o];
|
|
3104
|
+
S.passThroughHooks.has(s) ? i[o] = c => {
|
|
3105
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
3106
|
+
let g = await a.call(i, c);
|
|
3107
|
+
return l.call(i, g);
|
|
3108
|
+
})();
|
|
3109
|
+
let p = a.call(i, c);
|
|
3110
|
+
return l.call(i, p);
|
|
3111
|
+
} : i[o] = (...c) => {
|
|
3112
|
+
if (this.defaults.async) return (async () => {
|
|
3113
|
+
let g = await a.apply(i, c);
|
|
3114
|
+
return g === false && (g = await l.apply(i, c)), g;
|
|
3115
|
+
})();
|
|
3116
|
+
let p = a.apply(i, c);
|
|
3117
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
3113
3118
|
};
|
|
3114
3119
|
}
|
|
3115
3120
|
r.hooks = i;
|
|
@@ -3135,10 +3140,10 @@ var B = class {
|
|
|
3135
3140
|
}, this;
|
|
3136
3141
|
}
|
|
3137
3142
|
lexer(e, t) {
|
|
3138
|
-
return
|
|
3143
|
+
return x.lex(e, t ?? this.defaults);
|
|
3139
3144
|
}
|
|
3140
3145
|
parser(e, t) {
|
|
3141
|
-
return
|
|
3146
|
+
return b.parse(e, t ?? this.defaults);
|
|
3142
3147
|
}
|
|
3143
3148
|
parseMarkdown(e) {
|
|
3144
3149
|
return (n, r) => {
|
|
@@ -3153,18 +3158,22 @@ var B = class {
|
|
|
3153
3158
|
if (this.defaults.async === true && i.async === false) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
3154
3159
|
if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
|
|
3155
3160
|
if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
3156
|
-
s.hooks && (s.hooks.options = s, s.hooks.block = e)
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3161
|
+
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
3162
|
+
let a = s.hooks ? await s.hooks.preprocess(n) : n,
|
|
3163
|
+
c = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(a, s),
|
|
3164
|
+
p = s.hooks ? await s.hooks.processAllTokens(c) : c;
|
|
3165
|
+
s.walkTokens && (await Promise.all(this.walkTokens(p, s.walkTokens)));
|
|
3166
|
+
let d = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
3167
|
+
return s.hooks ? await s.hooks.postprocess(d) : d;
|
|
3168
|
+
})().catch(o);
|
|
3160
3169
|
try {
|
|
3161
3170
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
3162
|
-
let
|
|
3163
|
-
s.hooks && (
|
|
3164
|
-
let
|
|
3165
|
-
return s.hooks && (
|
|
3166
|
-
} catch (
|
|
3167
|
-
return o(
|
|
3171
|
+
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
3172
|
+
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
3173
|
+
let p = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
3174
|
+
return s.hooks && (p = s.hooks.postprocess(p)), p;
|
|
3175
|
+
} catch (a) {
|
|
3176
|
+
return o(a);
|
|
3168
3177
|
}
|
|
3169
3178
|
};
|
|
3170
3179
|
}
|
|
@@ -3181,56 +3190,67 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
3181
3190
|
}
|
|
3182
3191
|
};
|
|
3183
3192
|
var _ = new B();
|
|
3184
|
-
function
|
|
3185
|
-
return _.parse(
|
|
3193
|
+
function k(u, e) {
|
|
3194
|
+
return _.parse(u, e);
|
|
3186
3195
|
}
|
|
3187
|
-
|
|
3188
|
-
return _.setOptions(
|
|
3189
|
-
};
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
return _.use(...
|
|
3194
|
-
};
|
|
3195
|
-
|
|
3196
|
-
return _.walkTokens(
|
|
3197
|
-
};
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3196
|
+
k.options = k.setOptions = function (u) {
|
|
3197
|
+
return _.setOptions(u), k.defaults = _.defaults, G(k.defaults), k;
|
|
3198
|
+
};
|
|
3199
|
+
k.getDefaults = L;
|
|
3200
|
+
k.defaults = T;
|
|
3201
|
+
k.use = function (...u) {
|
|
3202
|
+
return _.use(...u), k.defaults = _.defaults, G(k.defaults), k;
|
|
3203
|
+
};
|
|
3204
|
+
k.walkTokens = function (u, e) {
|
|
3205
|
+
return _.walkTokens(u, e);
|
|
3206
|
+
};
|
|
3207
|
+
k.parseInline = _.parseInline;
|
|
3208
|
+
k.Parser = b;
|
|
3209
|
+
k.parser = b.parse;
|
|
3210
|
+
k.Renderer = P;
|
|
3211
|
+
k.TextRenderer = $;
|
|
3212
|
+
k.Lexer = x;
|
|
3213
|
+
k.lexer = x.lex;
|
|
3214
|
+
k.Tokenizer = y;
|
|
3215
|
+
k.Hooks = S;
|
|
3216
|
+
k.parse = k;
|
|
3208
3217
|
|
|
3209
|
-
|
|
3210
|
-
|
|
3218
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
3219
|
+
const RE_LINK_START = /^<a /;
|
|
3220
|
+
const renderMarkdown$1 = async (markdown, options = {}) => {
|
|
3221
|
+
const renderer = new P();
|
|
3222
|
+
if (options.linksExternal) {
|
|
3223
|
+
const linkRenderer = renderer.link.bind(renderer);
|
|
3224
|
+
renderer.link = link => {
|
|
3225
|
+
const localLink = link.href.startsWith(`${location.protocol}//${location.hostname}`);
|
|
3226
|
+
const html = linkRenderer(link);
|
|
3227
|
+
return localLink ? html : html.replace(RE_LINK_START, `<a target="_blank" rel="noreferrer noopener nofollow" `);
|
|
3228
|
+
};
|
|
3229
|
+
}
|
|
3230
|
+
const html = await k(markdown, {
|
|
3231
|
+
renderer
|
|
3232
|
+
});
|
|
3211
3233
|
return html;
|
|
3212
3234
|
};
|
|
3213
3235
|
|
|
3214
3236
|
const commandMap = {
|
|
3215
3237
|
'Markdown.getVirtualDom': getMarkdownVirtualDom,
|
|
3216
3238
|
'Markdown.handleMessagePort': handleMessagePort,
|
|
3217
|
-
'Markdown.render': renderMarkdown,
|
|
3239
|
+
'Markdown.render': renderMarkdown$1,
|
|
3218
3240
|
'Markdown.terminate': terminate,
|
|
3219
3241
|
// deprecated
|
|
3220
|
-
'Markdown.renderMarkdown': renderMarkdown,
|
|
3242
|
+
'Markdown.renderMarkdown': renderMarkdown$1,
|
|
3221
3243
|
'Markdown.getMarkDownVirtualDom': getMarkdownVirtualDom
|
|
3222
3244
|
};
|
|
3223
3245
|
|
|
3224
3246
|
const rpcs = Object.create(null);
|
|
3225
|
-
const set$
|
|
3247
|
+
const set$2 = (id, rpc) => {
|
|
3226
3248
|
rpcs[id] = rpc;
|
|
3227
3249
|
};
|
|
3228
3250
|
const get = id => {
|
|
3229
3251
|
return rpcs[id];
|
|
3230
3252
|
};
|
|
3231
3253
|
|
|
3232
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
3233
|
-
|
|
3234
3254
|
const create = rpcId => {
|
|
3235
3255
|
return {
|
|
3236
3256
|
// @ts-ignore
|
|
@@ -3246,7 +3266,7 @@ const create = rpcId => {
|
|
|
3246
3266
|
return rpc.invokeAndTransfer(method, ...params);
|
|
3247
3267
|
},
|
|
3248
3268
|
set(rpc) {
|
|
3249
|
-
set$
|
|
3269
|
+
set$2(rpcId, rpc);
|
|
3250
3270
|
},
|
|
3251
3271
|
async dispose() {
|
|
3252
3272
|
const rpc = get(rpcId);
|
|
@@ -3254,12 +3274,361 @@ const create = rpcId => {
|
|
|
3254
3274
|
}
|
|
3255
3275
|
};
|
|
3256
3276
|
};
|
|
3257
|
-
|
|
3277
|
+
|
|
3258
3278
|
const {
|
|
3259
|
-
|
|
3279
|
+
invoke,
|
|
3280
|
+
invokeAndTransfer,
|
|
3281
|
+
set: set$1,
|
|
3282
|
+
dispose
|
|
3283
|
+
} = create(RendererWorker$1);
|
|
3284
|
+
const searchFileHtml = async uri => {
|
|
3285
|
+
return invoke('ExtensionHost.searchFileWithHtml', uri);
|
|
3286
|
+
};
|
|
3287
|
+
const getFilePathElectron = async file => {
|
|
3288
|
+
return invoke('FileSystemHandle.getFilePathElectron', file);
|
|
3289
|
+
};
|
|
3290
|
+
const showContextMenu = async (x, y, id, ...args) => {
|
|
3291
|
+
return invoke('ContextMenu.show', x, y, id, ...args);
|
|
3292
|
+
};
|
|
3293
|
+
const getElectronVersion = async () => {
|
|
3294
|
+
return invoke('Process.getElectronVersion');
|
|
3295
|
+
};
|
|
3296
|
+
const applyBulkReplacement = async bulkEdits => {
|
|
3297
|
+
await invoke('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
3298
|
+
};
|
|
3299
|
+
const setColorTheme = async id => {
|
|
3300
|
+
// @ts-ignore
|
|
3301
|
+
return invoke(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
3302
|
+
};
|
|
3303
|
+
const getNodeVersion = async () => {
|
|
3304
|
+
return invoke('Process.getNodeVersion');
|
|
3305
|
+
};
|
|
3306
|
+
const getChromeVersion = async () => {
|
|
3307
|
+
return invoke('Process.getChromeVersion');
|
|
3308
|
+
};
|
|
3309
|
+
const getV8Version = async () => {
|
|
3310
|
+
return invoke('Process.getV8Version');
|
|
3311
|
+
};
|
|
3312
|
+
const getFileHandles = async fileIds => {
|
|
3313
|
+
const files = await invoke('FileSystemHandle.getFileHandles', fileIds);
|
|
3314
|
+
return files;
|
|
3315
|
+
};
|
|
3316
|
+
const setWorkspacePath = async path => {
|
|
3317
|
+
await invoke('Workspace.setPath', path);
|
|
3318
|
+
};
|
|
3319
|
+
const registerWebViewInterceptor = async (id, port) => {
|
|
3320
|
+
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
3321
|
+
};
|
|
3322
|
+
const unregisterWebViewInterceptor = async id => {
|
|
3323
|
+
await invoke('WebView.unregisterInterceptor', id);
|
|
3324
|
+
};
|
|
3325
|
+
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
3326
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
3327
|
+
// @ts-ignore
|
|
3328
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
3329
|
+
};
|
|
3330
|
+
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
3331
|
+
const command = 'Errors.handleMessagePort';
|
|
3332
|
+
// @ts-ignore
|
|
3333
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
3334
|
+
};
|
|
3335
|
+
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
3336
|
+
const command = 'Markdown.handleMessagePort';
|
|
3337
|
+
// @ts-ignore
|
|
3338
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
3339
|
+
};
|
|
3340
|
+
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
3341
|
+
const command = 'IconTheme.handleMessagePort';
|
|
3342
|
+
// @ts-ignore
|
|
3343
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
3344
|
+
};
|
|
3345
|
+
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
3346
|
+
const command = 'FileSystem.handleMessagePort';
|
|
3347
|
+
// @ts-ignore
|
|
3348
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
3349
|
+
};
|
|
3350
|
+
const readFile = async uri => {
|
|
3351
|
+
return invoke('FileSystem.readFile', uri);
|
|
3352
|
+
};
|
|
3353
|
+
const getWebViewSecret = async key => {
|
|
3354
|
+
// @ts-ignore
|
|
3355
|
+
return invoke('WebView.getSecret', key);
|
|
3356
|
+
};
|
|
3357
|
+
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
3358
|
+
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
3359
|
+
};
|
|
3360
|
+
const setFocus = key => {
|
|
3361
|
+
return invoke('Focus.setFocus', key);
|
|
3362
|
+
};
|
|
3363
|
+
const getFileIcon = async options => {
|
|
3364
|
+
return invoke('IconTheme.getFileIcon', options);
|
|
3365
|
+
};
|
|
3366
|
+
const getColorThemeNames = async () => {
|
|
3367
|
+
return invoke('ColorTheme.getColorThemeNames');
|
|
3368
|
+
};
|
|
3369
|
+
const disableExtension = async id => {
|
|
3370
|
+
// @ts-ignore
|
|
3371
|
+
return invoke('ExtensionManagement.disable', id);
|
|
3372
|
+
};
|
|
3373
|
+
const enableExtension = async id => {
|
|
3374
|
+
// @ts-ignore
|
|
3375
|
+
return invoke('ExtensionManagement.enable', id);
|
|
3376
|
+
};
|
|
3377
|
+
const handleDebugChange = async params => {
|
|
3378
|
+
// @ts-ignore
|
|
3379
|
+
return invoke('Run And Debug.handleChange', params);
|
|
3380
|
+
};
|
|
3381
|
+
const getFolderIcon = async options => {
|
|
3382
|
+
return invoke('IconTheme.getFolderIcon', options);
|
|
3383
|
+
};
|
|
3384
|
+
const closeWidget = async widgetId => {
|
|
3385
|
+
return invoke('Viewlet.closeWidget', widgetId);
|
|
3386
|
+
};
|
|
3387
|
+
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
3388
|
+
const command = 'HandleMessagePort.handleMessagePort2';
|
|
3389
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
3390
|
+
};
|
|
3391
|
+
const sendMessagePortToSearchProcess = async port => {
|
|
3392
|
+
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
3393
|
+
};
|
|
3394
|
+
const confirm = async (message, options) => {
|
|
3395
|
+
// @ts-ignore
|
|
3396
|
+
const result = await invoke('ConfirmPrompt.prompt', message, options);
|
|
3397
|
+
return result;
|
|
3398
|
+
};
|
|
3399
|
+
const getRecentlyOpened = async () => {
|
|
3400
|
+
return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
3401
|
+
};
|
|
3402
|
+
const getKeyBindings = async () => {
|
|
3403
|
+
return invoke('KeyBindingsInitial.getKeyBindings');
|
|
3404
|
+
};
|
|
3405
|
+
const writeClipBoardText = async text => {
|
|
3406
|
+
await invoke('ClipBoard.writeText', /* text */text);
|
|
3407
|
+
};
|
|
3408
|
+
const writeClipBoardImage = async blob => {
|
|
3409
|
+
// @ts-ignore
|
|
3410
|
+
await invoke('ClipBoard.writeImage', /* text */blob);
|
|
3411
|
+
};
|
|
3412
|
+
const searchFileMemory = async uri => {
|
|
3413
|
+
// @ts-ignore
|
|
3414
|
+
return invoke('ExtensionHost.searchFileWithMemory', uri);
|
|
3415
|
+
};
|
|
3416
|
+
const searchFileFetch = async uri => {
|
|
3417
|
+
return invoke('ExtensionHost.searchFileWithFetch', uri);
|
|
3418
|
+
};
|
|
3419
|
+
const showMessageBox = async options => {
|
|
3420
|
+
return invoke('ElectronDialog.showMessageBox', options);
|
|
3421
|
+
};
|
|
3422
|
+
const handleDebugResumed = async params => {
|
|
3423
|
+
await invoke('Run And Debug.handleResumed', params);
|
|
3424
|
+
};
|
|
3425
|
+
const openWidget = async name => {
|
|
3426
|
+
await invoke('Viewlet.openWidget', name);
|
|
3427
|
+
};
|
|
3428
|
+
const getIcons = async requests => {
|
|
3429
|
+
const icons = await invoke('IconTheme.getIcons', requests);
|
|
3430
|
+
return icons;
|
|
3431
|
+
};
|
|
3432
|
+
const activateByEvent = event => {
|
|
3433
|
+
return invoke('ExtensionHostManagement.activateByEvent', event);
|
|
3434
|
+
};
|
|
3435
|
+
const setAdditionalFocus = focusKey => {
|
|
3436
|
+
// @ts-ignore
|
|
3437
|
+
return invoke('Focus.setAdditionalFocus', focusKey);
|
|
3438
|
+
};
|
|
3439
|
+
const getActiveEditorId = () => {
|
|
3440
|
+
// @ts-ignore
|
|
3441
|
+
return invoke('GetActiveEditor.getActiveEditorId');
|
|
3442
|
+
};
|
|
3443
|
+
const getWorkspacePath = () => {
|
|
3444
|
+
return invoke('Workspace.getPath');
|
|
3445
|
+
};
|
|
3446
|
+
const sendMessagePortToRendererProcess = async port => {
|
|
3447
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
3448
|
+
// @ts-ignore
|
|
3449
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
3450
|
+
};
|
|
3451
|
+
const getPreference = async key => {
|
|
3452
|
+
return await invoke('Preferences.get', key);
|
|
3453
|
+
};
|
|
3454
|
+
const getAllExtensions = async () => {
|
|
3455
|
+
return invoke('ExtensionManagement.getAllExtensions');
|
|
3456
|
+
};
|
|
3457
|
+
const rerenderEditor = async key => {
|
|
3458
|
+
// @ts-ignore
|
|
3459
|
+
return invoke('Editor.rerender', key);
|
|
3460
|
+
};
|
|
3461
|
+
const handleDebugPaused = async params => {
|
|
3462
|
+
await invoke('Run And Debug.handlePaused', params);
|
|
3463
|
+
};
|
|
3464
|
+
const openUri = async (uri, focus, options) => {
|
|
3465
|
+
await invoke('Main.openUri', uri, focus, options);
|
|
3466
|
+
};
|
|
3467
|
+
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
3468
|
+
await invokeAndTransfer(
|
|
3469
|
+
// @ts-ignore
|
|
3470
|
+
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
3471
|
+
};
|
|
3472
|
+
const handleDebugScriptParsed = async script => {
|
|
3473
|
+
await invoke('Run And Debug.handleScriptParsed', script);
|
|
3474
|
+
};
|
|
3475
|
+
const getWindowId = async () => {
|
|
3476
|
+
return invoke('GetWindowId.getWindowId');
|
|
3477
|
+
};
|
|
3478
|
+
const getBlob = async uri => {
|
|
3479
|
+
// @ts-ignore
|
|
3480
|
+
return invoke('FileSystem.getBlob', uri);
|
|
3481
|
+
};
|
|
3482
|
+
const getExtensionCommands = async () => {
|
|
3483
|
+
return invoke('ExtensionHost.getCommands');
|
|
3484
|
+
};
|
|
3485
|
+
const showErrorDialog = async errorInfo => {
|
|
3486
|
+
// @ts-ignore
|
|
3487
|
+
await invoke('ErrorHandling.showErrorDialog', errorInfo);
|
|
3488
|
+
};
|
|
3489
|
+
const getFolderSize = async uri => {
|
|
3490
|
+
// @ts-ignore
|
|
3491
|
+
return await invoke('FileSystem.getFolderSize', uri);
|
|
3492
|
+
};
|
|
3493
|
+
const getExtension = async id => {
|
|
3494
|
+
// @ts-ignore
|
|
3495
|
+
return invoke('ExtensionManagement.getExtension', id);
|
|
3496
|
+
};
|
|
3497
|
+
const getMarkdownDom = async html => {
|
|
3498
|
+
// @ts-ignore
|
|
3499
|
+
return invoke('Markdown.getVirtualDom', html);
|
|
3500
|
+
};
|
|
3501
|
+
const renderMarkdown = async (markdown, options) => {
|
|
3502
|
+
// @ts-ignore
|
|
3503
|
+
return invoke('Markdown.renderMarkdown', markdown, options);
|
|
3504
|
+
};
|
|
3505
|
+
const openNativeFolder = async uri => {
|
|
3506
|
+
// @ts-ignore
|
|
3507
|
+
await invoke('OpenNativeFolder.openNativeFolder', uri);
|
|
3508
|
+
};
|
|
3509
|
+
const uninstallExtension = async id => {
|
|
3510
|
+
return invoke('ExtensionManagement.uninstall', id);
|
|
3511
|
+
};
|
|
3512
|
+
const installExtension = async id => {
|
|
3513
|
+
// @ts-ignore
|
|
3514
|
+
return invoke('ExtensionManagement.install', id);
|
|
3515
|
+
};
|
|
3516
|
+
const openExtensionSearch = async () => {
|
|
3517
|
+
// @ts-ignore
|
|
3518
|
+
return invoke('SideBar.openViewlet', 'Extensions');
|
|
3519
|
+
};
|
|
3520
|
+
const setExtensionsSearchValue = async searchValue => {
|
|
3521
|
+
// @ts-ignore
|
|
3522
|
+
return invoke('Extensions.handleInput', searchValue);
|
|
3523
|
+
};
|
|
3524
|
+
const openExternal = async uri => {
|
|
3525
|
+
// @ts-ignore
|
|
3526
|
+
await invoke('Open.openExternal', uri);
|
|
3527
|
+
};
|
|
3528
|
+
const openUrl = async uri => {
|
|
3529
|
+
// @ts-ignore
|
|
3530
|
+
await invoke('Open.openUrl', uri);
|
|
3531
|
+
};
|
|
3532
|
+
const getAllPreferences = async () => {
|
|
3533
|
+
// @ts-ignore
|
|
3534
|
+
return invoke('Preferences.getAll');
|
|
3535
|
+
};
|
|
3536
|
+
const showSaveFilePicker = async () => {
|
|
3537
|
+
// @ts-ignore
|
|
3538
|
+
return invoke('FilePicker.showSaveFilePicker');
|
|
3539
|
+
};
|
|
3540
|
+
const getLogsDir = async () => {
|
|
3541
|
+
// @ts-ignore
|
|
3542
|
+
return invoke('PlatformPaths.getLogsDir');
|
|
3543
|
+
};
|
|
3544
|
+
const registerMockRpc = commandMap => {
|
|
3545
|
+
const mockRpc = createMockRpc({
|
|
3546
|
+
commandMap
|
|
3547
|
+
});
|
|
3548
|
+
set$1(mockRpc);
|
|
3549
|
+
return mockRpc;
|
|
3550
|
+
};
|
|
3551
|
+
|
|
3260
3552
|
const RendererWorker = {
|
|
3261
3553
|
__proto__: null,
|
|
3262
|
-
|
|
3554
|
+
activateByEvent,
|
|
3555
|
+
applyBulkReplacement,
|
|
3556
|
+
closeWidget,
|
|
3557
|
+
confirm,
|
|
3558
|
+
disableExtension,
|
|
3559
|
+
dispose,
|
|
3560
|
+
enableExtension,
|
|
3561
|
+
getActiveEditorId,
|
|
3562
|
+
getAllExtensions,
|
|
3563
|
+
getAllPreferences,
|
|
3564
|
+
getBlob,
|
|
3565
|
+
getChromeVersion,
|
|
3566
|
+
getColorThemeNames,
|
|
3567
|
+
getElectronVersion,
|
|
3568
|
+
getExtension,
|
|
3569
|
+
getExtensionCommands,
|
|
3570
|
+
getFileHandles,
|
|
3571
|
+
getFileIcon,
|
|
3572
|
+
getFilePathElectron,
|
|
3573
|
+
getFolderIcon,
|
|
3574
|
+
getFolderSize,
|
|
3575
|
+
getIcons,
|
|
3576
|
+
getKeyBindings,
|
|
3577
|
+
getLogsDir,
|
|
3578
|
+
getMarkdownDom,
|
|
3579
|
+
getNodeVersion,
|
|
3580
|
+
getPreference,
|
|
3581
|
+
getRecentlyOpened,
|
|
3582
|
+
getV8Version,
|
|
3583
|
+
getWebViewSecret,
|
|
3584
|
+
getWindowId,
|
|
3585
|
+
getWorkspacePath,
|
|
3586
|
+
handleDebugChange,
|
|
3587
|
+
handleDebugPaused,
|
|
3588
|
+
handleDebugResumed,
|
|
3589
|
+
handleDebugScriptParsed,
|
|
3590
|
+
installExtension,
|
|
3591
|
+
invoke,
|
|
3592
|
+
invokeAndTransfer,
|
|
3593
|
+
openExtensionSearch,
|
|
3594
|
+
openExternal,
|
|
3595
|
+
openNativeFolder,
|
|
3596
|
+
openUri,
|
|
3597
|
+
openUrl,
|
|
3598
|
+
openWidget,
|
|
3599
|
+
readFile,
|
|
3600
|
+
registerMockRpc,
|
|
3601
|
+
registerWebViewInterceptor,
|
|
3602
|
+
renderMarkdown,
|
|
3603
|
+
rerenderEditor,
|
|
3604
|
+
searchFileFetch,
|
|
3605
|
+
searchFileHtml,
|
|
3606
|
+
searchFileMemory,
|
|
3607
|
+
sendMessagePortToEditorWorker,
|
|
3608
|
+
sendMessagePortToErrorWorker,
|
|
3609
|
+
sendMessagePortToExtensionHostWorker,
|
|
3610
|
+
sendMessagePortToFileSystemWorker,
|
|
3611
|
+
sendMessagePortToIconThemeWorker,
|
|
3612
|
+
sendMessagePortToMarkdownWorker,
|
|
3613
|
+
sendMessagePortToRendererProcess,
|
|
3614
|
+
sendMessagePortToSearchProcess,
|
|
3615
|
+
sendMessagePortToSyntaxHighlightingWorker,
|
|
3616
|
+
set: set$1,
|
|
3617
|
+
setAdditionalFocus,
|
|
3618
|
+
setColorTheme,
|
|
3619
|
+
setExtensionsSearchValue,
|
|
3620
|
+
setFocus,
|
|
3621
|
+
setWebViewPort,
|
|
3622
|
+
setWorkspacePath,
|
|
3623
|
+
showContextMenu,
|
|
3624
|
+
showErrorDialog,
|
|
3625
|
+
showMessageBox,
|
|
3626
|
+
showSaveFilePicker,
|
|
3627
|
+
uninstallExtension,
|
|
3628
|
+
unregisterWebViewInterceptor,
|
|
3629
|
+
writeClipBoardImage,
|
|
3630
|
+
writeClipBoardText
|
|
3631
|
+
};
|
|
3263
3632
|
|
|
3264
3633
|
const {
|
|
3265
3634
|
set
|