@wirecat/yandex-disk-cli 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/LICENSE +204 -0
- package/README.md +243 -2
- package/contracts/wirecat.json +1554 -0
- package/dist/bin/ydisk.d.ts +3 -0
- package/dist/bin/ydisk.d.ts.map +1 -0
- package/dist/bin/ydisk.js +40 -0
- package/dist/bin/ydisk.js.map +1 -0
- package/dist/bundle/all-profiles-4OLZF3RT.js +279 -0
- package/dist/bundle/anthropic-DKB4OJXZ.js +91 -0
- package/dist/bundle/app-server-G4545SSV.js +247 -0
- package/dist/bundle/bun-RXEQKFED.js +169 -0
- package/dist/bundle/bun-sqlite-VHT5LN7U.js +76 -0
- package/dist/bundle/chunk-2BITUXGC.js +12289 -0
- package/dist/bundle/chunk-2CLWDQKA.js +39330 -0
- package/dist/bundle/chunk-2JFDOPKA.js +9575 -0
- package/dist/bundle/chunk-3GVI2MAO.js +106 -0
- package/dist/bundle/chunk-3SZBWBMI.js +131 -0
- package/dist/bundle/chunk-44VSEXW6.js +4054 -0
- package/dist/bundle/chunk-4YPRRQBE.js +95 -0
- package/dist/bundle/chunk-5COYRL5B.js +379 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5DM7DIZL.js +1402 -0
- package/dist/bundle/chunk-6R2DVTVZ.js +24 -0
- package/dist/bundle/chunk-762BS35H.js +2787 -0
- package/dist/bundle/chunk-AG64V7AB.js +1233 -0
- package/dist/bundle/chunk-BC5HGIXB.js +334 -0
- package/dist/bundle/chunk-BH7LFEX7.js +36 -0
- package/dist/bundle/chunk-BLNPGY7N.js +53 -0
- package/dist/bundle/chunk-CNIA2LJF.js +372 -0
- package/dist/bundle/chunk-COSXMDC7.js +230 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-D7FO33KU.js +785 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DJH26PQ3.js +1396 -0
- package/dist/bundle/chunk-DJPT7IUC.js +64567 -0
- package/dist/bundle/chunk-DTMSCZDW.js +209 -0
- package/dist/bundle/chunk-E6LGZ5LX.js +16 -0
- package/dist/bundle/chunk-E6YRIHS5.js +92 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-F3DDSZTF.js +78 -0
- package/dist/bundle/chunk-F4WWTQNL.js +188 -0
- package/dist/bundle/chunk-FDDAUASC.js +1028 -0
- package/dist/bundle/chunk-FMNPG6N2.js +170 -0
- package/dist/bundle/chunk-FOKJ4POB.js +274 -0
- package/dist/bundle/chunk-G22C7JG6.js +731 -0
- package/dist/bundle/chunk-GA442SYZ.js +161 -0
- package/dist/bundle/chunk-GEBSW7UK.js +6848 -0
- package/dist/bundle/chunk-GGRKWAOK.js +594 -0
- package/dist/bundle/chunk-HHINRNZA.js +788 -0
- package/dist/bundle/chunk-HUZCL33L.js +128 -0
- package/dist/bundle/chunk-IALSIQVT.js +142 -0
- package/dist/bundle/chunk-IOXR2QBX.js +398 -0
- package/dist/bundle/chunk-J5CXR6VX.js +63 -0
- package/dist/bundle/chunk-J5PWSTOX.js +82 -0
- package/dist/bundle/chunk-J7BVAEHR.js +364 -0
- package/dist/bundle/chunk-JH46HMZW.js +1334 -0
- package/dist/bundle/chunk-JOBO7F6W.js +52 -0
- package/dist/bundle/chunk-JXZ5B3L5.js +2333 -0
- package/dist/bundle/chunk-KBIAMDZN.js +66 -0
- package/dist/bundle/chunk-KFVDL2QS.js +146 -0
- package/dist/bundle/chunk-LNHTLSR5.js +288 -0
- package/dist/bundle/chunk-M24RAKMJ.js +58 -0
- package/dist/bundle/chunk-MDQ57Q3H.js +1197 -0
- package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
- package/dist/bundle/chunk-MLXQ4X5L.js +206 -0
- package/dist/bundle/chunk-NQAKARHE.js +54 -0
- package/dist/bundle/chunk-OF7VVUDQ.js +23 -0
- package/dist/bundle/chunk-OQVPE3XK.js +324 -0
- package/dist/bundle/chunk-OR3QG7UR.js +259 -0
- package/dist/bundle/chunk-OUUYVROP.js +76 -0
- package/dist/bundle/chunk-PQBAM64O.js +168 -0
- package/dist/bundle/chunk-PYVIA7WF.js +88 -0
- package/dist/bundle/chunk-Q6HK3PHE.js +72 -0
- package/dist/bundle/chunk-QB3KECV2.js +218 -0
- package/dist/bundle/chunk-QGWXSFYN.js +73 -0
- package/dist/bundle/chunk-RC5QAAAE.js +29 -0
- package/dist/bundle/chunk-RMJ26HLB.js +18 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-T7ZUDA4C.js +72 -0
- package/dist/bundle/chunk-TRCSMVV5.js +72 -0
- package/dist/bundle/chunk-UD2BQEKA.js +46 -0
- package/dist/bundle/chunk-V4TL55GS.js +1068 -0
- package/dist/bundle/chunk-VJNWN5VU.js +4072 -0
- package/dist/bundle/chunk-VRRNBLMA.js +1227 -0
- package/dist/bundle/chunk-WUCMMNFJ.js +771 -0
- package/dist/bundle/chunk-XDESE3NY.js +44 -0
- package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
- package/dist/bundle/chunk-XQUUANA2.js +24600 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-Z2QEON7B.js +2275 -0
- package/dist/bundle/chunk-ZMJ56GME.js +7 -0
- package/dist/bundle/chunk-ZTSB3D7Q.js +100 -0
- package/dist/bundle/chunk-ZVJWD3FK.js +38 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-YIOYGPJA.js +40 -0
- package/dist/bundle/command-server-entry-MHBQDXS4.js +169 -0
- package/dist/bundle/decode-NUGJIOUW.js +297 -0
- package/dist/bundle/definitions-AILHKEQT.js +2005 -0
- package/dist/bundle/dispatch-5LC4UEGY.js +411 -0
- package/dist/bundle/dist-4I2W6X2I.js +7577 -0
- package/dist/bundle/echarts-MHSH6PGC.js +42501 -0
- package/dist/bundle/embed-ZDXTHHYS.js +38 -0
- package/dist/bundle/embedder-XFEELFUL.js +111 -0
- package/dist/bundle/failure-5S7VPBYK.js +25 -0
- package/dist/bundle/first-run-JHCHT3RJ.js +29 -0
- package/dist/bundle/first-screen-FHGQ6QRV.js +40 -0
- package/dist/bundle/instructions-WKSMBUFX.js +11 -0
- package/dist/bundle/mcp-HS2ZDUVR.js +167 -0
- package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
- package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
- package/dist/bundle/meeting-combined-K4U4NYRZ.js +25 -0
- package/dist/bundle/meeting-model-KCEG6Y5O.js +26 -0
- package/dist/bundle/meeting-semantic-VYGSV3H6.js +22 -0
- package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
- package/dist/bundle/node-CM6NC6UE.js +176 -0
- package/dist/bundle/node-KM3CUABH.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-5YDQ3LIJ.js +74 -0
- package/dist/bundle/notes-search-PGO7KM2U.js +62 -0
- package/dist/bundle/oauth-NY4C5UCK.js +20 -0
- package/dist/bundle/open-YNUTA6ZE.js +23 -0
- package/dist/bundle/openai-4CVT5PHH.js +241 -0
- package/dist/bundle/process-2XT3TL27.js +91 -0
- package/dist/bundle/program-FMIVF5T6.js +31904 -0
- package/dist/bundle/prompt-VNWY3H6S.js +17 -0
- package/dist/bundle/recognize-JS4PBPSZ.js +26 -0
- package/dist/bundle/remote-RCLFH4V2.js +32 -0
- package/dist/bundle/rerank-EG6VKYGO.js +52 -0
- package/dist/bundle/schemas-ED2LHKXK.js +645 -0
- package/dist/bundle/serve-AHG25QXB.js +199 -0
- package/dist/bundle/server-5FTB7WM3.js +78 -0
- package/dist/bundle/server-JNZVSAZE.js +209 -0
- package/dist/bundle/sqlite-runtime-XSZOAQPF.js +20 -0
- package/dist/bundle/state-XGVAJFF7.js +36 -0
- package/dist/bundle/store-OHSCWZEV.js +177 -0
- package/dist/bundle/store-PKSPKJXL.js +293 -0
- package/dist/bundle/store-maintenance-command-KAWGBSWK.js +69 -0
- package/dist/bundle/ydisk.js +183 -0
- package/dist/commands/api.d.ts +9 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +59 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +114 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/files.d.ts +3 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +272 -0
- package/dist/commands/files.js.map +1 -0
- package/dist/commands/library.d.ts +13 -0
- package/dist/commands/library.d.ts.map +1 -0
- package/dist/commands/library.js +118 -0
- package/dist/commands/library.js.map +1 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +99 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +62 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +80 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +77 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +2001 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +1473 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +127 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +545 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +829 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/identity.d.ts +10 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +33 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +65 -0
- package/dist/program.js.map +1 -0
- package/dist/sample/comments.d.ts +61 -0
- package/dist/sample/comments.d.ts.map +1 -0
- package/dist/sample/comments.js +39 -0
- package/dist/sample/comments.js.map +1 -0
- package/dist/sample/records.d.ts +16 -0
- package/dist/sample/records.d.ts.map +1 -0
- package/dist/sample/records.js +22 -0
- package/dist/sample/records.js.map +1 -0
- package/dist/sample/transport.d.ts +42 -0
- package/dist/sample/transport.d.ts.map +1 -0
- package/dist/sample/transport.js +153 -0
- package/dist/sample/transport.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/dist/yandex/source.d.ts +39 -0
- package/dist/yandex/source.d.ts.map +1 -0
- package/dist/yandex/source.js +189 -0
- package/dist/yandex/source.js.map +1 -0
- package/dist/yandex/transport.d.ts +41 -0
- package/dist/yandex/transport.d.ts.map +1 -0
- package/dist/yandex/transport.js +152 -0
- package/dist/yandex/transport.js.map +1 -0
- package/dist/yandex/writes.d.ts +27 -0
- package/dist/yandex/writes.d.ts.map +1 -0
- package/dist/yandex/writes.js +61 -0
- package/dist/yandex/writes.js.map +1 -0
- package/package.json +88 -4
- package/skills/yandex-disk-cli/SKILL.md +46 -0
- package/skills/yandex-disk-cli/references/api/api-disk-operations-operation-id.md +13 -0
- package/skills/yandex-disk-cli/references/api/api-disk-public-resources.md +50 -0
- package/skills/yandex-disk-cli/references/api/api-disk-resources.md +171 -0
- package/skills/yandex-disk-cli/references/api/api-disk-trash-resources.md +48 -0
- package/skills/yandex-disk-cli/references/api/api-disk.md +13 -0
- package/skills/yandex-disk-cli/references/api.md +17 -0
|
@@ -0,0 +1,1838 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
blankLine,
|
|
5
|
+
combineExtensions,
|
|
6
|
+
combineHtmlExtensions,
|
|
7
|
+
factorySpace,
|
|
8
|
+
resolveAll,
|
|
9
|
+
splice
|
|
10
|
+
} from "./chunk-MGUEZYFA.js";
|
|
11
|
+
import {
|
|
12
|
+
asciiAlpha,
|
|
13
|
+
asciiAlphanumeric,
|
|
14
|
+
asciiControl,
|
|
15
|
+
classifyCharacter,
|
|
16
|
+
markdownLineEnding,
|
|
17
|
+
markdownLineEndingOrSpace,
|
|
18
|
+
markdownSpace,
|
|
19
|
+
normalizeIdentifier,
|
|
20
|
+
unicodePunctuation,
|
|
21
|
+
unicodeWhitespace
|
|
22
|
+
} from "./chunk-KFVDL2QS.js";
|
|
23
|
+
import {
|
|
24
|
+
__name
|
|
25
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.1.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
28
|
+
var wwwPrefix = {
|
|
29
|
+
tokenize: tokenizeWwwPrefix,
|
|
30
|
+
partial: true
|
|
31
|
+
};
|
|
32
|
+
var domain = {
|
|
33
|
+
tokenize: tokenizeDomain,
|
|
34
|
+
partial: true
|
|
35
|
+
};
|
|
36
|
+
var path = {
|
|
37
|
+
tokenize: tokenizePath,
|
|
38
|
+
partial: true
|
|
39
|
+
};
|
|
40
|
+
var trail = {
|
|
41
|
+
tokenize: tokenizeTrail,
|
|
42
|
+
partial: true
|
|
43
|
+
};
|
|
44
|
+
var emailDomainDotTrail = {
|
|
45
|
+
tokenize: tokenizeEmailDomainDotTrail,
|
|
46
|
+
partial: true
|
|
47
|
+
};
|
|
48
|
+
var wwwAutolink = {
|
|
49
|
+
name: "wwwAutolink",
|
|
50
|
+
tokenize: tokenizeWwwAutolink,
|
|
51
|
+
previous: previousWww
|
|
52
|
+
};
|
|
53
|
+
var protocolAutolink = {
|
|
54
|
+
name: "protocolAutolink",
|
|
55
|
+
tokenize: tokenizeProtocolAutolink,
|
|
56
|
+
previous: previousProtocol
|
|
57
|
+
};
|
|
58
|
+
var emailAutolink = {
|
|
59
|
+
name: "emailAutolink",
|
|
60
|
+
tokenize: tokenizeEmailAutolink,
|
|
61
|
+
previous: previousEmail
|
|
62
|
+
};
|
|
63
|
+
var text = {};
|
|
64
|
+
function gfmAutolinkLiteral() {
|
|
65
|
+
return {
|
|
66
|
+
text
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
__name(gfmAutolinkLiteral, "gfmAutolinkLiteral");
|
|
70
|
+
var code = 48;
|
|
71
|
+
while (code < 123) {
|
|
72
|
+
text[code] = emailAutolink;
|
|
73
|
+
code++;
|
|
74
|
+
if (code === 58) code = 65;
|
|
75
|
+
else if (code === 91) code = 97;
|
|
76
|
+
}
|
|
77
|
+
text[43] = emailAutolink;
|
|
78
|
+
text[45] = emailAutolink;
|
|
79
|
+
text[46] = emailAutolink;
|
|
80
|
+
text[95] = emailAutolink;
|
|
81
|
+
text[72] = [emailAutolink, protocolAutolink];
|
|
82
|
+
text[104] = [emailAutolink, protocolAutolink];
|
|
83
|
+
text[87] = [emailAutolink, wwwAutolink];
|
|
84
|
+
text[119] = [emailAutolink, wwwAutolink];
|
|
85
|
+
function tokenizeEmailAutolink(effects, ok, nok) {
|
|
86
|
+
const self = this;
|
|
87
|
+
let dot;
|
|
88
|
+
let data;
|
|
89
|
+
return start;
|
|
90
|
+
function start(code2) {
|
|
91
|
+
if (!gfmAtext(code2) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {
|
|
92
|
+
return nok(code2);
|
|
93
|
+
}
|
|
94
|
+
effects.enter("literalAutolink");
|
|
95
|
+
effects.enter("literalAutolinkEmail");
|
|
96
|
+
return atext(code2);
|
|
97
|
+
}
|
|
98
|
+
__name(start, "start");
|
|
99
|
+
function atext(code2) {
|
|
100
|
+
if (gfmAtext(code2)) {
|
|
101
|
+
effects.consume(code2);
|
|
102
|
+
return atext;
|
|
103
|
+
}
|
|
104
|
+
if (code2 === 64) {
|
|
105
|
+
effects.consume(code2);
|
|
106
|
+
return emailDomain;
|
|
107
|
+
}
|
|
108
|
+
return nok(code2);
|
|
109
|
+
}
|
|
110
|
+
__name(atext, "atext");
|
|
111
|
+
function emailDomain(code2) {
|
|
112
|
+
if (code2 === 46) {
|
|
113
|
+
return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code2);
|
|
114
|
+
}
|
|
115
|
+
if (code2 === 45 || code2 === 95 || asciiAlphanumeric(code2)) {
|
|
116
|
+
data = true;
|
|
117
|
+
effects.consume(code2);
|
|
118
|
+
return emailDomain;
|
|
119
|
+
}
|
|
120
|
+
return emailDomainAfter(code2);
|
|
121
|
+
}
|
|
122
|
+
__name(emailDomain, "emailDomain");
|
|
123
|
+
function emailDomainDot(code2) {
|
|
124
|
+
effects.consume(code2);
|
|
125
|
+
dot = true;
|
|
126
|
+
return emailDomain;
|
|
127
|
+
}
|
|
128
|
+
__name(emailDomainDot, "emailDomainDot");
|
|
129
|
+
function emailDomainAfter(code2) {
|
|
130
|
+
if (data && dot && asciiAlpha(self.previous)) {
|
|
131
|
+
effects.exit("literalAutolinkEmail");
|
|
132
|
+
effects.exit("literalAutolink");
|
|
133
|
+
return ok(code2);
|
|
134
|
+
}
|
|
135
|
+
return nok(code2);
|
|
136
|
+
}
|
|
137
|
+
__name(emailDomainAfter, "emailDomainAfter");
|
|
138
|
+
}
|
|
139
|
+
__name(tokenizeEmailAutolink, "tokenizeEmailAutolink");
|
|
140
|
+
function tokenizeWwwAutolink(effects, ok, nok) {
|
|
141
|
+
const self = this;
|
|
142
|
+
return wwwStart;
|
|
143
|
+
function wwwStart(code2) {
|
|
144
|
+
if (code2 !== 87 && code2 !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {
|
|
145
|
+
return nok(code2);
|
|
146
|
+
}
|
|
147
|
+
effects.enter("literalAutolink");
|
|
148
|
+
effects.enter("literalAutolinkWww");
|
|
149
|
+
return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code2);
|
|
150
|
+
}
|
|
151
|
+
__name(wwwStart, "wwwStart");
|
|
152
|
+
function wwwAfter(code2) {
|
|
153
|
+
effects.exit("literalAutolinkWww");
|
|
154
|
+
effects.exit("literalAutolink");
|
|
155
|
+
return ok(code2);
|
|
156
|
+
}
|
|
157
|
+
__name(wwwAfter, "wwwAfter");
|
|
158
|
+
}
|
|
159
|
+
__name(tokenizeWwwAutolink, "tokenizeWwwAutolink");
|
|
160
|
+
function tokenizeProtocolAutolink(effects, ok, nok) {
|
|
161
|
+
const self = this;
|
|
162
|
+
let buffer = "";
|
|
163
|
+
let seen = false;
|
|
164
|
+
return protocolStart;
|
|
165
|
+
function protocolStart(code2) {
|
|
166
|
+
if ((code2 === 72 || code2 === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {
|
|
167
|
+
effects.enter("literalAutolink");
|
|
168
|
+
effects.enter("literalAutolinkHttp");
|
|
169
|
+
buffer += String.fromCodePoint(code2);
|
|
170
|
+
effects.consume(code2);
|
|
171
|
+
return protocolPrefixInside;
|
|
172
|
+
}
|
|
173
|
+
return nok(code2);
|
|
174
|
+
}
|
|
175
|
+
__name(protocolStart, "protocolStart");
|
|
176
|
+
function protocolPrefixInside(code2) {
|
|
177
|
+
if (asciiAlpha(code2) && buffer.length < 5) {
|
|
178
|
+
buffer += String.fromCodePoint(code2);
|
|
179
|
+
effects.consume(code2);
|
|
180
|
+
return protocolPrefixInside;
|
|
181
|
+
}
|
|
182
|
+
if (code2 === 58) {
|
|
183
|
+
const protocol = buffer.toLowerCase();
|
|
184
|
+
if (protocol === "http" || protocol === "https") {
|
|
185
|
+
effects.consume(code2);
|
|
186
|
+
return protocolSlashesInside;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return nok(code2);
|
|
190
|
+
}
|
|
191
|
+
__name(protocolPrefixInside, "protocolPrefixInside");
|
|
192
|
+
function protocolSlashesInside(code2) {
|
|
193
|
+
if (code2 === 47) {
|
|
194
|
+
effects.consume(code2);
|
|
195
|
+
if (seen) {
|
|
196
|
+
return afterProtocol;
|
|
197
|
+
}
|
|
198
|
+
seen = true;
|
|
199
|
+
return protocolSlashesInside;
|
|
200
|
+
}
|
|
201
|
+
return nok(code2);
|
|
202
|
+
}
|
|
203
|
+
__name(protocolSlashesInside, "protocolSlashesInside");
|
|
204
|
+
function afterProtocol(code2) {
|
|
205
|
+
return code2 === null || asciiControl(code2) || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2) || unicodePunctuation(code2) ? nok(code2) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code2);
|
|
206
|
+
}
|
|
207
|
+
__name(afterProtocol, "afterProtocol");
|
|
208
|
+
function protocolAfter(code2) {
|
|
209
|
+
effects.exit("literalAutolinkHttp");
|
|
210
|
+
effects.exit("literalAutolink");
|
|
211
|
+
return ok(code2);
|
|
212
|
+
}
|
|
213
|
+
__name(protocolAfter, "protocolAfter");
|
|
214
|
+
}
|
|
215
|
+
__name(tokenizeProtocolAutolink, "tokenizeProtocolAutolink");
|
|
216
|
+
function tokenizeWwwPrefix(effects, ok, nok) {
|
|
217
|
+
let size = 0;
|
|
218
|
+
return wwwPrefixInside;
|
|
219
|
+
function wwwPrefixInside(code2) {
|
|
220
|
+
if ((code2 === 87 || code2 === 119) && size < 3) {
|
|
221
|
+
size++;
|
|
222
|
+
effects.consume(code2);
|
|
223
|
+
return wwwPrefixInside;
|
|
224
|
+
}
|
|
225
|
+
if (code2 === 46 && size === 3) {
|
|
226
|
+
effects.consume(code2);
|
|
227
|
+
return wwwPrefixAfter;
|
|
228
|
+
}
|
|
229
|
+
return nok(code2);
|
|
230
|
+
}
|
|
231
|
+
__name(wwwPrefixInside, "wwwPrefixInside");
|
|
232
|
+
function wwwPrefixAfter(code2) {
|
|
233
|
+
return code2 === null ? nok(code2) : ok(code2);
|
|
234
|
+
}
|
|
235
|
+
__name(wwwPrefixAfter, "wwwPrefixAfter");
|
|
236
|
+
}
|
|
237
|
+
__name(tokenizeWwwPrefix, "tokenizeWwwPrefix");
|
|
238
|
+
function tokenizeDomain(effects, ok, nok) {
|
|
239
|
+
let underscoreInLastSegment;
|
|
240
|
+
let underscoreInLastLastSegment;
|
|
241
|
+
let seen;
|
|
242
|
+
return domainInside;
|
|
243
|
+
function domainInside(code2) {
|
|
244
|
+
if (code2 === 46 || code2 === 95) {
|
|
245
|
+
return effects.check(trail, domainAfter, domainAtPunctuation)(code2);
|
|
246
|
+
}
|
|
247
|
+
if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2) || code2 !== 45 && unicodePunctuation(code2)) {
|
|
248
|
+
return domainAfter(code2);
|
|
249
|
+
}
|
|
250
|
+
seen = true;
|
|
251
|
+
effects.consume(code2);
|
|
252
|
+
return domainInside;
|
|
253
|
+
}
|
|
254
|
+
__name(domainInside, "domainInside");
|
|
255
|
+
function domainAtPunctuation(code2) {
|
|
256
|
+
if (code2 === 95) {
|
|
257
|
+
underscoreInLastSegment = true;
|
|
258
|
+
} else {
|
|
259
|
+
underscoreInLastLastSegment = underscoreInLastSegment;
|
|
260
|
+
underscoreInLastSegment = void 0;
|
|
261
|
+
}
|
|
262
|
+
effects.consume(code2);
|
|
263
|
+
return domainInside;
|
|
264
|
+
}
|
|
265
|
+
__name(domainAtPunctuation, "domainAtPunctuation");
|
|
266
|
+
function domainAfter(code2) {
|
|
267
|
+
if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {
|
|
268
|
+
return nok(code2);
|
|
269
|
+
}
|
|
270
|
+
return ok(code2);
|
|
271
|
+
}
|
|
272
|
+
__name(domainAfter, "domainAfter");
|
|
273
|
+
}
|
|
274
|
+
__name(tokenizeDomain, "tokenizeDomain");
|
|
275
|
+
function tokenizePath(effects, ok) {
|
|
276
|
+
let sizeOpen = 0;
|
|
277
|
+
let sizeClose = 0;
|
|
278
|
+
return pathInside;
|
|
279
|
+
function pathInside(code2) {
|
|
280
|
+
if (code2 === 40) {
|
|
281
|
+
sizeOpen++;
|
|
282
|
+
effects.consume(code2);
|
|
283
|
+
return pathInside;
|
|
284
|
+
}
|
|
285
|
+
if (code2 === 41 && sizeClose < sizeOpen) {
|
|
286
|
+
return pathAtPunctuation(code2);
|
|
287
|
+
}
|
|
288
|
+
if (code2 === 33 || code2 === 34 || code2 === 38 || code2 === 39 || code2 === 41 || code2 === 42 || code2 === 44 || code2 === 46 || code2 === 58 || code2 === 59 || code2 === 60 || code2 === 63 || code2 === 93 || code2 === 95 || code2 === 126) {
|
|
289
|
+
return effects.check(trail, ok, pathAtPunctuation)(code2);
|
|
290
|
+
}
|
|
291
|
+
if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
|
|
292
|
+
return ok(code2);
|
|
293
|
+
}
|
|
294
|
+
effects.consume(code2);
|
|
295
|
+
return pathInside;
|
|
296
|
+
}
|
|
297
|
+
__name(pathInside, "pathInside");
|
|
298
|
+
function pathAtPunctuation(code2) {
|
|
299
|
+
if (code2 === 41) {
|
|
300
|
+
sizeClose++;
|
|
301
|
+
}
|
|
302
|
+
effects.consume(code2);
|
|
303
|
+
return pathInside;
|
|
304
|
+
}
|
|
305
|
+
__name(pathAtPunctuation, "pathAtPunctuation");
|
|
306
|
+
}
|
|
307
|
+
__name(tokenizePath, "tokenizePath");
|
|
308
|
+
function tokenizeTrail(effects, ok, nok) {
|
|
309
|
+
return trail2;
|
|
310
|
+
function trail2(code2) {
|
|
311
|
+
if (code2 === 33 || code2 === 34 || code2 === 39 || code2 === 41 || code2 === 42 || code2 === 44 || code2 === 46 || code2 === 58 || code2 === 59 || code2 === 63 || code2 === 95 || code2 === 126) {
|
|
312
|
+
effects.consume(code2);
|
|
313
|
+
return trail2;
|
|
314
|
+
}
|
|
315
|
+
if (code2 === 38) {
|
|
316
|
+
effects.consume(code2);
|
|
317
|
+
return trailCharacterReferenceStart;
|
|
318
|
+
}
|
|
319
|
+
if (code2 === 93) {
|
|
320
|
+
effects.consume(code2);
|
|
321
|
+
return trailBracketAfter;
|
|
322
|
+
}
|
|
323
|
+
if (
|
|
324
|
+
// `<` is an end.
|
|
325
|
+
code2 === 60 || // So is whitespace.
|
|
326
|
+
code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)
|
|
327
|
+
) {
|
|
328
|
+
return ok(code2);
|
|
329
|
+
}
|
|
330
|
+
return nok(code2);
|
|
331
|
+
}
|
|
332
|
+
__name(trail2, "trail");
|
|
333
|
+
function trailBracketAfter(code2) {
|
|
334
|
+
if (code2 === null || code2 === 40 || code2 === 91 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
|
|
335
|
+
return ok(code2);
|
|
336
|
+
}
|
|
337
|
+
return trail2(code2);
|
|
338
|
+
}
|
|
339
|
+
__name(trailBracketAfter, "trailBracketAfter");
|
|
340
|
+
function trailCharacterReferenceStart(code2) {
|
|
341
|
+
return asciiAlpha(code2) ? trailCharacterReferenceInside(code2) : nok(code2);
|
|
342
|
+
}
|
|
343
|
+
__name(trailCharacterReferenceStart, "trailCharacterReferenceStart");
|
|
344
|
+
function trailCharacterReferenceInside(code2) {
|
|
345
|
+
if (code2 === 59) {
|
|
346
|
+
effects.consume(code2);
|
|
347
|
+
return trail2;
|
|
348
|
+
}
|
|
349
|
+
if (asciiAlpha(code2)) {
|
|
350
|
+
effects.consume(code2);
|
|
351
|
+
return trailCharacterReferenceInside;
|
|
352
|
+
}
|
|
353
|
+
return nok(code2);
|
|
354
|
+
}
|
|
355
|
+
__name(trailCharacterReferenceInside, "trailCharacterReferenceInside");
|
|
356
|
+
}
|
|
357
|
+
__name(tokenizeTrail, "tokenizeTrail");
|
|
358
|
+
function tokenizeEmailDomainDotTrail(effects, ok, nok) {
|
|
359
|
+
return start;
|
|
360
|
+
function start(code2) {
|
|
361
|
+
effects.consume(code2);
|
|
362
|
+
return after;
|
|
363
|
+
}
|
|
364
|
+
__name(start, "start");
|
|
365
|
+
function after(code2) {
|
|
366
|
+
return asciiAlphanumeric(code2) ? nok(code2) : ok(code2);
|
|
367
|
+
}
|
|
368
|
+
__name(after, "after");
|
|
369
|
+
}
|
|
370
|
+
__name(tokenizeEmailDomainDotTrail, "tokenizeEmailDomainDotTrail");
|
|
371
|
+
function previousWww(code2) {
|
|
372
|
+
return code2 === null || code2 === 40 || code2 === 42 || code2 === 95 || code2 === 91 || code2 === 93 || code2 === 126 || markdownLineEndingOrSpace(code2);
|
|
373
|
+
}
|
|
374
|
+
__name(previousWww, "previousWww");
|
|
375
|
+
function previousProtocol(code2) {
|
|
376
|
+
return !asciiAlpha(code2);
|
|
377
|
+
}
|
|
378
|
+
__name(previousProtocol, "previousProtocol");
|
|
379
|
+
function previousEmail(code2) {
|
|
380
|
+
return !(code2 === 47 || gfmAtext(code2));
|
|
381
|
+
}
|
|
382
|
+
__name(previousEmail, "previousEmail");
|
|
383
|
+
function gfmAtext(code2) {
|
|
384
|
+
return code2 === 43 || code2 === 45 || code2 === 46 || code2 === 95 || asciiAlphanumeric(code2);
|
|
385
|
+
}
|
|
386
|
+
__name(gfmAtext, "gfmAtext");
|
|
387
|
+
function previousUnbalanced(events) {
|
|
388
|
+
let index = events.length;
|
|
389
|
+
let result = false;
|
|
390
|
+
while (index--) {
|
|
391
|
+
const token = events[index][1];
|
|
392
|
+
if ((token.type === "labelLink" || token.type === "labelImage") && !token._balanced) {
|
|
393
|
+
result = true;
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
if (token._gfmAutolinkLiteralWalkedInto) {
|
|
397
|
+
result = false;
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (events.length > 0 && !result) {
|
|
402
|
+
events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;
|
|
403
|
+
}
|
|
404
|
+
return result;
|
|
405
|
+
}
|
|
406
|
+
__name(previousUnbalanced, "previousUnbalanced");
|
|
407
|
+
|
|
408
|
+
// node_modules/.pnpm/micromark-util-encode@2.0.1/node_modules/micromark-util-encode/index.js
|
|
409
|
+
var characterReferences = { '"': "quot", "&": "amp", "<": "lt", ">": "gt" };
|
|
410
|
+
function encode(value) {
|
|
411
|
+
return value.replace(/["&<>]/g, replace2);
|
|
412
|
+
function replace2(value2) {
|
|
413
|
+
return "&" + characterReferences[
|
|
414
|
+
/** @type {keyof typeof characterReferences} */
|
|
415
|
+
value2
|
|
416
|
+
] + ";";
|
|
417
|
+
}
|
|
418
|
+
__name(replace2, "replace");
|
|
419
|
+
}
|
|
420
|
+
__name(encode, "encode");
|
|
421
|
+
|
|
422
|
+
// node_modules/.pnpm/micromark-util-sanitize-uri@2.0.1/node_modules/micromark-util-sanitize-uri/index.js
|
|
423
|
+
function sanitizeUri(url, protocol) {
|
|
424
|
+
const value = encode(normalizeUri(url || ""));
|
|
425
|
+
if (!protocol) {
|
|
426
|
+
return value;
|
|
427
|
+
}
|
|
428
|
+
const colon = value.indexOf(":");
|
|
429
|
+
const questionMark = value.indexOf("?");
|
|
430
|
+
const numberSign = value.indexOf("#");
|
|
431
|
+
const slash = value.indexOf("/");
|
|
432
|
+
if (
|
|
433
|
+
// If there is no protocol, it’s relative.
|
|
434
|
+
colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
|
|
435
|
+
slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign || // It is a protocol, it should be allowed.
|
|
436
|
+
protocol.test(value.slice(0, colon))
|
|
437
|
+
) {
|
|
438
|
+
return value;
|
|
439
|
+
}
|
|
440
|
+
return "";
|
|
441
|
+
}
|
|
442
|
+
__name(sanitizeUri, "sanitizeUri");
|
|
443
|
+
function normalizeUri(value) {
|
|
444
|
+
const result = [];
|
|
445
|
+
let index = -1;
|
|
446
|
+
let start = 0;
|
|
447
|
+
let skip = 0;
|
|
448
|
+
while (++index < value.length) {
|
|
449
|
+
const code2 = value.charCodeAt(index);
|
|
450
|
+
let replace2 = "";
|
|
451
|
+
if (code2 === 37 && asciiAlphanumeric(value.charCodeAt(index + 1)) && asciiAlphanumeric(value.charCodeAt(index + 2))) {
|
|
452
|
+
skip = 2;
|
|
453
|
+
} else if (code2 < 128) {
|
|
454
|
+
if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code2))) {
|
|
455
|
+
replace2 = String.fromCharCode(code2);
|
|
456
|
+
}
|
|
457
|
+
} else if (code2 > 55295 && code2 < 57344) {
|
|
458
|
+
const next = value.charCodeAt(index + 1);
|
|
459
|
+
if (code2 < 56320 && next > 56319 && next < 57344) {
|
|
460
|
+
replace2 = String.fromCharCode(code2, next);
|
|
461
|
+
skip = 1;
|
|
462
|
+
} else {
|
|
463
|
+
replace2 = "\uFFFD";
|
|
464
|
+
}
|
|
465
|
+
} else {
|
|
466
|
+
replace2 = String.fromCharCode(code2);
|
|
467
|
+
}
|
|
468
|
+
if (replace2) {
|
|
469
|
+
result.push(value.slice(start, index), encodeURIComponent(replace2));
|
|
470
|
+
start = index + skip + 1;
|
|
471
|
+
replace2 = "";
|
|
472
|
+
}
|
|
473
|
+
if (skip) {
|
|
474
|
+
index += skip;
|
|
475
|
+
skip = 0;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return result.join("") + value.slice(start);
|
|
479
|
+
}
|
|
480
|
+
__name(normalizeUri, "normalizeUri");
|
|
481
|
+
|
|
482
|
+
// node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.1.0/node_modules/micromark-extension-gfm-autolink-literal/lib/html.js
|
|
483
|
+
function gfmAutolinkLiteralHtml() {
|
|
484
|
+
return {
|
|
485
|
+
exit: {
|
|
486
|
+
literalAutolinkEmail,
|
|
487
|
+
literalAutolinkHttp,
|
|
488
|
+
literalAutolinkWww
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
__name(gfmAutolinkLiteralHtml, "gfmAutolinkLiteralHtml");
|
|
493
|
+
function literalAutolinkWww(token) {
|
|
494
|
+
anchorFromToken.call(this, token, "http://");
|
|
495
|
+
}
|
|
496
|
+
__name(literalAutolinkWww, "literalAutolinkWww");
|
|
497
|
+
function literalAutolinkEmail(token) {
|
|
498
|
+
anchorFromToken.call(this, token, "mailto:");
|
|
499
|
+
}
|
|
500
|
+
__name(literalAutolinkEmail, "literalAutolinkEmail");
|
|
501
|
+
function literalAutolinkHttp(token) {
|
|
502
|
+
anchorFromToken.call(this, token);
|
|
503
|
+
}
|
|
504
|
+
__name(literalAutolinkHttp, "literalAutolinkHttp");
|
|
505
|
+
function anchorFromToken(token, protocol) {
|
|
506
|
+
const url = this.sliceSerialize(token);
|
|
507
|
+
this.tag('<a href="' + sanitizeUri((protocol || "") + url) + '">');
|
|
508
|
+
this.raw(this.encode(url));
|
|
509
|
+
this.tag("</a>");
|
|
510
|
+
}
|
|
511
|
+
__name(anchorFromToken, "anchorFromToken");
|
|
512
|
+
|
|
513
|
+
// node_modules/.pnpm/micromark-extension-gfm-footnote@2.1.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
514
|
+
var indent = {
|
|
515
|
+
tokenize: tokenizeIndent,
|
|
516
|
+
partial: true
|
|
517
|
+
};
|
|
518
|
+
function gfmFootnote() {
|
|
519
|
+
return {
|
|
520
|
+
document: {
|
|
521
|
+
[91]: {
|
|
522
|
+
name: "gfmFootnoteDefinition",
|
|
523
|
+
tokenize: tokenizeDefinitionStart,
|
|
524
|
+
continuation: {
|
|
525
|
+
tokenize: tokenizeDefinitionContinuation
|
|
526
|
+
},
|
|
527
|
+
exit: gfmFootnoteDefinitionEnd
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
text: {
|
|
531
|
+
[91]: {
|
|
532
|
+
name: "gfmFootnoteCall",
|
|
533
|
+
tokenize: tokenizeGfmFootnoteCall
|
|
534
|
+
},
|
|
535
|
+
[93]: {
|
|
536
|
+
name: "gfmPotentialFootnoteCall",
|
|
537
|
+
add: "after",
|
|
538
|
+
tokenize: tokenizePotentialGfmFootnoteCall,
|
|
539
|
+
resolveTo: resolveToPotentialGfmFootnoteCall
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
__name(gfmFootnote, "gfmFootnote");
|
|
545
|
+
function tokenizePotentialGfmFootnoteCall(effects, ok, nok) {
|
|
546
|
+
const self = this;
|
|
547
|
+
let index = self.events.length;
|
|
548
|
+
const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
|
|
549
|
+
let labelStart;
|
|
550
|
+
while (index--) {
|
|
551
|
+
const token = self.events[index][1];
|
|
552
|
+
if (token.type === "labelImage") {
|
|
553
|
+
labelStart = token;
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
if (token.type === "gfmFootnoteCall" || token.type === "labelLink" || token.type === "label" || token.type === "image" || token.type === "link") {
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return start;
|
|
561
|
+
function start(code2) {
|
|
562
|
+
if (!labelStart || !labelStart._balanced) {
|
|
563
|
+
return nok(code2);
|
|
564
|
+
}
|
|
565
|
+
const id = normalizeIdentifier(self.sliceSerialize({
|
|
566
|
+
start: labelStart.end,
|
|
567
|
+
end: self.now()
|
|
568
|
+
}));
|
|
569
|
+
if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {
|
|
570
|
+
return nok(code2);
|
|
571
|
+
}
|
|
572
|
+
effects.enter("gfmFootnoteCallLabelMarker");
|
|
573
|
+
effects.consume(code2);
|
|
574
|
+
effects.exit("gfmFootnoteCallLabelMarker");
|
|
575
|
+
return ok(code2);
|
|
576
|
+
}
|
|
577
|
+
__name(start, "start");
|
|
578
|
+
}
|
|
579
|
+
__name(tokenizePotentialGfmFootnoteCall, "tokenizePotentialGfmFootnoteCall");
|
|
580
|
+
function resolveToPotentialGfmFootnoteCall(events, context) {
|
|
581
|
+
let index = events.length;
|
|
582
|
+
let labelStart;
|
|
583
|
+
while (index--) {
|
|
584
|
+
if (events[index][1].type === "labelImage" && events[index][0] === "enter") {
|
|
585
|
+
labelStart = events[index][1];
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
events[index + 1][1].type = "data";
|
|
590
|
+
events[index + 3][1].type = "gfmFootnoteCallLabelMarker";
|
|
591
|
+
const call = {
|
|
592
|
+
type: "gfmFootnoteCall",
|
|
593
|
+
start: Object.assign({}, events[index + 3][1].start),
|
|
594
|
+
end: Object.assign({}, events[events.length - 1][1].end)
|
|
595
|
+
};
|
|
596
|
+
const marker = {
|
|
597
|
+
type: "gfmFootnoteCallMarker",
|
|
598
|
+
start: Object.assign({}, events[index + 3][1].end),
|
|
599
|
+
end: Object.assign({}, events[index + 3][1].end)
|
|
600
|
+
};
|
|
601
|
+
marker.end.column++;
|
|
602
|
+
marker.end.offset++;
|
|
603
|
+
marker.end._bufferIndex++;
|
|
604
|
+
const string = {
|
|
605
|
+
type: "gfmFootnoteCallString",
|
|
606
|
+
start: Object.assign({}, marker.end),
|
|
607
|
+
end: Object.assign({}, events[events.length - 1][1].start)
|
|
608
|
+
};
|
|
609
|
+
const chunk = {
|
|
610
|
+
type: "chunkString",
|
|
611
|
+
contentType: "string",
|
|
612
|
+
start: Object.assign({}, string.start),
|
|
613
|
+
end: Object.assign({}, string.end)
|
|
614
|
+
};
|
|
615
|
+
const replacement = [
|
|
616
|
+
// Take the `labelImageMarker` (now `data`, the `!`)
|
|
617
|
+
events[index + 1],
|
|
618
|
+
events[index + 2],
|
|
619
|
+
["enter", call, context],
|
|
620
|
+
// The `[`
|
|
621
|
+
events[index + 3],
|
|
622
|
+
events[index + 4],
|
|
623
|
+
// The `^`.
|
|
624
|
+
["enter", marker, context],
|
|
625
|
+
["exit", marker, context],
|
|
626
|
+
// Everything in between.
|
|
627
|
+
["enter", string, context],
|
|
628
|
+
["enter", chunk, context],
|
|
629
|
+
["exit", chunk, context],
|
|
630
|
+
["exit", string, context],
|
|
631
|
+
// The ending (`]`, properly parsed and labelled).
|
|
632
|
+
events[events.length - 2],
|
|
633
|
+
events[events.length - 1],
|
|
634
|
+
["exit", call, context]
|
|
635
|
+
];
|
|
636
|
+
events.splice(index, events.length - index + 1, ...replacement);
|
|
637
|
+
return events;
|
|
638
|
+
}
|
|
639
|
+
__name(resolveToPotentialGfmFootnoteCall, "resolveToPotentialGfmFootnoteCall");
|
|
640
|
+
function tokenizeGfmFootnoteCall(effects, ok, nok) {
|
|
641
|
+
const self = this;
|
|
642
|
+
const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
|
|
643
|
+
let size = 0;
|
|
644
|
+
let data;
|
|
645
|
+
return start;
|
|
646
|
+
function start(code2) {
|
|
647
|
+
effects.enter("gfmFootnoteCall");
|
|
648
|
+
effects.enter("gfmFootnoteCallLabelMarker");
|
|
649
|
+
effects.consume(code2);
|
|
650
|
+
effects.exit("gfmFootnoteCallLabelMarker");
|
|
651
|
+
return callStart;
|
|
652
|
+
}
|
|
653
|
+
__name(start, "start");
|
|
654
|
+
function callStart(code2) {
|
|
655
|
+
if (code2 !== 94) return nok(code2);
|
|
656
|
+
effects.enter("gfmFootnoteCallMarker");
|
|
657
|
+
effects.consume(code2);
|
|
658
|
+
effects.exit("gfmFootnoteCallMarker");
|
|
659
|
+
effects.enter("gfmFootnoteCallString");
|
|
660
|
+
effects.enter("chunkString").contentType = "string";
|
|
661
|
+
return callData;
|
|
662
|
+
}
|
|
663
|
+
__name(callStart, "callStart");
|
|
664
|
+
function callData(code2) {
|
|
665
|
+
if (
|
|
666
|
+
// Too long.
|
|
667
|
+
size > 999 || // Closing brace with nothing.
|
|
668
|
+
code2 === 93 && !data || // Space or tab is not supported by GFM for some reason.
|
|
669
|
+
// `\n` and `[` not being supported makes sense.
|
|
670
|
+
code2 === null || code2 === 91 || markdownLineEndingOrSpace(code2)
|
|
671
|
+
) {
|
|
672
|
+
return nok(code2);
|
|
673
|
+
}
|
|
674
|
+
if (code2 === 93) {
|
|
675
|
+
effects.exit("chunkString");
|
|
676
|
+
const token = effects.exit("gfmFootnoteCallString");
|
|
677
|
+
if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {
|
|
678
|
+
return nok(code2);
|
|
679
|
+
}
|
|
680
|
+
effects.enter("gfmFootnoteCallLabelMarker");
|
|
681
|
+
effects.consume(code2);
|
|
682
|
+
effects.exit("gfmFootnoteCallLabelMarker");
|
|
683
|
+
effects.exit("gfmFootnoteCall");
|
|
684
|
+
return ok;
|
|
685
|
+
}
|
|
686
|
+
if (!markdownLineEndingOrSpace(code2)) {
|
|
687
|
+
data = true;
|
|
688
|
+
}
|
|
689
|
+
size++;
|
|
690
|
+
effects.consume(code2);
|
|
691
|
+
return code2 === 92 ? callEscape : callData;
|
|
692
|
+
}
|
|
693
|
+
__name(callData, "callData");
|
|
694
|
+
function callEscape(code2) {
|
|
695
|
+
if (code2 === 91 || code2 === 92 || code2 === 93) {
|
|
696
|
+
effects.consume(code2);
|
|
697
|
+
size++;
|
|
698
|
+
return callData;
|
|
699
|
+
}
|
|
700
|
+
return callData(code2);
|
|
701
|
+
}
|
|
702
|
+
__name(callEscape, "callEscape");
|
|
703
|
+
}
|
|
704
|
+
__name(tokenizeGfmFootnoteCall, "tokenizeGfmFootnoteCall");
|
|
705
|
+
function tokenizeDefinitionStart(effects, ok, nok) {
|
|
706
|
+
const self = this;
|
|
707
|
+
const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
|
|
708
|
+
let identifier;
|
|
709
|
+
let size = 0;
|
|
710
|
+
let data;
|
|
711
|
+
return start;
|
|
712
|
+
function start(code2) {
|
|
713
|
+
effects.enter("gfmFootnoteDefinition")._container = true;
|
|
714
|
+
effects.enter("gfmFootnoteDefinitionLabel");
|
|
715
|
+
effects.enter("gfmFootnoteDefinitionLabelMarker");
|
|
716
|
+
effects.consume(code2);
|
|
717
|
+
effects.exit("gfmFootnoteDefinitionLabelMarker");
|
|
718
|
+
return labelAtMarker;
|
|
719
|
+
}
|
|
720
|
+
__name(start, "start");
|
|
721
|
+
function labelAtMarker(code2) {
|
|
722
|
+
if (code2 === 94) {
|
|
723
|
+
effects.enter("gfmFootnoteDefinitionMarker");
|
|
724
|
+
effects.consume(code2);
|
|
725
|
+
effects.exit("gfmFootnoteDefinitionMarker");
|
|
726
|
+
effects.enter("gfmFootnoteDefinitionLabelString");
|
|
727
|
+
effects.enter("chunkString").contentType = "string";
|
|
728
|
+
return labelInside;
|
|
729
|
+
}
|
|
730
|
+
return nok(code2);
|
|
731
|
+
}
|
|
732
|
+
__name(labelAtMarker, "labelAtMarker");
|
|
733
|
+
function labelInside(code2) {
|
|
734
|
+
if (
|
|
735
|
+
// Too long.
|
|
736
|
+
size > 999 || // Closing brace with nothing.
|
|
737
|
+
code2 === 93 && !data || // Space or tab is not supported by GFM for some reason.
|
|
738
|
+
// `\n` and `[` not being supported makes sense.
|
|
739
|
+
code2 === null || code2 === 91 || markdownLineEndingOrSpace(code2)
|
|
740
|
+
) {
|
|
741
|
+
return nok(code2);
|
|
742
|
+
}
|
|
743
|
+
if (code2 === 93) {
|
|
744
|
+
effects.exit("chunkString");
|
|
745
|
+
const token = effects.exit("gfmFootnoteDefinitionLabelString");
|
|
746
|
+
identifier = normalizeIdentifier(self.sliceSerialize(token));
|
|
747
|
+
effects.enter("gfmFootnoteDefinitionLabelMarker");
|
|
748
|
+
effects.consume(code2);
|
|
749
|
+
effects.exit("gfmFootnoteDefinitionLabelMarker");
|
|
750
|
+
effects.exit("gfmFootnoteDefinitionLabel");
|
|
751
|
+
return labelAfter;
|
|
752
|
+
}
|
|
753
|
+
if (!markdownLineEndingOrSpace(code2)) {
|
|
754
|
+
data = true;
|
|
755
|
+
}
|
|
756
|
+
size++;
|
|
757
|
+
effects.consume(code2);
|
|
758
|
+
return code2 === 92 ? labelEscape : labelInside;
|
|
759
|
+
}
|
|
760
|
+
__name(labelInside, "labelInside");
|
|
761
|
+
function labelEscape(code2) {
|
|
762
|
+
if (code2 === 91 || code2 === 92 || code2 === 93) {
|
|
763
|
+
effects.consume(code2);
|
|
764
|
+
size++;
|
|
765
|
+
return labelInside;
|
|
766
|
+
}
|
|
767
|
+
return labelInside(code2);
|
|
768
|
+
}
|
|
769
|
+
__name(labelEscape, "labelEscape");
|
|
770
|
+
function labelAfter(code2) {
|
|
771
|
+
if (code2 === 58) {
|
|
772
|
+
effects.enter("definitionMarker");
|
|
773
|
+
effects.consume(code2);
|
|
774
|
+
effects.exit("definitionMarker");
|
|
775
|
+
if (!defined.includes(identifier)) {
|
|
776
|
+
defined.push(identifier);
|
|
777
|
+
}
|
|
778
|
+
return factorySpace(effects, whitespaceAfter, "gfmFootnoteDefinitionWhitespace");
|
|
779
|
+
}
|
|
780
|
+
return nok(code2);
|
|
781
|
+
}
|
|
782
|
+
__name(labelAfter, "labelAfter");
|
|
783
|
+
function whitespaceAfter(code2) {
|
|
784
|
+
return ok(code2);
|
|
785
|
+
}
|
|
786
|
+
__name(whitespaceAfter, "whitespaceAfter");
|
|
787
|
+
}
|
|
788
|
+
__name(tokenizeDefinitionStart, "tokenizeDefinitionStart");
|
|
789
|
+
function tokenizeDefinitionContinuation(effects, ok, nok) {
|
|
790
|
+
return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));
|
|
791
|
+
}
|
|
792
|
+
__name(tokenizeDefinitionContinuation, "tokenizeDefinitionContinuation");
|
|
793
|
+
function gfmFootnoteDefinitionEnd(effects) {
|
|
794
|
+
effects.exit("gfmFootnoteDefinition");
|
|
795
|
+
}
|
|
796
|
+
__name(gfmFootnoteDefinitionEnd, "gfmFootnoteDefinitionEnd");
|
|
797
|
+
function tokenizeIndent(effects, ok, nok) {
|
|
798
|
+
const self = this;
|
|
799
|
+
return factorySpace(effects, afterPrefix, "gfmFootnoteDefinitionIndent", 4 + 1);
|
|
800
|
+
function afterPrefix(code2) {
|
|
801
|
+
const tail = self.events[self.events.length - 1];
|
|
802
|
+
return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code2) : nok(code2);
|
|
803
|
+
}
|
|
804
|
+
__name(afterPrefix, "afterPrefix");
|
|
805
|
+
}
|
|
806
|
+
__name(tokenizeIndent, "tokenizeIndent");
|
|
807
|
+
|
|
808
|
+
// node_modules/.pnpm/micromark-extension-gfm-footnote@2.1.0/node_modules/micromark-extension-gfm-footnote/lib/html.js
|
|
809
|
+
var own = {}.hasOwnProperty;
|
|
810
|
+
var emptyOptions = {};
|
|
811
|
+
function defaultBackLabel(referenceIndex, rereferenceIndex) {
|
|
812
|
+
return "Back to reference " + (referenceIndex + 1) + (rereferenceIndex > 1 ? "-" + rereferenceIndex : "");
|
|
813
|
+
}
|
|
814
|
+
__name(defaultBackLabel, "defaultBackLabel");
|
|
815
|
+
function gfmFootnoteHtml(options) {
|
|
816
|
+
const config = options || emptyOptions;
|
|
817
|
+
const label = config.label || "Footnotes";
|
|
818
|
+
const labelTagName = config.labelTagName || "h2";
|
|
819
|
+
const labelAttributes = config.labelAttributes === null || config.labelAttributes === void 0 ? 'class="sr-only"' : config.labelAttributes;
|
|
820
|
+
const backLabel = config.backLabel || defaultBackLabel;
|
|
821
|
+
const clobberPrefix = config.clobberPrefix === null || config.clobberPrefix === void 0 ? "user-content-" : config.clobberPrefix;
|
|
822
|
+
return {
|
|
823
|
+
enter: {
|
|
824
|
+
gfmFootnoteDefinition() {
|
|
825
|
+
const stack = this.getData("tightStack");
|
|
826
|
+
stack.push(false);
|
|
827
|
+
},
|
|
828
|
+
gfmFootnoteDefinitionLabelString() {
|
|
829
|
+
this.buffer();
|
|
830
|
+
},
|
|
831
|
+
gfmFootnoteCallString() {
|
|
832
|
+
this.buffer();
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
exit: {
|
|
836
|
+
gfmFootnoteDefinition() {
|
|
837
|
+
let definitions = this.getData("gfmFootnoteDefinitions");
|
|
838
|
+
const footnoteStack = this.getData("gfmFootnoteDefinitionStack");
|
|
839
|
+
const tightStack = this.getData("tightStack");
|
|
840
|
+
const current = footnoteStack.pop();
|
|
841
|
+
const value = this.resume();
|
|
842
|
+
if (!definitions) {
|
|
843
|
+
this.setData("gfmFootnoteDefinitions", definitions = {});
|
|
844
|
+
}
|
|
845
|
+
if (!own.call(definitions, current)) definitions[current] = value;
|
|
846
|
+
tightStack.pop();
|
|
847
|
+
this.setData("slurpOneLineEnding", true);
|
|
848
|
+
this.setData("lastWasTag");
|
|
849
|
+
},
|
|
850
|
+
gfmFootnoteDefinitionLabelString(token) {
|
|
851
|
+
let footnoteStack = this.getData("gfmFootnoteDefinitionStack");
|
|
852
|
+
if (!footnoteStack) {
|
|
853
|
+
this.setData("gfmFootnoteDefinitionStack", footnoteStack = []);
|
|
854
|
+
}
|
|
855
|
+
footnoteStack.push(normalizeIdentifier(this.sliceSerialize(token)));
|
|
856
|
+
this.resume();
|
|
857
|
+
this.buffer();
|
|
858
|
+
},
|
|
859
|
+
gfmFootnoteCallString(token) {
|
|
860
|
+
let calls = this.getData("gfmFootnoteCallOrder");
|
|
861
|
+
let counts = this.getData("gfmFootnoteCallCounts");
|
|
862
|
+
const id = normalizeIdentifier(this.sliceSerialize(token));
|
|
863
|
+
let counter;
|
|
864
|
+
this.resume();
|
|
865
|
+
if (!calls) this.setData("gfmFootnoteCallOrder", calls = []);
|
|
866
|
+
if (!counts) this.setData("gfmFootnoteCallCounts", counts = {});
|
|
867
|
+
const index = calls.indexOf(id);
|
|
868
|
+
const safeId = sanitizeUri(id.toLowerCase());
|
|
869
|
+
if (index === -1) {
|
|
870
|
+
calls.push(id);
|
|
871
|
+
counts[id] = 1;
|
|
872
|
+
counter = calls.length;
|
|
873
|
+
} else {
|
|
874
|
+
counts[id]++;
|
|
875
|
+
counter = index + 1;
|
|
876
|
+
}
|
|
877
|
+
const reuseCounter = counts[id];
|
|
878
|
+
this.tag('<sup><a href="#' + clobberPrefix + "fn-" + safeId + '" id="' + clobberPrefix + "fnref-" + safeId + (reuseCounter > 1 ? "-" + reuseCounter : "") + '" data-footnote-ref="" aria-describedby="footnote-label">' + String(counter) + "</a></sup>");
|
|
879
|
+
},
|
|
880
|
+
null() {
|
|
881
|
+
const calls = this.getData("gfmFootnoteCallOrder") || [];
|
|
882
|
+
const counts = this.getData("gfmFootnoteCallCounts") || {};
|
|
883
|
+
const definitions = this.getData("gfmFootnoteDefinitions") || {};
|
|
884
|
+
let index = -1;
|
|
885
|
+
if (calls.length > 0) {
|
|
886
|
+
this.lineEndingIfNeeded();
|
|
887
|
+
this.tag('<section data-footnotes="" class="footnotes"><' + labelTagName + ' id="footnote-label"' + (labelAttributes ? " " + labelAttributes : "") + ">");
|
|
888
|
+
this.raw(this.encode(label));
|
|
889
|
+
this.tag("</" + labelTagName + ">");
|
|
890
|
+
this.lineEndingIfNeeded();
|
|
891
|
+
this.tag("<ol>");
|
|
892
|
+
}
|
|
893
|
+
while (++index < calls.length) {
|
|
894
|
+
const id = calls[index];
|
|
895
|
+
const safeId = sanitizeUri(id.toLowerCase());
|
|
896
|
+
let referenceIndex = 0;
|
|
897
|
+
const references = [];
|
|
898
|
+
while (++referenceIndex <= counts[id]) {
|
|
899
|
+
references.push('<a href="#' + clobberPrefix + "fnref-" + safeId + (referenceIndex > 1 ? "-" + referenceIndex : "") + '" data-footnote-backref="" aria-label="' + this.encode(typeof backLabel === "string" ? backLabel : backLabel(index, referenceIndex)) + '" class="data-footnote-backref">\u21A9' + (referenceIndex > 1 ? "<sup>" + referenceIndex + "</sup>" : "") + "</a>");
|
|
900
|
+
}
|
|
901
|
+
const reference = references.join(" ");
|
|
902
|
+
let injected = false;
|
|
903
|
+
this.lineEndingIfNeeded();
|
|
904
|
+
this.tag('<li id="' + clobberPrefix + "fn-" + safeId + '">');
|
|
905
|
+
this.lineEndingIfNeeded();
|
|
906
|
+
this.tag(definitions[id].replace(/<\/p>(?:\r?\n|\r)?$/, function($0) {
|
|
907
|
+
injected = true;
|
|
908
|
+
return " " + reference + $0;
|
|
909
|
+
}));
|
|
910
|
+
if (!injected) {
|
|
911
|
+
this.lineEndingIfNeeded();
|
|
912
|
+
this.tag(reference);
|
|
913
|
+
}
|
|
914
|
+
this.lineEndingIfNeeded();
|
|
915
|
+
this.tag("</li>");
|
|
916
|
+
}
|
|
917
|
+
if (calls.length > 0) {
|
|
918
|
+
this.lineEndingIfNeeded();
|
|
919
|
+
this.tag("</ol>");
|
|
920
|
+
this.lineEndingIfNeeded();
|
|
921
|
+
this.tag("</section>");
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
__name(gfmFootnoteHtml, "gfmFootnoteHtml");
|
|
928
|
+
|
|
929
|
+
// node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.1.0/node_modules/micromark-extension-gfm-strikethrough/lib/html.js
|
|
930
|
+
function gfmStrikethroughHtml() {
|
|
931
|
+
return {
|
|
932
|
+
enter: {
|
|
933
|
+
strikethrough() {
|
|
934
|
+
this.tag("<del>");
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
exit: {
|
|
938
|
+
strikethrough() {
|
|
939
|
+
this.tag("</del>");
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
__name(gfmStrikethroughHtml, "gfmStrikethroughHtml");
|
|
945
|
+
|
|
946
|
+
// node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.1.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
947
|
+
function gfmStrikethrough(options) {
|
|
948
|
+
const options_ = options || {};
|
|
949
|
+
let single = options_.singleTilde;
|
|
950
|
+
const tokenizer = {
|
|
951
|
+
name: "strikethrough",
|
|
952
|
+
tokenize: tokenizeStrikethrough,
|
|
953
|
+
resolveAll: resolveAllStrikethrough
|
|
954
|
+
};
|
|
955
|
+
if (single === null || single === void 0) {
|
|
956
|
+
single = true;
|
|
957
|
+
}
|
|
958
|
+
return {
|
|
959
|
+
text: {
|
|
960
|
+
[126]: tokenizer
|
|
961
|
+
},
|
|
962
|
+
insideSpan: {
|
|
963
|
+
null: [tokenizer]
|
|
964
|
+
},
|
|
965
|
+
attentionMarkers: {
|
|
966
|
+
null: [126]
|
|
967
|
+
}
|
|
968
|
+
};
|
|
969
|
+
function resolveAllStrikethrough(events, context) {
|
|
970
|
+
let index = -1;
|
|
971
|
+
while (++index < events.length) {
|
|
972
|
+
if (events[index][0] === "enter" && events[index][1].type === "strikethroughSequenceTemporary" && events[index][1]._close) {
|
|
973
|
+
let open = index;
|
|
974
|
+
while (open--) {
|
|
975
|
+
if (events[open][0] === "exit" && events[open][1].type === "strikethroughSequenceTemporary" && events[open][1]._open && // If the sizes are the same:
|
|
976
|
+
events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {
|
|
977
|
+
events[index][1].type = "strikethroughSequence";
|
|
978
|
+
events[open][1].type = "strikethroughSequence";
|
|
979
|
+
const strikethrough = {
|
|
980
|
+
type: "strikethrough",
|
|
981
|
+
start: Object.assign({}, events[open][1].start),
|
|
982
|
+
end: Object.assign({}, events[index][1].end)
|
|
983
|
+
};
|
|
984
|
+
const text2 = {
|
|
985
|
+
type: "strikethroughText",
|
|
986
|
+
start: Object.assign({}, events[open][1].end),
|
|
987
|
+
end: Object.assign({}, events[index][1].start)
|
|
988
|
+
};
|
|
989
|
+
const nextEvents = [["enter", strikethrough, context], ["enter", events[open][1], context], ["exit", events[open][1], context], ["enter", text2, context]];
|
|
990
|
+
const insideSpan = context.parser.constructs.insideSpan.null;
|
|
991
|
+
if (insideSpan) {
|
|
992
|
+
splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));
|
|
993
|
+
}
|
|
994
|
+
splice(nextEvents, nextEvents.length, 0, [["exit", text2, context], ["enter", events[index][1], context], ["exit", events[index][1], context], ["exit", strikethrough, context]]);
|
|
995
|
+
splice(events, open - 1, index - open + 3, nextEvents);
|
|
996
|
+
index = open + nextEvents.length - 2;
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
index = -1;
|
|
1003
|
+
while (++index < events.length) {
|
|
1004
|
+
if (events[index][1].type === "strikethroughSequenceTemporary") {
|
|
1005
|
+
events[index][1].type = "data";
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return events;
|
|
1009
|
+
}
|
|
1010
|
+
__name(resolveAllStrikethrough, "resolveAllStrikethrough");
|
|
1011
|
+
function tokenizeStrikethrough(effects, ok, nok) {
|
|
1012
|
+
const previous = this.previous;
|
|
1013
|
+
const events = this.events;
|
|
1014
|
+
let size = 0;
|
|
1015
|
+
return start;
|
|
1016
|
+
function start(code2) {
|
|
1017
|
+
if (previous === 126 && events[events.length - 1][1].type !== "characterEscape") {
|
|
1018
|
+
return nok(code2);
|
|
1019
|
+
}
|
|
1020
|
+
effects.enter("strikethroughSequenceTemporary");
|
|
1021
|
+
return more(code2);
|
|
1022
|
+
}
|
|
1023
|
+
__name(start, "start");
|
|
1024
|
+
function more(code2) {
|
|
1025
|
+
const before = classifyCharacter(previous);
|
|
1026
|
+
if (code2 === 126) {
|
|
1027
|
+
if (size > 1) return nok(code2);
|
|
1028
|
+
effects.consume(code2);
|
|
1029
|
+
size++;
|
|
1030
|
+
return more;
|
|
1031
|
+
}
|
|
1032
|
+
if (size < 2 && !single) return nok(code2);
|
|
1033
|
+
const token = effects.exit("strikethroughSequenceTemporary");
|
|
1034
|
+
const after = classifyCharacter(code2);
|
|
1035
|
+
token._open = !after || after === 2 && Boolean(before);
|
|
1036
|
+
token._close = !before || before === 2 && Boolean(after);
|
|
1037
|
+
return ok(code2);
|
|
1038
|
+
}
|
|
1039
|
+
__name(more, "more");
|
|
1040
|
+
}
|
|
1041
|
+
__name(tokenizeStrikethrough, "tokenizeStrikethrough");
|
|
1042
|
+
}
|
|
1043
|
+
__name(gfmStrikethrough, "gfmStrikethrough");
|
|
1044
|
+
|
|
1045
|
+
// node_modules/.pnpm/micromark-extension-gfm-table@2.1.2/node_modules/micromark-extension-gfm-table/lib/html.js
|
|
1046
|
+
var alignment = {
|
|
1047
|
+
none: "",
|
|
1048
|
+
left: ' align="left"',
|
|
1049
|
+
right: ' align="right"',
|
|
1050
|
+
center: ' align="center"'
|
|
1051
|
+
};
|
|
1052
|
+
function gfmTableHtml() {
|
|
1053
|
+
return {
|
|
1054
|
+
enter: {
|
|
1055
|
+
table(token) {
|
|
1056
|
+
const tableAlign = token._align;
|
|
1057
|
+
this.lineEndingIfNeeded();
|
|
1058
|
+
this.tag("<table>");
|
|
1059
|
+
this.setData("tableAlign", tableAlign);
|
|
1060
|
+
},
|
|
1061
|
+
tableBody() {
|
|
1062
|
+
this.tag("<tbody>");
|
|
1063
|
+
},
|
|
1064
|
+
tableData() {
|
|
1065
|
+
const tableAlign = this.getData("tableAlign");
|
|
1066
|
+
const tableColumn = this.getData("tableColumn");
|
|
1067
|
+
const align = alignment[tableAlign[tableColumn]];
|
|
1068
|
+
if (align === void 0) {
|
|
1069
|
+
this.buffer();
|
|
1070
|
+
} else {
|
|
1071
|
+
this.lineEndingIfNeeded();
|
|
1072
|
+
this.tag("<td" + align + ">");
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
tableHead() {
|
|
1076
|
+
this.lineEndingIfNeeded();
|
|
1077
|
+
this.tag("<thead>");
|
|
1078
|
+
},
|
|
1079
|
+
tableHeader() {
|
|
1080
|
+
const tableAlign = this.getData("tableAlign");
|
|
1081
|
+
const tableColumn = this.getData("tableColumn");
|
|
1082
|
+
const align = alignment[tableAlign[tableColumn]];
|
|
1083
|
+
this.lineEndingIfNeeded();
|
|
1084
|
+
this.tag("<th" + align + ">");
|
|
1085
|
+
},
|
|
1086
|
+
tableRow() {
|
|
1087
|
+
this.setData("tableColumn", 0);
|
|
1088
|
+
this.lineEndingIfNeeded();
|
|
1089
|
+
this.tag("<tr>");
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
exit: {
|
|
1093
|
+
// Overwrite the default code text data handler to unescape escaped pipes when
|
|
1094
|
+
// they are in tables.
|
|
1095
|
+
codeTextData(token) {
|
|
1096
|
+
let value = this.sliceSerialize(token);
|
|
1097
|
+
if (this.getData("tableAlign")) {
|
|
1098
|
+
value = value.replace(/\\([\\|])/g, replace);
|
|
1099
|
+
}
|
|
1100
|
+
this.raw(this.encode(value));
|
|
1101
|
+
},
|
|
1102
|
+
table() {
|
|
1103
|
+
this.setData("tableAlign");
|
|
1104
|
+
this.setData("slurpAllLineEndings");
|
|
1105
|
+
this.lineEndingIfNeeded();
|
|
1106
|
+
this.tag("</table>");
|
|
1107
|
+
},
|
|
1108
|
+
tableBody() {
|
|
1109
|
+
this.lineEndingIfNeeded();
|
|
1110
|
+
this.tag("</tbody>");
|
|
1111
|
+
},
|
|
1112
|
+
tableData() {
|
|
1113
|
+
const tableAlign = this.getData("tableAlign");
|
|
1114
|
+
const tableColumn = this.getData("tableColumn");
|
|
1115
|
+
if (tableColumn in tableAlign) {
|
|
1116
|
+
this.tag("</td>");
|
|
1117
|
+
this.setData("tableColumn", tableColumn + 1);
|
|
1118
|
+
} else {
|
|
1119
|
+
this.resume();
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
tableHead() {
|
|
1123
|
+
this.lineEndingIfNeeded();
|
|
1124
|
+
this.tag("</thead>");
|
|
1125
|
+
},
|
|
1126
|
+
tableHeader() {
|
|
1127
|
+
const tableColumn = this.getData("tableColumn");
|
|
1128
|
+
this.tag("</th>");
|
|
1129
|
+
this.setData("tableColumn", tableColumn + 1);
|
|
1130
|
+
},
|
|
1131
|
+
tableRow() {
|
|
1132
|
+
const tableAlign = this.getData("tableAlign");
|
|
1133
|
+
let tableColumn = this.getData("tableColumn");
|
|
1134
|
+
while (tableColumn < tableAlign.length) {
|
|
1135
|
+
this.lineEndingIfNeeded();
|
|
1136
|
+
this.tag("<td" + alignment[tableAlign[tableColumn]] + "></td>");
|
|
1137
|
+
tableColumn++;
|
|
1138
|
+
}
|
|
1139
|
+
this.setData("tableColumn", tableColumn);
|
|
1140
|
+
this.lineEndingIfNeeded();
|
|
1141
|
+
this.tag("</tr>");
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
__name(gfmTableHtml, "gfmTableHtml");
|
|
1147
|
+
function replace($0, $1) {
|
|
1148
|
+
return $1 === "|" ? $1 : $0;
|
|
1149
|
+
}
|
|
1150
|
+
__name(replace, "replace");
|
|
1151
|
+
|
|
1152
|
+
// node_modules/.pnpm/micromark-extension-gfm-table@2.1.2/node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
1153
|
+
var EditMap = class {
|
|
1154
|
+
static {
|
|
1155
|
+
__name(this, "EditMap");
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Create a new edit map.
|
|
1159
|
+
*/
|
|
1160
|
+
constructor() {
|
|
1161
|
+
this.map = [];
|
|
1162
|
+
this.index = /* @__PURE__ */ new Map();
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Create an edit: a remove and/or add at a certain place.
|
|
1166
|
+
*
|
|
1167
|
+
* @param {number} index
|
|
1168
|
+
* Index at which to apply the edit.
|
|
1169
|
+
* @param {number} remove
|
|
1170
|
+
* Count of items to remove at the index.
|
|
1171
|
+
* @param {Array<Event>} add
|
|
1172
|
+
* Items to add at the index.
|
|
1173
|
+
* @returns {undefined}
|
|
1174
|
+
* Nothing.
|
|
1175
|
+
*/
|
|
1176
|
+
add(index, remove, add) {
|
|
1177
|
+
addImplementation(this, index, remove, add);
|
|
1178
|
+
}
|
|
1179
|
+
// To do: add this when moving to `micromark`.
|
|
1180
|
+
// /**
|
|
1181
|
+
// * Create an edit: but insert `add` before existing additions.
|
|
1182
|
+
// *
|
|
1183
|
+
// * @param {number} index
|
|
1184
|
+
// * @param {number} remove
|
|
1185
|
+
// * @param {Array<Event>} add
|
|
1186
|
+
// * @returns {undefined}
|
|
1187
|
+
// */
|
|
1188
|
+
// addBefore(index, remove, add) {
|
|
1189
|
+
// addImplementation(this, index, remove, add, true)
|
|
1190
|
+
// }
|
|
1191
|
+
/**
|
|
1192
|
+
* Done, change the events.
|
|
1193
|
+
*
|
|
1194
|
+
* @param {Array<Event>} events
|
|
1195
|
+
* List of events to apply the edits to.
|
|
1196
|
+
* @returns {undefined}
|
|
1197
|
+
* Nothing.
|
|
1198
|
+
*/
|
|
1199
|
+
consume(events) {
|
|
1200
|
+
this.map.sort(function(a, b) {
|
|
1201
|
+
return a[0] - b[0];
|
|
1202
|
+
});
|
|
1203
|
+
if (this.map.length === 0) {
|
|
1204
|
+
return;
|
|
1205
|
+
}
|
|
1206
|
+
let index = this.map.length;
|
|
1207
|
+
const vecs = [];
|
|
1208
|
+
while (index > 0) {
|
|
1209
|
+
index -= 1;
|
|
1210
|
+
vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);
|
|
1211
|
+
events.length = this.map[index][0];
|
|
1212
|
+
}
|
|
1213
|
+
vecs.push(events.slice());
|
|
1214
|
+
events.length = 0;
|
|
1215
|
+
let slice = vecs.pop();
|
|
1216
|
+
while (slice) {
|
|
1217
|
+
for (const element of slice) {
|
|
1218
|
+
events.push(element);
|
|
1219
|
+
}
|
|
1220
|
+
slice = vecs.pop();
|
|
1221
|
+
}
|
|
1222
|
+
this.map.length = 0;
|
|
1223
|
+
this.index.clear();
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
function addImplementation(editMap, at, remove, add) {
|
|
1227
|
+
if (remove === 0 && add.length === 0) {
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
const existing = editMap.index.get(at);
|
|
1231
|
+
if (existing) {
|
|
1232
|
+
existing[1] += remove;
|
|
1233
|
+
existing[2].push(...add);
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
const change = [at, remove, add];
|
|
1237
|
+
editMap.map.push(change);
|
|
1238
|
+
editMap.index.set(at, change);
|
|
1239
|
+
}
|
|
1240
|
+
__name(addImplementation, "addImplementation");
|
|
1241
|
+
|
|
1242
|
+
// node_modules/.pnpm/micromark-extension-gfm-table@2.1.2/node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
1243
|
+
function gfmTableAlign(events, index) {
|
|
1244
|
+
let inDelimiterRow = false;
|
|
1245
|
+
const align = [];
|
|
1246
|
+
while (index < events.length) {
|
|
1247
|
+
const event = events[index];
|
|
1248
|
+
if (inDelimiterRow) {
|
|
1249
|
+
if (event[0] === "enter") {
|
|
1250
|
+
if (event[1].type === "tableContent") {
|
|
1251
|
+
align.push(events[index + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
|
|
1252
|
+
}
|
|
1253
|
+
} else if (event[1].type === "tableContent") {
|
|
1254
|
+
if (events[index - 1][1].type === "tableDelimiterMarker") {
|
|
1255
|
+
const alignIndex = align.length - 1;
|
|
1256
|
+
align[alignIndex] = align[alignIndex] === "left" ? "center" : "right";
|
|
1257
|
+
}
|
|
1258
|
+
} else if (event[1].type === "tableDelimiterRow") {
|
|
1259
|
+
break;
|
|
1260
|
+
}
|
|
1261
|
+
} else if (event[0] === "enter" && event[1].type === "tableDelimiterRow") {
|
|
1262
|
+
inDelimiterRow = true;
|
|
1263
|
+
}
|
|
1264
|
+
index += 1;
|
|
1265
|
+
}
|
|
1266
|
+
return align;
|
|
1267
|
+
}
|
|
1268
|
+
__name(gfmTableAlign, "gfmTableAlign");
|
|
1269
|
+
|
|
1270
|
+
// node_modules/.pnpm/micromark-extension-gfm-table@2.1.2/node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
1271
|
+
function gfmTable() {
|
|
1272
|
+
return {
|
|
1273
|
+
flow: {
|
|
1274
|
+
null: {
|
|
1275
|
+
name: "table",
|
|
1276
|
+
tokenize: tokenizeTable,
|
|
1277
|
+
resolveAll: resolveTable
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
__name(gfmTable, "gfmTable");
|
|
1283
|
+
function tokenizeTable(effects, ok, nok) {
|
|
1284
|
+
const self = this;
|
|
1285
|
+
let size = 0;
|
|
1286
|
+
let sizeB = 0;
|
|
1287
|
+
let seen;
|
|
1288
|
+
return start;
|
|
1289
|
+
function start(code2) {
|
|
1290
|
+
let index = self.events.length - 1;
|
|
1291
|
+
while (index > -1) {
|
|
1292
|
+
const {
|
|
1293
|
+
type
|
|
1294
|
+
} = self.events[index][1];
|
|
1295
|
+
if (type === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
|
|
1296
|
+
type === "linePrefix") {
|
|
1297
|
+
index--;
|
|
1298
|
+
} else {
|
|
1299
|
+
break;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
const tail = index > -1 ? self.events[index][1].type : null;
|
|
1303
|
+
const next = tail === "tableHead" || tail === "tableRow" ? bodyRowStart : headRowBefore;
|
|
1304
|
+
if (next === bodyRowStart && self.parser.lazy[self.now().line]) {
|
|
1305
|
+
return nok(code2);
|
|
1306
|
+
}
|
|
1307
|
+
return next(code2);
|
|
1308
|
+
}
|
|
1309
|
+
__name(start, "start");
|
|
1310
|
+
function headRowBefore(code2) {
|
|
1311
|
+
effects.enter("tableHead");
|
|
1312
|
+
effects.enter("tableRow");
|
|
1313
|
+
return headRowStart(code2);
|
|
1314
|
+
}
|
|
1315
|
+
__name(headRowBefore, "headRowBefore");
|
|
1316
|
+
function headRowStart(code2) {
|
|
1317
|
+
if (code2 === 124) {
|
|
1318
|
+
return headRowBreak(code2);
|
|
1319
|
+
}
|
|
1320
|
+
seen = true;
|
|
1321
|
+
sizeB += 1;
|
|
1322
|
+
return headRowBreak(code2);
|
|
1323
|
+
}
|
|
1324
|
+
__name(headRowStart, "headRowStart");
|
|
1325
|
+
function headRowBreak(code2) {
|
|
1326
|
+
if (code2 === null) {
|
|
1327
|
+
return nok(code2);
|
|
1328
|
+
}
|
|
1329
|
+
if (markdownLineEnding(code2)) {
|
|
1330
|
+
if (sizeB > 1) {
|
|
1331
|
+
sizeB = 0;
|
|
1332
|
+
self.interrupt = true;
|
|
1333
|
+
effects.exit("tableRow");
|
|
1334
|
+
effects.enter("lineEnding");
|
|
1335
|
+
effects.consume(code2);
|
|
1336
|
+
effects.exit("lineEnding");
|
|
1337
|
+
return headDelimiterStart;
|
|
1338
|
+
}
|
|
1339
|
+
return nok(code2);
|
|
1340
|
+
}
|
|
1341
|
+
if (markdownSpace(code2)) {
|
|
1342
|
+
return factorySpace(effects, headRowBreak, "whitespace")(code2);
|
|
1343
|
+
}
|
|
1344
|
+
sizeB += 1;
|
|
1345
|
+
if (seen) {
|
|
1346
|
+
seen = false;
|
|
1347
|
+
size += 1;
|
|
1348
|
+
}
|
|
1349
|
+
if (code2 === 124) {
|
|
1350
|
+
effects.enter("tableCellDivider");
|
|
1351
|
+
effects.consume(code2);
|
|
1352
|
+
effects.exit("tableCellDivider");
|
|
1353
|
+
seen = true;
|
|
1354
|
+
return headRowBreak;
|
|
1355
|
+
}
|
|
1356
|
+
effects.enter("data");
|
|
1357
|
+
return headRowData(code2);
|
|
1358
|
+
}
|
|
1359
|
+
__name(headRowBreak, "headRowBreak");
|
|
1360
|
+
function headRowData(code2) {
|
|
1361
|
+
if (code2 === null || code2 === 124 || markdownLineEndingOrSpace(code2)) {
|
|
1362
|
+
effects.exit("data");
|
|
1363
|
+
return headRowBreak(code2);
|
|
1364
|
+
}
|
|
1365
|
+
effects.consume(code2);
|
|
1366
|
+
return code2 === 92 ? headRowEscape : headRowData;
|
|
1367
|
+
}
|
|
1368
|
+
__name(headRowData, "headRowData");
|
|
1369
|
+
function headRowEscape(code2) {
|
|
1370
|
+
if (code2 === 92 || code2 === 124) {
|
|
1371
|
+
effects.consume(code2);
|
|
1372
|
+
return headRowData;
|
|
1373
|
+
}
|
|
1374
|
+
return headRowData(code2);
|
|
1375
|
+
}
|
|
1376
|
+
__name(headRowEscape, "headRowEscape");
|
|
1377
|
+
function headDelimiterStart(code2) {
|
|
1378
|
+
self.interrupt = false;
|
|
1379
|
+
if (self.parser.lazy[self.now().line]) {
|
|
1380
|
+
return nok(code2);
|
|
1381
|
+
}
|
|
1382
|
+
effects.enter("tableDelimiterRow");
|
|
1383
|
+
seen = false;
|
|
1384
|
+
if (markdownSpace(code2)) {
|
|
1385
|
+
return factorySpace(effects, headDelimiterBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2);
|
|
1386
|
+
}
|
|
1387
|
+
return headDelimiterBefore(code2);
|
|
1388
|
+
}
|
|
1389
|
+
__name(headDelimiterStart, "headDelimiterStart");
|
|
1390
|
+
function headDelimiterBefore(code2) {
|
|
1391
|
+
if (code2 === 45 || code2 === 58) {
|
|
1392
|
+
return headDelimiterValueBefore(code2);
|
|
1393
|
+
}
|
|
1394
|
+
if (code2 === 124) {
|
|
1395
|
+
seen = true;
|
|
1396
|
+
effects.enter("tableCellDivider");
|
|
1397
|
+
effects.consume(code2);
|
|
1398
|
+
effects.exit("tableCellDivider");
|
|
1399
|
+
return headDelimiterCellBefore;
|
|
1400
|
+
}
|
|
1401
|
+
return headDelimiterNok(code2);
|
|
1402
|
+
}
|
|
1403
|
+
__name(headDelimiterBefore, "headDelimiterBefore");
|
|
1404
|
+
function headDelimiterCellBefore(code2) {
|
|
1405
|
+
if (markdownSpace(code2)) {
|
|
1406
|
+
return factorySpace(effects, headDelimiterValueBefore, "whitespace")(code2);
|
|
1407
|
+
}
|
|
1408
|
+
return headDelimiterValueBefore(code2);
|
|
1409
|
+
}
|
|
1410
|
+
__name(headDelimiterCellBefore, "headDelimiterCellBefore");
|
|
1411
|
+
function headDelimiterValueBefore(code2) {
|
|
1412
|
+
if (code2 === 58) {
|
|
1413
|
+
sizeB += 1;
|
|
1414
|
+
seen = true;
|
|
1415
|
+
effects.enter("tableDelimiterMarker");
|
|
1416
|
+
effects.consume(code2);
|
|
1417
|
+
effects.exit("tableDelimiterMarker");
|
|
1418
|
+
return headDelimiterLeftAlignmentAfter;
|
|
1419
|
+
}
|
|
1420
|
+
if (code2 === 45) {
|
|
1421
|
+
sizeB += 1;
|
|
1422
|
+
return headDelimiterLeftAlignmentAfter(code2);
|
|
1423
|
+
}
|
|
1424
|
+
if (code2 === null || markdownLineEnding(code2)) {
|
|
1425
|
+
return headDelimiterCellAfter(code2);
|
|
1426
|
+
}
|
|
1427
|
+
return headDelimiterNok(code2);
|
|
1428
|
+
}
|
|
1429
|
+
__name(headDelimiterValueBefore, "headDelimiterValueBefore");
|
|
1430
|
+
function headDelimiterLeftAlignmentAfter(code2) {
|
|
1431
|
+
if (code2 === 45) {
|
|
1432
|
+
effects.enter("tableDelimiterFiller");
|
|
1433
|
+
return headDelimiterFiller(code2);
|
|
1434
|
+
}
|
|
1435
|
+
return headDelimiterNok(code2);
|
|
1436
|
+
}
|
|
1437
|
+
__name(headDelimiterLeftAlignmentAfter, "headDelimiterLeftAlignmentAfter");
|
|
1438
|
+
function headDelimiterFiller(code2) {
|
|
1439
|
+
if (code2 === 45) {
|
|
1440
|
+
effects.consume(code2);
|
|
1441
|
+
return headDelimiterFiller;
|
|
1442
|
+
}
|
|
1443
|
+
if (code2 === 58) {
|
|
1444
|
+
seen = true;
|
|
1445
|
+
effects.exit("tableDelimiterFiller");
|
|
1446
|
+
effects.enter("tableDelimiterMarker");
|
|
1447
|
+
effects.consume(code2);
|
|
1448
|
+
effects.exit("tableDelimiterMarker");
|
|
1449
|
+
return headDelimiterRightAlignmentAfter;
|
|
1450
|
+
}
|
|
1451
|
+
effects.exit("tableDelimiterFiller");
|
|
1452
|
+
return headDelimiterRightAlignmentAfter(code2);
|
|
1453
|
+
}
|
|
1454
|
+
__name(headDelimiterFiller, "headDelimiterFiller");
|
|
1455
|
+
function headDelimiterRightAlignmentAfter(code2) {
|
|
1456
|
+
if (markdownSpace(code2)) {
|
|
1457
|
+
return factorySpace(effects, headDelimiterCellAfter, "whitespace")(code2);
|
|
1458
|
+
}
|
|
1459
|
+
return headDelimiterCellAfter(code2);
|
|
1460
|
+
}
|
|
1461
|
+
__name(headDelimiterRightAlignmentAfter, "headDelimiterRightAlignmentAfter");
|
|
1462
|
+
function headDelimiterCellAfter(code2) {
|
|
1463
|
+
if (code2 === 124) {
|
|
1464
|
+
return headDelimiterBefore(code2);
|
|
1465
|
+
}
|
|
1466
|
+
if (code2 === null || markdownLineEnding(code2)) {
|
|
1467
|
+
if (!seen || size !== sizeB) {
|
|
1468
|
+
return headDelimiterNok(code2);
|
|
1469
|
+
}
|
|
1470
|
+
effects.exit("tableDelimiterRow");
|
|
1471
|
+
effects.exit("tableHead");
|
|
1472
|
+
return ok(code2);
|
|
1473
|
+
}
|
|
1474
|
+
return headDelimiterNok(code2);
|
|
1475
|
+
}
|
|
1476
|
+
__name(headDelimiterCellAfter, "headDelimiterCellAfter");
|
|
1477
|
+
function headDelimiterNok(code2) {
|
|
1478
|
+
return nok(code2);
|
|
1479
|
+
}
|
|
1480
|
+
__name(headDelimiterNok, "headDelimiterNok");
|
|
1481
|
+
function bodyRowStart(code2) {
|
|
1482
|
+
effects.enter("tableRow");
|
|
1483
|
+
return bodyRowBreak(code2);
|
|
1484
|
+
}
|
|
1485
|
+
__name(bodyRowStart, "bodyRowStart");
|
|
1486
|
+
function bodyRowBreak(code2) {
|
|
1487
|
+
if (code2 === 124) {
|
|
1488
|
+
effects.enter("tableCellDivider");
|
|
1489
|
+
effects.consume(code2);
|
|
1490
|
+
effects.exit("tableCellDivider");
|
|
1491
|
+
return bodyRowBreak;
|
|
1492
|
+
}
|
|
1493
|
+
if (code2 === null || markdownLineEnding(code2)) {
|
|
1494
|
+
effects.exit("tableRow");
|
|
1495
|
+
return ok(code2);
|
|
1496
|
+
}
|
|
1497
|
+
if (markdownSpace(code2)) {
|
|
1498
|
+
return factorySpace(effects, bodyRowBreak, "whitespace")(code2);
|
|
1499
|
+
}
|
|
1500
|
+
effects.enter("data");
|
|
1501
|
+
return bodyRowData(code2);
|
|
1502
|
+
}
|
|
1503
|
+
__name(bodyRowBreak, "bodyRowBreak");
|
|
1504
|
+
function bodyRowData(code2) {
|
|
1505
|
+
if (code2 === null || code2 === 124 || markdownLineEndingOrSpace(code2)) {
|
|
1506
|
+
effects.exit("data");
|
|
1507
|
+
return bodyRowBreak(code2);
|
|
1508
|
+
}
|
|
1509
|
+
effects.consume(code2);
|
|
1510
|
+
return code2 === 92 ? bodyRowEscape : bodyRowData;
|
|
1511
|
+
}
|
|
1512
|
+
__name(bodyRowData, "bodyRowData");
|
|
1513
|
+
function bodyRowEscape(code2) {
|
|
1514
|
+
if (code2 === 92 || code2 === 124) {
|
|
1515
|
+
effects.consume(code2);
|
|
1516
|
+
return bodyRowData;
|
|
1517
|
+
}
|
|
1518
|
+
return bodyRowData(code2);
|
|
1519
|
+
}
|
|
1520
|
+
__name(bodyRowEscape, "bodyRowEscape");
|
|
1521
|
+
}
|
|
1522
|
+
__name(tokenizeTable, "tokenizeTable");
|
|
1523
|
+
function resolveTable(events, context) {
|
|
1524
|
+
let index = -1;
|
|
1525
|
+
let inFirstCellAwaitingPipe = true;
|
|
1526
|
+
let rowKind = 0;
|
|
1527
|
+
let lastCell = [0, 0, 0, 0];
|
|
1528
|
+
let cell = [0, 0, 0, 0];
|
|
1529
|
+
let afterHeadAwaitingFirstBodyRow = false;
|
|
1530
|
+
let lastTableEnd = 0;
|
|
1531
|
+
let currentTable;
|
|
1532
|
+
let currentBody;
|
|
1533
|
+
let currentCell;
|
|
1534
|
+
const map = new EditMap();
|
|
1535
|
+
while (++index < events.length) {
|
|
1536
|
+
const event = events[index];
|
|
1537
|
+
const token = event[1];
|
|
1538
|
+
if (event[0] === "enter") {
|
|
1539
|
+
if (token.type === "tableHead") {
|
|
1540
|
+
afterHeadAwaitingFirstBodyRow = false;
|
|
1541
|
+
if (lastTableEnd !== 0) {
|
|
1542
|
+
flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
|
|
1543
|
+
currentBody = void 0;
|
|
1544
|
+
lastTableEnd = 0;
|
|
1545
|
+
}
|
|
1546
|
+
currentTable = {
|
|
1547
|
+
type: "table",
|
|
1548
|
+
start: Object.assign({}, token.start),
|
|
1549
|
+
// Note: correct end is set later.
|
|
1550
|
+
end: Object.assign({}, token.end)
|
|
1551
|
+
};
|
|
1552
|
+
map.add(index, 0, [["enter", currentTable, context]]);
|
|
1553
|
+
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
1554
|
+
inFirstCellAwaitingPipe = true;
|
|
1555
|
+
currentCell = void 0;
|
|
1556
|
+
lastCell = [0, 0, 0, 0];
|
|
1557
|
+
cell = [0, index + 1, 0, 0];
|
|
1558
|
+
if (afterHeadAwaitingFirstBodyRow) {
|
|
1559
|
+
afterHeadAwaitingFirstBodyRow = false;
|
|
1560
|
+
currentBody = {
|
|
1561
|
+
type: "tableBody",
|
|
1562
|
+
start: Object.assign({}, token.start),
|
|
1563
|
+
// Note: correct end is set later.
|
|
1564
|
+
end: Object.assign({}, token.end)
|
|
1565
|
+
};
|
|
1566
|
+
map.add(index, 0, [["enter", currentBody, context]]);
|
|
1567
|
+
}
|
|
1568
|
+
rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
|
|
1569
|
+
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
1570
|
+
inFirstCellAwaitingPipe = false;
|
|
1571
|
+
if (cell[2] === 0) {
|
|
1572
|
+
if (lastCell[1] !== 0) {
|
|
1573
|
+
cell[0] = cell[1];
|
|
1574
|
+
currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell);
|
|
1575
|
+
lastCell = [0, 0, 0, 0];
|
|
1576
|
+
}
|
|
1577
|
+
cell[2] = index;
|
|
1578
|
+
}
|
|
1579
|
+
} else if (token.type === "tableCellDivider") {
|
|
1580
|
+
if (inFirstCellAwaitingPipe) {
|
|
1581
|
+
inFirstCellAwaitingPipe = false;
|
|
1582
|
+
} else {
|
|
1583
|
+
if (lastCell[1] !== 0) {
|
|
1584
|
+
cell[0] = cell[1];
|
|
1585
|
+
currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell);
|
|
1586
|
+
}
|
|
1587
|
+
lastCell = cell;
|
|
1588
|
+
cell = [lastCell[1], index, 0, 0];
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
} else if (token.type === "tableHead") {
|
|
1592
|
+
afterHeadAwaitingFirstBodyRow = true;
|
|
1593
|
+
lastTableEnd = index;
|
|
1594
|
+
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
1595
|
+
lastTableEnd = index;
|
|
1596
|
+
if (lastCell[1] !== 0) {
|
|
1597
|
+
cell[0] = cell[1];
|
|
1598
|
+
currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);
|
|
1599
|
+
} else if (cell[1] !== 0) {
|
|
1600
|
+
currentCell = flushCell(map, context, cell, rowKind, index, currentCell);
|
|
1601
|
+
}
|
|
1602
|
+
rowKind = 0;
|
|
1603
|
+
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
1604
|
+
cell[3] = index;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
if (lastTableEnd !== 0) {
|
|
1608
|
+
flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
|
|
1609
|
+
}
|
|
1610
|
+
map.consume(context.events);
|
|
1611
|
+
index = -1;
|
|
1612
|
+
while (++index < context.events.length) {
|
|
1613
|
+
const event = context.events[index];
|
|
1614
|
+
if (event[0] === "enter" && event[1].type === "table") {
|
|
1615
|
+
event[1]._align = gfmTableAlign(context.events, index);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
return events;
|
|
1619
|
+
}
|
|
1620
|
+
__name(resolveTable, "resolveTable");
|
|
1621
|
+
function flushCell(map, context, range, rowKind, rowEnd, previousCell) {
|
|
1622
|
+
const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
|
|
1623
|
+
const valueName = "tableContent";
|
|
1624
|
+
if (range[0] !== 0) {
|
|
1625
|
+
previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
|
|
1626
|
+
map.add(range[0], 0, [["exit", previousCell, context]]);
|
|
1627
|
+
}
|
|
1628
|
+
const now = getPoint(context.events, range[1]);
|
|
1629
|
+
previousCell = {
|
|
1630
|
+
type: groupName,
|
|
1631
|
+
start: Object.assign({}, now),
|
|
1632
|
+
// Note: correct end is set later.
|
|
1633
|
+
end: Object.assign({}, now)
|
|
1634
|
+
};
|
|
1635
|
+
map.add(range[1], 0, [["enter", previousCell, context]]);
|
|
1636
|
+
if (range[2] !== 0) {
|
|
1637
|
+
const relatedStart = getPoint(context.events, range[2]);
|
|
1638
|
+
const relatedEnd = getPoint(context.events, range[3]);
|
|
1639
|
+
const valueToken = {
|
|
1640
|
+
type: valueName,
|
|
1641
|
+
start: Object.assign({}, relatedStart),
|
|
1642
|
+
end: Object.assign({}, relatedEnd)
|
|
1643
|
+
};
|
|
1644
|
+
map.add(range[2], 0, [["enter", valueToken, context]]);
|
|
1645
|
+
if (rowKind !== 2) {
|
|
1646
|
+
const start = context.events[range[2]];
|
|
1647
|
+
const end = context.events[range[3]];
|
|
1648
|
+
start[1].end = Object.assign({}, end[1].end);
|
|
1649
|
+
start[1].type = "chunkText";
|
|
1650
|
+
start[1].contentType = "text";
|
|
1651
|
+
if (range[3] > range[2] + 1) {
|
|
1652
|
+
const a = range[2] + 1;
|
|
1653
|
+
const b = range[3] - range[2] - 1;
|
|
1654
|
+
map.add(a, b, []);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
map.add(range[3] + 1, 0, [["exit", valueToken, context]]);
|
|
1658
|
+
}
|
|
1659
|
+
if (rowEnd !== void 0) {
|
|
1660
|
+
previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
|
|
1661
|
+
map.add(rowEnd, 0, [["exit", previousCell, context]]);
|
|
1662
|
+
previousCell = void 0;
|
|
1663
|
+
}
|
|
1664
|
+
return previousCell;
|
|
1665
|
+
}
|
|
1666
|
+
__name(flushCell, "flushCell");
|
|
1667
|
+
function flushTableEnd(map, context, index, table, tableBody) {
|
|
1668
|
+
const exits = [];
|
|
1669
|
+
const related = getPoint(context.events, index);
|
|
1670
|
+
if (tableBody) {
|
|
1671
|
+
tableBody.end = Object.assign({}, related);
|
|
1672
|
+
exits.push(["exit", tableBody, context]);
|
|
1673
|
+
}
|
|
1674
|
+
table.end = Object.assign({}, related);
|
|
1675
|
+
exits.push(["exit", table, context]);
|
|
1676
|
+
map.add(index + 1, 0, exits);
|
|
1677
|
+
}
|
|
1678
|
+
__name(flushTableEnd, "flushTableEnd");
|
|
1679
|
+
function getPoint(events, index) {
|
|
1680
|
+
const event = events[index];
|
|
1681
|
+
const side = event[0] === "enter" ? "start" : "end";
|
|
1682
|
+
return event[1][side];
|
|
1683
|
+
}
|
|
1684
|
+
__name(getPoint, "getPoint");
|
|
1685
|
+
|
|
1686
|
+
// node_modules/.pnpm/micromark-extension-gfm-tagfilter@2.0.0/node_modules/micromark-extension-gfm-tagfilter/lib/index.js
|
|
1687
|
+
var reFlow = /<(\/?)(iframe|noembed|noframes|plaintext|script|style|title|textarea|xmp)(?=[\t\n\f\r />])/gi;
|
|
1688
|
+
var reText = new RegExp("^" + reFlow.source, "i");
|
|
1689
|
+
function gfmTagfilterHtml() {
|
|
1690
|
+
return {
|
|
1691
|
+
exit: {
|
|
1692
|
+
htmlFlowData(token) {
|
|
1693
|
+
exitHtmlData.call(this, token, reFlow);
|
|
1694
|
+
},
|
|
1695
|
+
htmlTextData(token) {
|
|
1696
|
+
exitHtmlData.call(this, token, reText);
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
__name(gfmTagfilterHtml, "gfmTagfilterHtml");
|
|
1702
|
+
function exitHtmlData(token, filter) {
|
|
1703
|
+
let value = this.sliceSerialize(token);
|
|
1704
|
+
if (this.options.allowDangerousHtml) {
|
|
1705
|
+
value = value.replace(filter, "<$1$2");
|
|
1706
|
+
}
|
|
1707
|
+
this.raw(this.encode(value));
|
|
1708
|
+
}
|
|
1709
|
+
__name(exitHtmlData, "exitHtmlData");
|
|
1710
|
+
|
|
1711
|
+
// node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.1.0/node_modules/micromark-extension-gfm-task-list-item/lib/html.js
|
|
1712
|
+
function gfmTaskListItemHtml() {
|
|
1713
|
+
return {
|
|
1714
|
+
enter: {
|
|
1715
|
+
taskListCheck() {
|
|
1716
|
+
this.tag('<input type="checkbox" disabled="" ');
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
exit: {
|
|
1720
|
+
taskListCheck() {
|
|
1721
|
+
this.tag("/>");
|
|
1722
|
+
},
|
|
1723
|
+
taskListCheckValueChecked() {
|
|
1724
|
+
this.tag('checked="" ');
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
__name(gfmTaskListItemHtml, "gfmTaskListItemHtml");
|
|
1730
|
+
|
|
1731
|
+
// node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.1.0/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
1732
|
+
var tasklistCheck = {
|
|
1733
|
+
name: "tasklistCheck",
|
|
1734
|
+
tokenize: tokenizeTasklistCheck
|
|
1735
|
+
};
|
|
1736
|
+
function gfmTaskListItem() {
|
|
1737
|
+
return {
|
|
1738
|
+
text: {
|
|
1739
|
+
[91]: tasklistCheck
|
|
1740
|
+
}
|
|
1741
|
+
};
|
|
1742
|
+
}
|
|
1743
|
+
__name(gfmTaskListItem, "gfmTaskListItem");
|
|
1744
|
+
function tokenizeTasklistCheck(effects, ok, nok) {
|
|
1745
|
+
const self = this;
|
|
1746
|
+
return open;
|
|
1747
|
+
function open(code2) {
|
|
1748
|
+
if (
|
|
1749
|
+
// Exit if there’s stuff before.
|
|
1750
|
+
self.previous !== null || // Exit if not in the first content that is the first child of a list
|
|
1751
|
+
// item.
|
|
1752
|
+
!self._gfmTasklistFirstContentOfListItem
|
|
1753
|
+
) {
|
|
1754
|
+
return nok(code2);
|
|
1755
|
+
}
|
|
1756
|
+
effects.enter("taskListCheck");
|
|
1757
|
+
effects.enter("taskListCheckMarker");
|
|
1758
|
+
effects.consume(code2);
|
|
1759
|
+
effects.exit("taskListCheckMarker");
|
|
1760
|
+
return inside;
|
|
1761
|
+
}
|
|
1762
|
+
__name(open, "open");
|
|
1763
|
+
function inside(code2) {
|
|
1764
|
+
if (markdownLineEndingOrSpace(code2)) {
|
|
1765
|
+
effects.enter("taskListCheckValueUnchecked");
|
|
1766
|
+
effects.consume(code2);
|
|
1767
|
+
effects.exit("taskListCheckValueUnchecked");
|
|
1768
|
+
return close;
|
|
1769
|
+
}
|
|
1770
|
+
if (code2 === 88 || code2 === 120) {
|
|
1771
|
+
effects.enter("taskListCheckValueChecked");
|
|
1772
|
+
effects.consume(code2);
|
|
1773
|
+
effects.exit("taskListCheckValueChecked");
|
|
1774
|
+
return close;
|
|
1775
|
+
}
|
|
1776
|
+
return nok(code2);
|
|
1777
|
+
}
|
|
1778
|
+
__name(inside, "inside");
|
|
1779
|
+
function close(code2) {
|
|
1780
|
+
if (code2 === 93) {
|
|
1781
|
+
effects.enter("taskListCheckMarker");
|
|
1782
|
+
effects.consume(code2);
|
|
1783
|
+
effects.exit("taskListCheckMarker");
|
|
1784
|
+
effects.exit("taskListCheck");
|
|
1785
|
+
return after;
|
|
1786
|
+
}
|
|
1787
|
+
return nok(code2);
|
|
1788
|
+
}
|
|
1789
|
+
__name(close, "close");
|
|
1790
|
+
function after(code2) {
|
|
1791
|
+
if (markdownLineEnding(code2)) {
|
|
1792
|
+
return ok(code2);
|
|
1793
|
+
}
|
|
1794
|
+
if (markdownSpace(code2)) {
|
|
1795
|
+
return effects.check({
|
|
1796
|
+
tokenize: spaceThenNonSpace
|
|
1797
|
+
}, ok, nok)(code2);
|
|
1798
|
+
}
|
|
1799
|
+
return nok(code2);
|
|
1800
|
+
}
|
|
1801
|
+
__name(after, "after");
|
|
1802
|
+
}
|
|
1803
|
+
__name(tokenizeTasklistCheck, "tokenizeTasklistCheck");
|
|
1804
|
+
function spaceThenNonSpace(effects, ok, nok) {
|
|
1805
|
+
return factorySpace(effects, after, "whitespace");
|
|
1806
|
+
function after(code2) {
|
|
1807
|
+
return code2 === null ? nok(code2) : ok(code2);
|
|
1808
|
+
}
|
|
1809
|
+
__name(after, "after");
|
|
1810
|
+
}
|
|
1811
|
+
__name(spaceThenNonSpace, "spaceThenNonSpace");
|
|
1812
|
+
|
|
1813
|
+
// node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.js
|
|
1814
|
+
function gfm(options) {
|
|
1815
|
+
return combineExtensions([
|
|
1816
|
+
gfmAutolinkLiteral(),
|
|
1817
|
+
gfmFootnote(),
|
|
1818
|
+
gfmStrikethrough(options),
|
|
1819
|
+
gfmTable(),
|
|
1820
|
+
gfmTaskListItem()
|
|
1821
|
+
]);
|
|
1822
|
+
}
|
|
1823
|
+
__name(gfm, "gfm");
|
|
1824
|
+
function gfmHtml(options) {
|
|
1825
|
+
return combineHtmlExtensions([
|
|
1826
|
+
gfmAutolinkLiteralHtml(),
|
|
1827
|
+
gfmFootnoteHtml(options),
|
|
1828
|
+
gfmStrikethroughHtml(),
|
|
1829
|
+
gfmTableHtml(),
|
|
1830
|
+
gfmTagfilterHtml(),
|
|
1831
|
+
gfmTaskListItemHtml()
|
|
1832
|
+
]);
|
|
1833
|
+
}
|
|
1834
|
+
__name(gfmHtml, "gfmHtml");
|
|
1835
|
+
export {
|
|
1836
|
+
gfm,
|
|
1837
|
+
gfmHtml
|
|
1838
|
+
};
|