caveat-cli 0.17.0 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/{chunk-7FEOFAMA.js → chunk-TRIQ5WFY.js} +163 -99
- package/dist/chunk-TRIQ5WFY.js.map +1 -0
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/{server-STR2EAWZ.js → server-FUWTRVRZ.js} +513 -232
- package/dist/server-FUWTRVRZ.js.map +1 -0
- package/package.json +20 -17
- package/dist/chunk-7FEOFAMA.js.map +0 -1
- package/dist/server-STR2EAWZ.js.map +0 -1
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
resolvePaths,
|
|
11
11
|
search,
|
|
12
12
|
stderrLogger
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TRIQ5WFY.js";
|
|
14
14
|
|
|
15
|
-
// ../../node_modules/.pnpm/@hono+node-server@2.0.
|
|
15
|
+
// ../../node_modules/.pnpm/@hono+node-server@2.0.10_hono@4.12.30/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
|
|
16
16
|
var X_ALREADY_SENT = "x-hono-already-sent";
|
|
17
17
|
|
|
18
|
-
// ../../node_modules/.pnpm/@hono+node-server@2.0.
|
|
18
|
+
// ../../node_modules/.pnpm/@hono+node-server@2.0.10_hono@4.12.30/node_modules/@hono/node-server/dist/index.mjs
|
|
19
19
|
import { STATUS_CODES, createServer } from "node:http";
|
|
20
20
|
import { Http2ServerRequest, constants } from "node:http2";
|
|
21
21
|
import { Readable } from "node:stream";
|
|
22
22
|
|
|
23
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
23
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/helper/websocket/index.js
|
|
24
24
|
var defineWebSocketHelper = (handler) => {
|
|
25
25
|
return ((...args) => {
|
|
26
26
|
if (typeof args[0] === "function") {
|
|
@@ -46,7 +46,7 @@ var defineWebSocketHelper = (handler) => {
|
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
// ../../node_modules/.pnpm/@hono+node-server@2.0.
|
|
49
|
+
// ../../node_modules/.pnpm/@hono+node-server@2.0.10_hono@4.12.30/node_modules/@hono/node-server/dist/index.mjs
|
|
50
50
|
var RequestError = class extends Error {
|
|
51
51
|
constructor(message, options) {
|
|
52
52
|
super(message, options);
|
|
@@ -95,6 +95,54 @@ var newHeadersFromIncoming = (incoming) => {
|
|
|
95
95
|
return new Headers(headerRecord);
|
|
96
96
|
};
|
|
97
97
|
var wrapBodyStream = /* @__PURE__ */ Symbol("wrapBodyStream");
|
|
98
|
+
var byteExactEncodings = /* @__PURE__ */ new Set([
|
|
99
|
+
"latin1",
|
|
100
|
+
"binary",
|
|
101
|
+
"hex",
|
|
102
|
+
"base64",
|
|
103
|
+
"base64url"
|
|
104
|
+
]);
|
|
105
|
+
var isByteExactEncoding = (encoding) => encoding === null || byteExactEncodings.has(encoding);
|
|
106
|
+
var bodyBufferedBeforeDisconnectKey = /* @__PURE__ */ Symbol("bodyBufferedBeforeDisconnect");
|
|
107
|
+
var bodyBufferedLengthBeforeDisconnectKey = /* @__PURE__ */ Symbol("bodyBufferedLengthBeforeDisconnect");
|
|
108
|
+
var toBufferChunk = (chunk, encoding) => Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding ?? "utf8");
|
|
109
|
+
var isRecoverableDisconnectedIncoming = (incoming) => !(incoming instanceof Http2ServerRequest) && !!incoming.complete && !!incoming.readableAborted && typeof incoming.read === "function" && isByteExactEncoding(incoming.readableEncoding);
|
|
110
|
+
var recordBodyBufferedBeforeDisconnect = (incoming) => {
|
|
111
|
+
if (incoming.readableDidRead || !isRecoverableDisconnectedIncoming(incoming)) return;
|
|
112
|
+
const incomingWithRecovery = incoming;
|
|
113
|
+
incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey] ??= incoming.readableLength;
|
|
114
|
+
};
|
|
115
|
+
var readBodyBufferedBeforeDisconnect = (incoming, chunks) => {
|
|
116
|
+
if (incoming.readableDidRead && !chunks || !isRecoverableDisconnectedIncoming(incoming)) return;
|
|
117
|
+
const incomingWithRecovery = incoming;
|
|
118
|
+
if (incomingWithRecovery[bodyBufferedBeforeDisconnectKey] !== void 0) return incomingWithRecovery[bodyBufferedBeforeDisconnectKey];
|
|
119
|
+
let result;
|
|
120
|
+
const errored = incoming.errored;
|
|
121
|
+
if (errored && errored.code !== "ECONNRESET") result = errored;
|
|
122
|
+
else if (incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey] !== void 0 && incoming.readableLength !== incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey]) result = newBodyUnusableError();
|
|
123
|
+
else {
|
|
124
|
+
const bodyChunks = chunks ?? [];
|
|
125
|
+
const chunk = incoming.read();
|
|
126
|
+
if (chunk !== null) bodyChunks.push(toBufferChunk(chunk, incoming.readableEncoding));
|
|
127
|
+
const buffer = bodyChunks.length === 1 ? bodyChunks[0] : Buffer.concat(bodyChunks);
|
|
128
|
+
result = buffer;
|
|
129
|
+
const contentLength = incoming.headers["content-length"];
|
|
130
|
+
if (typeof contentLength === "string" && /^\d+$/.test(contentLength)) {
|
|
131
|
+
const expectedLength = Number(contentLength);
|
|
132
|
+
if (Number.isSafeInteger(expectedLength) && buffer.length !== expectedLength) result = newBodyUnusableError();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
incomingWithRecovery[bodyBufferedBeforeDisconnectKey] = result;
|
|
136
|
+
return result;
|
|
137
|
+
};
|
|
138
|
+
var enqueueBufferedBody = (controller, buffered) => {
|
|
139
|
+
if (buffered instanceof Error) {
|
|
140
|
+
controller.error(buffered);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (buffered.length > 0) controller.enqueue(buffered);
|
|
144
|
+
controller.close();
|
|
145
|
+
};
|
|
98
146
|
var newRequestFromIncoming = (method, url, headers, incoming, abortController) => {
|
|
99
147
|
const init = {
|
|
100
148
|
method,
|
|
@@ -117,6 +165,13 @@ var newRequestFromIncoming = (method, url, headers, incoming, abortController) =
|
|
|
117
165
|
let reader;
|
|
118
166
|
init.body = new ReadableStream({ async pull(controller) {
|
|
119
167
|
try {
|
|
168
|
+
if (!reader) {
|
|
169
|
+
const buffered = readBodyBufferedBeforeDisconnect(incoming);
|
|
170
|
+
if (buffered !== void 0) {
|
|
171
|
+
enqueueBufferedBody(controller, buffered);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
120
175
|
reader ||= Readable.toWeb(incoming).getReader();
|
|
121
176
|
const { done, value } = await reader.read();
|
|
122
177
|
if (done) controller.close();
|
|
@@ -125,7 +180,13 @@ var newRequestFromIncoming = (method, url, headers, incoming, abortController) =
|
|
|
125
180
|
controller.error(error2);
|
|
126
181
|
}
|
|
127
182
|
} });
|
|
128
|
-
} else
|
|
183
|
+
} else {
|
|
184
|
+
const buffered = readBodyBufferedBeforeDisconnect(incoming);
|
|
185
|
+
if (buffered !== void 0) init.body = new ReadableStream({ start(controller) {
|
|
186
|
+
enqueueBufferedBody(controller, buffered);
|
|
187
|
+
} });
|
|
188
|
+
else init.body = Readable.toWeb(incoming);
|
|
189
|
+
}
|
|
129
190
|
return new Request$1(url, init);
|
|
130
191
|
};
|
|
131
192
|
var getRequestCache = /* @__PURE__ */ Symbol("getRequestCache");
|
|
@@ -216,11 +277,23 @@ var readRawBodyIfAvailable = (request) => {
|
|
|
216
277
|
const incoming = request[incomingKey];
|
|
217
278
|
if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) return incoming.rawBody;
|
|
218
279
|
};
|
|
280
|
+
var normalizeAbortError = (request, incoming) => {
|
|
281
|
+
if (incoming.errored) return incoming.errored;
|
|
282
|
+
const reason = request[abortReasonKey];
|
|
283
|
+
if (reason !== void 0) return reason instanceof Error ? reason : new Error(String(reason));
|
|
284
|
+
return /* @__PURE__ */ new Error("Client connection prematurely closed.");
|
|
285
|
+
};
|
|
219
286
|
var readBodyDirect = (request) => {
|
|
220
287
|
if (request[bodyBufferKey]) return Promise.resolve(request[bodyBufferKey]);
|
|
221
288
|
if (request[bodyReadPromiseKey]) return request[bodyReadPromiseKey];
|
|
222
289
|
const incoming = request[incomingKey];
|
|
223
|
-
if (
|
|
290
|
+
if (incoming.readableDidRead) return rejectBodyUnusable();
|
|
291
|
+
const buffered = readBodyBufferedBeforeDisconnect(incoming);
|
|
292
|
+
if (buffered !== void 0) {
|
|
293
|
+
if (buffered instanceof Error) return Promise.reject(buffered);
|
|
294
|
+
request[bodyBufferKey] = buffered;
|
|
295
|
+
return Promise.resolve(buffered);
|
|
296
|
+
}
|
|
224
297
|
const promise = new Promise((resolve, reject) => {
|
|
225
298
|
const chunks = [];
|
|
226
299
|
let settled = false;
|
|
@@ -230,8 +303,22 @@ var readBodyDirect = (request) => {
|
|
|
230
303
|
cleanup();
|
|
231
304
|
callback();
|
|
232
305
|
};
|
|
306
|
+
const recoverCompleteBodyAfterDisconnect = (error2) => {
|
|
307
|
+
const streamError = incoming.errored ?? error2;
|
|
308
|
+
if (!isRecoverableDisconnectedIncoming(incoming) || streamError && streamError.code !== "ECONNRESET") return false;
|
|
309
|
+
finish(() => {
|
|
310
|
+
const recovered = readBodyBufferedBeforeDisconnect(incoming, chunks);
|
|
311
|
+
if (recovered instanceof Error) reject(recovered);
|
|
312
|
+
else if (recovered === void 0) reject(error2 ?? normalizeAbortError(request, incoming));
|
|
313
|
+
else {
|
|
314
|
+
request[bodyBufferKey] = recovered;
|
|
315
|
+
resolve(recovered);
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
return true;
|
|
319
|
+
};
|
|
233
320
|
const onData = (chunk) => {
|
|
234
|
-
chunks.push(
|
|
321
|
+
chunks.push(toBufferChunk(chunk, incoming.readableEncoding));
|
|
235
322
|
};
|
|
236
323
|
const onEnd = () => {
|
|
237
324
|
finish(() => {
|
|
@@ -241,6 +328,7 @@ var readBodyDirect = (request) => {
|
|
|
241
328
|
});
|
|
242
329
|
};
|
|
243
330
|
const onError = (error2) => {
|
|
331
|
+
if (recoverCompleteBodyAfterDisconnect(error2)) return;
|
|
244
332
|
finish(() => {
|
|
245
333
|
reject(error2);
|
|
246
334
|
});
|
|
@@ -250,17 +338,9 @@ var readBodyDirect = (request) => {
|
|
|
250
338
|
onEnd();
|
|
251
339
|
return;
|
|
252
340
|
}
|
|
341
|
+
if (recoverCompleteBodyAfterDisconnect()) return;
|
|
253
342
|
finish(() => {
|
|
254
|
-
|
|
255
|
-
reject(incoming.errored);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
const reason = request[abortReasonKey];
|
|
259
|
-
if (reason !== void 0) {
|
|
260
|
-
reject(reason instanceof Error ? reason : new Error(String(reason)));
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
reject(/* @__PURE__ */ new Error("Client connection prematurely closed."));
|
|
343
|
+
reject(normalizeAbortError(request, incoming));
|
|
264
344
|
});
|
|
265
345
|
};
|
|
266
346
|
const cleanup = () => {
|
|
@@ -435,8 +515,14 @@ var Response$1 = class Response$12 {
|
|
|
435
515
|
#body;
|
|
436
516
|
#init;
|
|
437
517
|
[getResponseCache]() {
|
|
518
|
+
const cache = this[cacheKey];
|
|
519
|
+
const liveHeaders = cache && cache[2] instanceof Headers ? cache[2] : void 0;
|
|
438
520
|
delete this[cacheKey];
|
|
439
|
-
return this[responseCache] ||= new GlobalResponse(this.#body,
|
|
521
|
+
return this[responseCache] ||= new GlobalResponse(this.#body, liveHeaders ? {
|
|
522
|
+
status: this.#init?.status,
|
|
523
|
+
statusText: this.#init?.statusText,
|
|
524
|
+
headers: liveHeaders
|
|
525
|
+
} : this.#init);
|
|
440
526
|
}
|
|
441
527
|
constructor(body, init) {
|
|
442
528
|
let headers;
|
|
@@ -449,7 +535,7 @@ var Response$1 = class Response$12 {
|
|
|
449
535
|
return;
|
|
450
536
|
} else {
|
|
451
537
|
this.#init = init.#init;
|
|
452
|
-
headers = new Headers(init
|
|
538
|
+
headers = new Headers(init.headers);
|
|
453
539
|
}
|
|
454
540
|
} else this.#init = init;
|
|
455
541
|
if (body == null || typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) this[cacheKey] = [
|
|
@@ -642,8 +728,13 @@ var drainIncoming = (incoming) => {
|
|
|
642
728
|
incoming.resume();
|
|
643
729
|
};
|
|
644
730
|
var makeCloseHandler = (req, incoming, outgoing, needsBodyCleanup) => () => {
|
|
645
|
-
if (incoming.errored)
|
|
646
|
-
|
|
731
|
+
if (incoming.errored) {
|
|
732
|
+
recordBodyBufferedBeforeDisconnect(incoming);
|
|
733
|
+
req[abortRequest](incoming.errored.toString());
|
|
734
|
+
} else if (!outgoing.writableFinished) {
|
|
735
|
+
recordBodyBufferedBeforeDisconnect(incoming);
|
|
736
|
+
req[abortRequest]("Client connection prematurely closed.");
|
|
737
|
+
}
|
|
647
738
|
if (needsBodyCleanup && !incoming.readableEnded) setTimeout(() => {
|
|
648
739
|
if (!incoming.readableEnded) setTimeout(() => {
|
|
649
740
|
drainIncoming(incoming);
|
|
@@ -859,6 +950,28 @@ var CloseEvent = globalThis.CloseEvent ?? class extends Event {
|
|
|
859
950
|
return this.#eventInitDict.reason ?? "";
|
|
860
951
|
}
|
|
861
952
|
};
|
|
953
|
+
var ErrorEvent = globalThis.ErrorEvent ?? class extends Event {
|
|
954
|
+
#eventInitDict;
|
|
955
|
+
constructor(type, eventInitDict = {}) {
|
|
956
|
+
super(type, eventInitDict);
|
|
957
|
+
this.#eventInitDict = eventInitDict;
|
|
958
|
+
}
|
|
959
|
+
get message() {
|
|
960
|
+
return this.#eventInitDict.message ?? "";
|
|
961
|
+
}
|
|
962
|
+
get filename() {
|
|
963
|
+
return this.#eventInitDict.filename ?? "";
|
|
964
|
+
}
|
|
965
|
+
get lineno() {
|
|
966
|
+
return this.#eventInitDict.lineno ?? 0;
|
|
967
|
+
}
|
|
968
|
+
get colno() {
|
|
969
|
+
return this.#eventInitDict.colno ?? 0;
|
|
970
|
+
}
|
|
971
|
+
get error() {
|
|
972
|
+
return this.#eventInitDict.error ?? null;
|
|
973
|
+
}
|
|
974
|
+
};
|
|
862
975
|
var generateConnectionSymbol = () => /* @__PURE__ */ Symbol("connection");
|
|
863
976
|
var CONNECTION_SYMBOL_KEY = /* @__PURE__ */ Symbol("CONNECTION_SYMBOL_KEY");
|
|
864
977
|
var WAIT_FOR_WEBSOCKET_SYMBOL = /* @__PURE__ */ Symbol("WAIT_FOR_WEBSOCKET_SYMBOL");
|
|
@@ -912,10 +1025,18 @@ var setupWebSocket = (options) => {
|
|
|
912
1025
|
waiterMap.delete(request);
|
|
913
1026
|
}
|
|
914
1027
|
});
|
|
1028
|
+
const rejectWaiter = (request) => {
|
|
1029
|
+
const waiter = waiterMap.get(request);
|
|
1030
|
+
if (waiter) {
|
|
1031
|
+
waiterMap.delete(request);
|
|
1032
|
+
waiter.reject(/* @__PURE__ */ new Error("WebSocket handshake aborted"));
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
915
1035
|
const waitForWebSocket = (request, connectionSymbol) => {
|
|
916
|
-
return new Promise((resolve) => {
|
|
1036
|
+
return new Promise((resolve, reject) => {
|
|
917
1037
|
waiterMap.set(request, {
|
|
918
1038
|
resolve,
|
|
1039
|
+
reject,
|
|
919
1040
|
connectionSymbol
|
|
920
1041
|
});
|
|
921
1042
|
});
|
|
@@ -942,16 +1063,19 @@ var setupWebSocket = (options) => {
|
|
|
942
1063
|
}
|
|
943
1064
|
const waiter = waiterMap.get(request);
|
|
944
1065
|
if (!waiter || waiter.connectionSymbol !== env[CONNECTION_SYMBOL_KEY]) {
|
|
945
|
-
|
|
1066
|
+
rejectWaiter(request);
|
|
946
1067
|
if (server.listenerCount("upgrade") === 1) rejectUpgradeRequest(socket, status, responseHeaders);
|
|
947
1068
|
return;
|
|
948
1069
|
}
|
|
949
1070
|
const addResponseHeaders = (headers) => {
|
|
950
1071
|
appendResponseHeaders(headers, responseHeaders);
|
|
951
1072
|
};
|
|
1073
|
+
const reclaimWaiterOnClose = () => rejectWaiter(request);
|
|
1074
|
+
socket.once("close", reclaimWaiterOnClose);
|
|
952
1075
|
wss.on("headers", addResponseHeaders);
|
|
953
1076
|
try {
|
|
954
1077
|
wss.handleUpgrade(request, socket, head, (ws) => {
|
|
1078
|
+
socket.off("close", reclaimWaiterOnClose);
|
|
955
1079
|
wss.emit("connection", ws, request);
|
|
956
1080
|
});
|
|
957
1081
|
} finally {
|
|
@@ -970,7 +1094,12 @@ var upgradeWebSocket = defineWebSocketHelper(async (c, events, options) => {
|
|
|
970
1094
|
const connectionSymbol = generateConnectionSymbol();
|
|
971
1095
|
env[CONNECTION_SYMBOL_KEY] = connectionSymbol;
|
|
972
1096
|
(async () => {
|
|
973
|
-
|
|
1097
|
+
let ws;
|
|
1098
|
+
try {
|
|
1099
|
+
ws = await waitForWebSocket(env.incoming, connectionSymbol);
|
|
1100
|
+
} catch {
|
|
1101
|
+
return;
|
|
1102
|
+
}
|
|
974
1103
|
const messagesReceivedInStarting = [];
|
|
975
1104
|
const bufferMessage = (data, isBinary) => {
|
|
976
1105
|
messagesReceivedInStarting.push([data, isBinary]);
|
|
@@ -999,7 +1128,7 @@ var upgradeWebSocket = defineWebSocketHelper(async (c, events, options) => {
|
|
|
999
1128
|
const handleMessage = (data, isBinary) => {
|
|
1000
1129
|
const datas = Array.isArray(data) ? data : [data];
|
|
1001
1130
|
for (const data2 of datas) try {
|
|
1002
|
-
events?.onMessage?.(new MessageEvent("message", { data: isBinary ? data2 instanceof ArrayBuffer ? data2 : data2.buffer.slice(data2.byteOffset, data2.byteOffset + data2.byteLength) : data2.toString("utf-8") }), ctx);
|
|
1131
|
+
events?.onMessage?.(new MessageEvent("message", { data: isBinary ? data2 instanceof ArrayBuffer ? data2 : data2.buffer.slice(data2.byteOffset, data2.byteOffset + data2.byteLength) : typeof data2 === "string" ? data2 : Buffer.from(data2).toString("utf-8") }), ctx);
|
|
1003
1132
|
} catch (e) {
|
|
1004
1133
|
(options?.onError ?? console.error)(e);
|
|
1005
1134
|
}
|
|
@@ -1070,7 +1199,7 @@ function buildWebContext(overrides = {}) {
|
|
|
1070
1199
|
return { caveatHome, userHome, userConfigPath, config: config2, paths, logger, db };
|
|
1071
1200
|
}
|
|
1072
1201
|
|
|
1073
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1202
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/compose.js
|
|
1074
1203
|
var compose = (middleware, onError, onNotFound) => {
|
|
1075
1204
|
return (context, next) => {
|
|
1076
1205
|
let index = -1;
|
|
@@ -1114,21 +1243,40 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
1114
1243
|
};
|
|
1115
1244
|
};
|
|
1116
1245
|
|
|
1117
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1246
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/request/constants.js
|
|
1118
1247
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
1119
1248
|
|
|
1120
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1249
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/utils/buffer.js
|
|
1250
|
+
var bufferToFormData = (arrayBuffer, contentType2) => {
|
|
1251
|
+
const response = new Response(arrayBuffer, {
|
|
1252
|
+
headers: {
|
|
1253
|
+
// Normalize the media type (case-insensitive) while keeping parameters like the boundary
|
|
1254
|
+
"Content-Type": contentType2.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase())
|
|
1255
|
+
}
|
|
1256
|
+
});
|
|
1257
|
+
return response.formData();
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/utils/body.js
|
|
1261
|
+
var isRawRequest = (request) => "headers" in request;
|
|
1121
1262
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
1122
1263
|
const { all = false, dot = false } = options;
|
|
1123
|
-
const headers = request
|
|
1264
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
1124
1265
|
const contentType2 = headers.get("Content-Type");
|
|
1125
|
-
|
|
1266
|
+
const mediaType = contentType2?.split(";")[0].trim().toLowerCase();
|
|
1267
|
+
if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") {
|
|
1126
1268
|
return parseFormData(request, { all, dot });
|
|
1127
1269
|
}
|
|
1128
1270
|
return {};
|
|
1129
1271
|
};
|
|
1130
1272
|
async function parseFormData(request, options) {
|
|
1131
|
-
const
|
|
1273
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
1274
|
+
const arrayBuffer = await request.arrayBuffer();
|
|
1275
|
+
const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || "");
|
|
1276
|
+
if (!isRawRequest(request)) {
|
|
1277
|
+
request.bodyCache.formData = formDataPromise;
|
|
1278
|
+
}
|
|
1279
|
+
const formData = await formDataPromise;
|
|
1132
1280
|
if (formData) {
|
|
1133
1281
|
return convertFormDataToBodyData(formData, options);
|
|
1134
1282
|
}
|
|
@@ -1189,7 +1337,7 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
1189
1337
|
});
|
|
1190
1338
|
};
|
|
1191
1339
|
|
|
1192
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1340
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/utils/url.js
|
|
1193
1341
|
var splitPath = (path) => {
|
|
1194
1342
|
const paths = path.split("/");
|
|
1195
1343
|
if (paths[0] === "") {
|
|
@@ -1393,7 +1541,7 @@ var getQueryParams = (url, key) => {
|
|
|
1393
1541
|
};
|
|
1394
1542
|
var decodeURIComponent_ = decodeURIComponent;
|
|
1395
1543
|
|
|
1396
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1544
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/request.js
|
|
1397
1545
|
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
|
|
1398
1546
|
var HonoRequest = class {
|
|
1399
1547
|
/**
|
|
@@ -1538,6 +1686,21 @@ var HonoRequest = class {
|
|
|
1538
1686
|
arrayBuffer() {
|
|
1539
1687
|
return this.#cachedBody("arrayBuffer");
|
|
1540
1688
|
}
|
|
1689
|
+
/**
|
|
1690
|
+
* `.bytes()` parses the request body as a `Uint8Array`.
|
|
1691
|
+
*
|
|
1692
|
+
* @see {@link https://hono.dev/docs/api/request#bytes}
|
|
1693
|
+
*
|
|
1694
|
+
* @example
|
|
1695
|
+
* ```ts
|
|
1696
|
+
* app.post('/entry', async (c) => {
|
|
1697
|
+
* const body = await c.req.bytes()
|
|
1698
|
+
* })
|
|
1699
|
+
* ```
|
|
1700
|
+
*/
|
|
1701
|
+
bytes() {
|
|
1702
|
+
return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer));
|
|
1703
|
+
}
|
|
1541
1704
|
/**
|
|
1542
1705
|
* Parses the request body as a `Blob`.
|
|
1543
1706
|
* @example
|
|
@@ -1661,7 +1824,7 @@ var HonoRequest = class {
|
|
|
1661
1824
|
}
|
|
1662
1825
|
};
|
|
1663
1826
|
|
|
1664
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1827
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/utils/html.js
|
|
1665
1828
|
var HtmlEscapedCallbackPhase = {
|
|
1666
1829
|
Stringify: 1,
|
|
1667
1830
|
BeforeStream: 2,
|
|
@@ -1703,7 +1866,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
1703
1866
|
}
|
|
1704
1867
|
};
|
|
1705
1868
|
|
|
1706
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1869
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/context.js
|
|
1707
1870
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
1708
1871
|
var setDefaultContentType = (contentType2, headers) => {
|
|
1709
1872
|
return {
|
|
@@ -2110,7 +2273,7 @@ var Context = class {
|
|
|
2110
2273
|
};
|
|
2111
2274
|
};
|
|
2112
2275
|
|
|
2113
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2276
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router.js
|
|
2114
2277
|
var METHOD_NAME_ALL = "ALL";
|
|
2115
2278
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
2116
2279
|
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
@@ -2118,10 +2281,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
2118
2281
|
var UnsupportedPathError = class extends Error {
|
|
2119
2282
|
};
|
|
2120
2283
|
|
|
2121
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2284
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/utils/constants.js
|
|
2122
2285
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
2123
2286
|
|
|
2124
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2287
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/hono-base.js
|
|
2125
2288
|
var notFoundHandler = (c) => {
|
|
2126
2289
|
return c.text("404 Not Found", 404);
|
|
2127
2290
|
};
|
|
@@ -2236,7 +2399,7 @@ var Hono = class _Hono {
|
|
|
2236
2399
|
handler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res;
|
|
2237
2400
|
handler[COMPOSED_HANDLER] = r.handler;
|
|
2238
2401
|
}
|
|
2239
|
-
subApp.#addRoute(r.method, r.path, handler);
|
|
2402
|
+
subApp.#addRoute(r.method, r.path, handler, r.basePath);
|
|
2240
2403
|
});
|
|
2241
2404
|
return this;
|
|
2242
2405
|
}
|
|
@@ -2360,7 +2523,7 @@ var Hono = class _Hono {
|
|
|
2360
2523
|
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
2361
2524
|
return (request) => {
|
|
2362
2525
|
const url = new URL(request.url);
|
|
2363
|
-
url.pathname =
|
|
2526
|
+
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
|
|
2364
2527
|
return new Request(url, request);
|
|
2365
2528
|
};
|
|
2366
2529
|
})();
|
|
@@ -2374,10 +2537,15 @@ var Hono = class _Hono {
|
|
|
2374
2537
|
this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler);
|
|
2375
2538
|
return this;
|
|
2376
2539
|
}
|
|
2377
|
-
#addRoute(method, path, handler) {
|
|
2540
|
+
#addRoute(method, path, handler, baseRoutePath) {
|
|
2378
2541
|
method = method.toUpperCase();
|
|
2379
2542
|
path = mergePath(this._basePath, path);
|
|
2380
|
-
const r = {
|
|
2543
|
+
const r = {
|
|
2544
|
+
basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
|
|
2545
|
+
path,
|
|
2546
|
+
method,
|
|
2547
|
+
handler
|
|
2548
|
+
};
|
|
2381
2549
|
this.router.add(method, path, [handler, r]);
|
|
2382
2550
|
this.routes.push(r);
|
|
2383
2551
|
}
|
|
@@ -2492,7 +2660,7 @@ var Hono = class _Hono {
|
|
|
2492
2660
|
};
|
|
2493
2661
|
};
|
|
2494
2662
|
|
|
2495
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2663
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
2496
2664
|
var emptyParam = [];
|
|
2497
2665
|
function match(method, path) {
|
|
2498
2666
|
const matchers = this.buildAllMatchers();
|
|
@@ -2513,7 +2681,7 @@ function match(method, path) {
|
|
|
2513
2681
|
return match22(method, path);
|
|
2514
2682
|
}
|
|
2515
2683
|
|
|
2516
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2684
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
2517
2685
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
2518
2686
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
2519
2687
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -2621,7 +2789,7 @@ var Node = class _Node {
|
|
|
2621
2789
|
}
|
|
2622
2790
|
};
|
|
2623
2791
|
|
|
2624
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2792
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
2625
2793
|
var Trie = class {
|
|
2626
2794
|
#context = { varIndex: 0 };
|
|
2627
2795
|
#root = new Node();
|
|
@@ -2677,7 +2845,7 @@ var Trie = class {
|
|
|
2677
2845
|
}
|
|
2678
2846
|
};
|
|
2679
2847
|
|
|
2680
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2848
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
2681
2849
|
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
2682
2850
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
2683
2851
|
function buildWildcardRegExp(path) {
|
|
@@ -2856,7 +3024,7 @@ var RegExpRouter = class {
|
|
|
2856
3024
|
}
|
|
2857
3025
|
};
|
|
2858
3026
|
|
|
2859
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
3027
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router/smart-router/router.js
|
|
2860
3028
|
var SmartRouter = class {
|
|
2861
3029
|
name = "SmartRouter";
|
|
2862
3030
|
#routers = [];
|
|
@@ -2911,7 +3079,7 @@ var SmartRouter = class {
|
|
|
2911
3079
|
}
|
|
2912
3080
|
};
|
|
2913
3081
|
|
|
2914
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
3082
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router/trie-router/node.js
|
|
2915
3083
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
2916
3084
|
var hasChildren = (children) => {
|
|
2917
3085
|
for (const _ in children) {
|
|
@@ -3045,6 +3213,15 @@ var Node2 = class _Node2 {
|
|
|
3045
3213
|
if (m) {
|
|
3046
3214
|
params[name] = m[0];
|
|
3047
3215
|
this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
|
|
3216
|
+
if (m[0].length === restPathString.length && child.#children["*"]) {
|
|
3217
|
+
this.#pushHandlerSets(
|
|
3218
|
+
handlerSets,
|
|
3219
|
+
child.#children["*"],
|
|
3220
|
+
method,
|
|
3221
|
+
node.#params,
|
|
3222
|
+
params
|
|
3223
|
+
);
|
|
3224
|
+
}
|
|
3048
3225
|
if (hasChildren(child.#children)) {
|
|
3049
3226
|
child.#params = params;
|
|
3050
3227
|
const componentCount = m[0].match(/\//)?.length ?? 0;
|
|
@@ -3086,7 +3263,7 @@ var Node2 = class _Node2 {
|
|
|
3086
3263
|
}
|
|
3087
3264
|
};
|
|
3088
3265
|
|
|
3089
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
3266
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/router/trie-router/router.js
|
|
3090
3267
|
var TrieRouter = class {
|
|
3091
3268
|
name = "TrieRouter";
|
|
3092
3269
|
#node;
|
|
@@ -3108,7 +3285,7 @@ var TrieRouter = class {
|
|
|
3108
3285
|
}
|
|
3109
3286
|
};
|
|
3110
3287
|
|
|
3111
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
3288
|
+
// ../../node_modules/.pnpm/hono@4.12.30/node_modules/hono/dist/hono.js
|
|
3112
3289
|
var Hono2 = class extends Hono {
|
|
3113
3290
|
/**
|
|
3114
3291
|
* Creates an instance of the Hono class.
|
|
@@ -3310,10 +3487,11 @@ ${results.length > 0 ? `<ul class="entries">${rows}</ul>` : (() => {
|
|
|
3310
3487
|
return app;
|
|
3311
3488
|
}
|
|
3312
3489
|
|
|
3313
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
3490
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/common/utils.mjs
|
|
3314
3491
|
var utils_exports = {};
|
|
3315
3492
|
__export(utils_exports, {
|
|
3316
3493
|
arrayReplaceAt: () => arrayReplaceAt,
|
|
3494
|
+
asciiTrim: () => asciiTrim,
|
|
3317
3495
|
assign: () => assign,
|
|
3318
3496
|
escapeHtml: () => escapeHtml2,
|
|
3319
3497
|
escapeRE: () => escapeRE,
|
|
@@ -3321,6 +3499,7 @@ __export(utils_exports, {
|
|
|
3321
3499
|
has: () => has,
|
|
3322
3500
|
isMdAsciiPunct: () => isMdAsciiPunct,
|
|
3323
3501
|
isPunctChar: () => isPunctChar,
|
|
3502
|
+
isPunctCharCode: () => isPunctCharCode,
|
|
3324
3503
|
isSpace: () => isSpace,
|
|
3325
3504
|
isString: () => isString,
|
|
3326
3505
|
isValidEntityCode: () => isValidEntityCode,
|
|
@@ -4148,6 +4327,9 @@ var xmlDecoder = getDecoder(decode_data_xml_default);
|
|
|
4148
4327
|
function decodeHTML(str, mode = DecodingMode.Legacy) {
|
|
4149
4328
|
return htmlDecoder(str, mode);
|
|
4150
4329
|
}
|
|
4330
|
+
function decodeHTMLStrict(str) {
|
|
4331
|
+
return htmlDecoder(str, DecodingMode.Strict);
|
|
4332
|
+
}
|
|
4151
4333
|
|
|
4152
4334
|
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/encode-html.js
|
|
4153
4335
|
function restoreDiff(arr) {
|
|
@@ -4216,7 +4398,7 @@ var EncodingMode;
|
|
|
4216
4398
|
EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
|
|
4217
4399
|
})(EncodingMode || (EncodingMode = {}));
|
|
4218
4400
|
|
|
4219
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
4401
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/common/utils.mjs
|
|
4220
4402
|
function _class(obj) {
|
|
4221
4403
|
return Object.prototype.toString.call(obj);
|
|
4222
4404
|
}
|
|
@@ -4373,6 +4555,9 @@ function isWhiteSpace(code2) {
|
|
|
4373
4555
|
function isPunctChar(ch) {
|
|
4374
4556
|
return regex_default4.test(ch) || regex_default5.test(ch);
|
|
4375
4557
|
}
|
|
4558
|
+
function isPunctCharCode(code2) {
|
|
4559
|
+
return isPunctChar(fromCodePoint2(code2));
|
|
4560
|
+
}
|
|
4376
4561
|
function isMdAsciiPunct(ch) {
|
|
4377
4562
|
switch (ch) {
|
|
4378
4563
|
case 33:
|
|
@@ -4419,9 +4604,27 @@ function normalizeReference(str) {
|
|
|
4419
4604
|
}
|
|
4420
4605
|
return str.toLowerCase().toUpperCase();
|
|
4421
4606
|
}
|
|
4607
|
+
function isAsciiTrimmable(c) {
|
|
4608
|
+
return c === 32 || c === 9 || c === 10 || c === 13;
|
|
4609
|
+
}
|
|
4610
|
+
function asciiTrim(str) {
|
|
4611
|
+
let start = 0;
|
|
4612
|
+
for (; start < str.length; start++) {
|
|
4613
|
+
if (!isAsciiTrimmable(str.charCodeAt(start))) {
|
|
4614
|
+
break;
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
let end = str.length - 1;
|
|
4618
|
+
for (; end >= start; end--) {
|
|
4619
|
+
if (!isAsciiTrimmable(str.charCodeAt(end))) {
|
|
4620
|
+
break;
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
return str.slice(start, end + 1);
|
|
4624
|
+
}
|
|
4422
4625
|
var lib = { mdurl: mdurl_exports, ucmicro: uc_exports };
|
|
4423
4626
|
|
|
4424
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
4627
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/helpers/index.mjs
|
|
4425
4628
|
var helpers_exports = {};
|
|
4426
4629
|
__export(helpers_exports, {
|
|
4427
4630
|
parseLinkDestination: () => parseLinkDestination,
|
|
@@ -4429,7 +4632,7 @@ __export(helpers_exports, {
|
|
|
4429
4632
|
parseLinkTitle: () => parseLinkTitle
|
|
4430
4633
|
});
|
|
4431
4634
|
|
|
4432
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
4635
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/helpers/parse_link_label.mjs
|
|
4433
4636
|
function parseLinkLabel(state, start, disableNested) {
|
|
4434
4637
|
let level, found, marker, prevPos;
|
|
4435
4638
|
const max = state.posMax;
|
|
@@ -4464,7 +4667,7 @@ function parseLinkLabel(state, start, disableNested) {
|
|
|
4464
4667
|
return labelEnd;
|
|
4465
4668
|
}
|
|
4466
4669
|
|
|
4467
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
4670
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs
|
|
4468
4671
|
function parseLinkDestination(str, start, max) {
|
|
4469
4672
|
let code2;
|
|
4470
4673
|
let pos = start;
|
|
@@ -4539,7 +4742,7 @@ function parseLinkDestination(str, start, max) {
|
|
|
4539
4742
|
return result;
|
|
4540
4743
|
}
|
|
4541
4744
|
|
|
4542
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
4745
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/helpers/parse_link_title.mjs
|
|
4543
4746
|
function parseLinkTitle(str, start, max, prev_state) {
|
|
4544
4747
|
let code2;
|
|
4545
4748
|
let pos = start;
|
|
@@ -4592,7 +4795,7 @@ function parseLinkTitle(str, start, max, prev_state) {
|
|
|
4592
4795
|
return state;
|
|
4593
4796
|
}
|
|
4594
4797
|
|
|
4595
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
4798
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/renderer.mjs
|
|
4596
4799
|
var default_rules = {};
|
|
4597
4800
|
default_rules.code_inline = function(tokens, idx, options, env, slf) {
|
|
4598
4801
|
const token = tokens[idx];
|
|
@@ -4757,7 +4960,7 @@ Renderer.prototype.render = function(tokens, options, env) {
|
|
|
4757
4960
|
};
|
|
4758
4961
|
var renderer_default = Renderer;
|
|
4759
4962
|
|
|
4760
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
4963
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/ruler.mjs
|
|
4761
4964
|
function Ruler() {
|
|
4762
4965
|
this.__rules__ = [];
|
|
4763
4966
|
this.__cache__ = null;
|
|
@@ -4900,7 +5103,7 @@ Ruler.prototype.getRules = function(chainName) {
|
|
|
4900
5103
|
};
|
|
4901
5104
|
var ruler_default = Ruler;
|
|
4902
5105
|
|
|
4903
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5106
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/token.mjs
|
|
4904
5107
|
function Token(type, tag, nesting) {
|
|
4905
5108
|
this.type = type;
|
|
4906
5109
|
this.tag = tag;
|
|
@@ -4962,7 +5165,7 @@ Token.prototype.attrJoin = function attrJoin(name, value) {
|
|
|
4962
5165
|
};
|
|
4963
5166
|
var token_default = Token;
|
|
4964
5167
|
|
|
4965
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5168
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/state_core.mjs
|
|
4966
5169
|
function StateCore(src, md2, env) {
|
|
4967
5170
|
this.src = src;
|
|
4968
5171
|
this.env = env;
|
|
@@ -4973,7 +5176,7 @@ function StateCore(src, md2, env) {
|
|
|
4973
5176
|
StateCore.prototype.Token = token_default;
|
|
4974
5177
|
var state_core_default = StateCore;
|
|
4975
5178
|
|
|
4976
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5179
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/normalize.mjs
|
|
4977
5180
|
var NEWLINES_RE = /\r\n?|\n/g;
|
|
4978
5181
|
var NULL_RE = /\0/g;
|
|
4979
5182
|
function normalize(state) {
|
|
@@ -4983,7 +5186,7 @@ function normalize(state) {
|
|
|
4983
5186
|
state.src = str;
|
|
4984
5187
|
}
|
|
4985
5188
|
|
|
4986
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5189
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/block.mjs
|
|
4987
5190
|
function block(state) {
|
|
4988
5191
|
let token;
|
|
4989
5192
|
if (state.inlineMode) {
|
|
@@ -4997,7 +5200,7 @@ function block(state) {
|
|
|
4997
5200
|
}
|
|
4998
5201
|
}
|
|
4999
5202
|
|
|
5000
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5203
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/inline.mjs
|
|
5001
5204
|
function inline(state) {
|
|
5002
5205
|
const tokens = state.tokens;
|
|
5003
5206
|
for (let i = 0, l = tokens.length; i < l; i++) {
|
|
@@ -5008,7 +5211,7 @@ function inline(state) {
|
|
|
5008
5211
|
}
|
|
5009
5212
|
}
|
|
5010
5213
|
|
|
5011
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5214
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/linkify.mjs
|
|
5012
5215
|
function isLinkOpen(str) {
|
|
5013
5216
|
return /^<a[>\s]/i.test(str);
|
|
5014
5217
|
}
|
|
@@ -5105,7 +5308,7 @@ function linkify(state) {
|
|
|
5105
5308
|
}
|
|
5106
5309
|
}
|
|
5107
5310
|
|
|
5108
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5311
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/replacements.mjs
|
|
5109
5312
|
var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
|
|
5110
5313
|
var SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
|
|
5111
5314
|
var SCOPED_ABBR_RE = /\((c|tm|r)\)/ig;
|
|
@@ -5167,16 +5370,31 @@ function replace(state) {
|
|
|
5167
5370
|
}
|
|
5168
5371
|
}
|
|
5169
5372
|
|
|
5170
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5373
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/smartquotes.mjs
|
|
5171
5374
|
var QUOTE_TEST_RE = /['"]/;
|
|
5172
5375
|
var QUOTE_RE = /['"]/g;
|
|
5173
5376
|
var APOSTROPHE = "\u2019";
|
|
5174
|
-
function
|
|
5175
|
-
|
|
5377
|
+
function addReplacement(replacements, tokenIdx, pos, ch) {
|
|
5378
|
+
if (!replacements[tokenIdx]) {
|
|
5379
|
+
replacements[tokenIdx] = [];
|
|
5380
|
+
}
|
|
5381
|
+
replacements[tokenIdx].push({ pos, ch });
|
|
5382
|
+
}
|
|
5383
|
+
function applyReplacements(str, replacements) {
|
|
5384
|
+
let result = "";
|
|
5385
|
+
let lastPos = 0;
|
|
5386
|
+
replacements.sort((a, b) => a.pos - b.pos);
|
|
5387
|
+
for (let i = 0; i < replacements.length; i++) {
|
|
5388
|
+
const replacement = replacements[i];
|
|
5389
|
+
result += str.slice(lastPos, replacement.pos) + replacement.ch;
|
|
5390
|
+
lastPos = replacement.pos + 1;
|
|
5391
|
+
}
|
|
5392
|
+
return result + str.slice(lastPos);
|
|
5176
5393
|
}
|
|
5177
5394
|
function process_inlines(tokens, state) {
|
|
5178
5395
|
let j;
|
|
5179
5396
|
const stack = [];
|
|
5397
|
+
const replacements = {};
|
|
5180
5398
|
for (let i = 0; i < tokens.length; i++) {
|
|
5181
5399
|
const token = tokens[i];
|
|
5182
5400
|
const thisLevel = tokens[i].level;
|
|
@@ -5189,9 +5407,9 @@ function process_inlines(tokens, state) {
|
|
|
5189
5407
|
if (token.type !== "text") {
|
|
5190
5408
|
continue;
|
|
5191
5409
|
}
|
|
5192
|
-
|
|
5410
|
+
const text2 = token.content;
|
|
5193
5411
|
let pos = 0;
|
|
5194
|
-
|
|
5412
|
+
const max = text2.length;
|
|
5195
5413
|
OUTER:
|
|
5196
5414
|
while (pos < max) {
|
|
5197
5415
|
QUOTE_RE.lastIndex = pos;
|
|
@@ -5225,8 +5443,8 @@ function process_inlines(tokens, state) {
|
|
|
5225
5443
|
break;
|
|
5226
5444
|
}
|
|
5227
5445
|
}
|
|
5228
|
-
const isLastPunctChar = isMdAsciiPunct(lastChar) ||
|
|
5229
|
-
const isNextPunctChar = isMdAsciiPunct(nextChar) ||
|
|
5446
|
+
const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
|
|
5447
|
+
const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
|
|
5230
5448
|
const isLastWhiteSpace = isWhiteSpace(lastChar);
|
|
5231
5449
|
const isNextWhiteSpace = isWhiteSpace(nextChar);
|
|
5232
5450
|
if (isNextWhiteSpace) {
|
|
@@ -5254,7 +5472,7 @@ function process_inlines(tokens, state) {
|
|
|
5254
5472
|
}
|
|
5255
5473
|
if (!canOpen && !canClose) {
|
|
5256
5474
|
if (isSingle) {
|
|
5257
|
-
|
|
5475
|
+
addReplacement(replacements, i, t.index, APOSTROPHE);
|
|
5258
5476
|
}
|
|
5259
5477
|
continue;
|
|
5260
5478
|
}
|
|
@@ -5275,18 +5493,8 @@ function process_inlines(tokens, state) {
|
|
|
5275
5493
|
openQuote = state.md.options.quotes[0];
|
|
5276
5494
|
closeQuote = state.md.options.quotes[1];
|
|
5277
5495
|
}
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
tokens[item.token].content,
|
|
5281
|
-
item.pos,
|
|
5282
|
-
openQuote
|
|
5283
|
-
);
|
|
5284
|
-
pos += closeQuote.length - 1;
|
|
5285
|
-
if (item.token === i) {
|
|
5286
|
-
pos += openQuote.length - 1;
|
|
5287
|
-
}
|
|
5288
|
-
text2 = token.content;
|
|
5289
|
-
max = text2.length;
|
|
5496
|
+
addReplacement(replacements, i, t.index, closeQuote);
|
|
5497
|
+
addReplacement(replacements, item.token, item.pos, openQuote);
|
|
5290
5498
|
stack.length = j;
|
|
5291
5499
|
continue OUTER;
|
|
5292
5500
|
}
|
|
@@ -5300,10 +5508,13 @@ function process_inlines(tokens, state) {
|
|
|
5300
5508
|
level: thisLevel
|
|
5301
5509
|
});
|
|
5302
5510
|
} else if (canClose && isSingle) {
|
|
5303
|
-
|
|
5511
|
+
addReplacement(replacements, i, t.index, APOSTROPHE);
|
|
5304
5512
|
}
|
|
5305
5513
|
}
|
|
5306
5514
|
}
|
|
5515
|
+
Object.keys(replacements).forEach(function(tokenIdx) {
|
|
5516
|
+
tokens[tokenIdx].content = applyReplacements(tokens[tokenIdx].content, replacements[tokenIdx]);
|
|
5517
|
+
});
|
|
5307
5518
|
}
|
|
5308
5519
|
function smartquotes(state) {
|
|
5309
5520
|
if (!state.md.options.typographer) {
|
|
@@ -5317,7 +5528,7 @@ function smartquotes(state) {
|
|
|
5317
5528
|
}
|
|
5318
5529
|
}
|
|
5319
5530
|
|
|
5320
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5531
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_core/text_join.mjs
|
|
5321
5532
|
function text_join(state) {
|
|
5322
5533
|
let curr, last;
|
|
5323
5534
|
const blockTokens = state.tokens;
|
|
@@ -5347,7 +5558,7 @@ function text_join(state) {
|
|
|
5347
5558
|
}
|
|
5348
5559
|
}
|
|
5349
5560
|
|
|
5350
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5561
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/parser_core.mjs
|
|
5351
5562
|
var _rules = [
|
|
5352
5563
|
["normalize", normalize],
|
|
5353
5564
|
["block", block],
|
|
@@ -5374,7 +5585,7 @@ Core.prototype.process = function(state) {
|
|
|
5374
5585
|
Core.prototype.State = state_core_default;
|
|
5375
5586
|
var parser_core_default = Core;
|
|
5376
5587
|
|
|
5377
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5588
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/state_block.mjs
|
|
5378
5589
|
function StateBlock(src, md2, env, tokens) {
|
|
5379
5590
|
this.src = src;
|
|
5380
5591
|
this.md = md2;
|
|
@@ -5531,7 +5742,7 @@ StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF
|
|
|
5531
5742
|
StateBlock.prototype.Token = token_default;
|
|
5532
5743
|
var state_block_default = StateBlock;
|
|
5533
5744
|
|
|
5534
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5745
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/table.mjs
|
|
5535
5746
|
var MAX_AUTOCOMPLETED_CELLS = 65536;
|
|
5536
5747
|
function getLine(state, line) {
|
|
5537
5748
|
const pos = state.bMarks[line] + state.tShift[line];
|
|
@@ -5721,7 +5932,7 @@ function table(state, startLine, endLine, silent) {
|
|
|
5721
5932
|
return true;
|
|
5722
5933
|
}
|
|
5723
5934
|
|
|
5724
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5935
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/code.mjs
|
|
5725
5936
|
function code(state, startLine, endLine) {
|
|
5726
5937
|
if (state.sCount[startLine] - state.blkIndent < 4) {
|
|
5727
5938
|
return false;
|
|
@@ -5747,7 +5958,7 @@ function code(state, startLine, endLine) {
|
|
|
5747
5958
|
return true;
|
|
5748
5959
|
}
|
|
5749
5960
|
|
|
5750
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
5961
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/fence.mjs
|
|
5751
5962
|
function fence(state, startLine, endLine, silent) {
|
|
5752
5963
|
let pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
5753
5964
|
let max = state.eMarks[startLine];
|
|
@@ -5816,7 +6027,7 @@ function fence(state, startLine, endLine, silent) {
|
|
|
5816
6027
|
return true;
|
|
5817
6028
|
}
|
|
5818
6029
|
|
|
5819
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6030
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/blockquote.mjs
|
|
5820
6031
|
function blockquote(state, startLine, endLine, silent) {
|
|
5821
6032
|
let pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
5822
6033
|
let max = state.eMarks[startLine];
|
|
@@ -5941,7 +6152,7 @@ function blockquote(state, startLine, endLine, silent) {
|
|
|
5941
6152
|
return true;
|
|
5942
6153
|
}
|
|
5943
6154
|
|
|
5944
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6155
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/hr.mjs
|
|
5945
6156
|
function hr(state, startLine, endLine, silent) {
|
|
5946
6157
|
const max = state.eMarks[startLine];
|
|
5947
6158
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
@@ -5975,7 +6186,7 @@ function hr(state, startLine, endLine, silent) {
|
|
|
5975
6186
|
return true;
|
|
5976
6187
|
}
|
|
5977
6188
|
|
|
5978
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6189
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/list.mjs
|
|
5979
6190
|
function skipBulletListMarker(state, startLine) {
|
|
5980
6191
|
const max = state.eMarks[startLine];
|
|
5981
6192
|
let pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
@@ -6199,7 +6410,7 @@ function list(state, startLine, endLine, silent) {
|
|
|
6199
6410
|
return true;
|
|
6200
6411
|
}
|
|
6201
6412
|
|
|
6202
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6413
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/reference.mjs
|
|
6203
6414
|
function reference(state, startLine, _endLine, silent) {
|
|
6204
6415
|
let pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
6205
6416
|
let max = state.eMarks[startLine];
|
|
@@ -6374,7 +6585,7 @@ function reference(state, startLine, _endLine, silent) {
|
|
|
6374
6585
|
return true;
|
|
6375
6586
|
}
|
|
6376
6587
|
|
|
6377
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6588
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/common/html_blocks.mjs
|
|
6378
6589
|
var html_blocks_default = [
|
|
6379
6590
|
"address",
|
|
6380
6591
|
"article",
|
|
@@ -6440,7 +6651,7 @@ var html_blocks_default = [
|
|
|
6440
6651
|
"ul"
|
|
6441
6652
|
];
|
|
6442
6653
|
|
|
6443
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6654
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/common/html_re.mjs
|
|
6444
6655
|
var attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*";
|
|
6445
6656
|
var unquoted = "[^\"'=<>`\\x00-\\x20]+";
|
|
6446
6657
|
var single_quoted = "'[^']*'";
|
|
@@ -6456,7 +6667,7 @@ var cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";
|
|
|
6456
6667
|
var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")");
|
|
6457
6668
|
var HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
|
|
6458
6669
|
|
|
6459
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6670
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/html_block.mjs
|
|
6460
6671
|
var HTML_SEQUENCES = [
|
|
6461
6672
|
[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true],
|
|
6462
6673
|
[/^<!--/, /-->/, true],
|
|
@@ -6492,10 +6703,13 @@ function html_block(state, startLine, endLine, silent) {
|
|
|
6492
6703
|
return HTML_SEQUENCES[i][2];
|
|
6493
6704
|
}
|
|
6494
6705
|
let nextLine = startLine + 1;
|
|
6706
|
+
const endsOnBlankLine = HTML_SEQUENCES[i][1].test("");
|
|
6495
6707
|
if (!HTML_SEQUENCES[i][1].test(lineText)) {
|
|
6496
6708
|
for (; nextLine < endLine; nextLine++) {
|
|
6497
6709
|
if (state.sCount[nextLine] < state.blkIndent) {
|
|
6498
|
-
|
|
6710
|
+
if (endsOnBlankLine || !state.isEmpty(nextLine)) {
|
|
6711
|
+
break;
|
|
6712
|
+
}
|
|
6499
6713
|
}
|
|
6500
6714
|
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
6501
6715
|
max = state.eMarks[nextLine];
|
|
@@ -6515,7 +6729,7 @@ function html_block(state, startLine, endLine, silent) {
|
|
|
6515
6729
|
return true;
|
|
6516
6730
|
}
|
|
6517
6731
|
|
|
6518
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6732
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/heading.mjs
|
|
6519
6733
|
function heading(state, startLine, endLine, silent) {
|
|
6520
6734
|
let pos = state.bMarks[startLine] + state.tShift[startLine];
|
|
6521
6735
|
let max = state.eMarks[startLine];
|
|
@@ -6548,7 +6762,7 @@ function heading(state, startLine, endLine, silent) {
|
|
|
6548
6762
|
token_o.markup = "########".slice(0, level);
|
|
6549
6763
|
token_o.map = [startLine, state.line];
|
|
6550
6764
|
const token_i = state.push("inline", "", 0);
|
|
6551
|
-
token_i.content = state.src.slice(pos, max)
|
|
6765
|
+
token_i.content = asciiTrim(state.src.slice(pos, max));
|
|
6552
6766
|
token_i.map = [startLine, state.line];
|
|
6553
6767
|
token_i.children = [];
|
|
6554
6768
|
const token_c = state.push("heading_close", "h" + String(level), -1);
|
|
@@ -6556,7 +6770,7 @@ function heading(state, startLine, endLine, silent) {
|
|
|
6556
6770
|
return true;
|
|
6557
6771
|
}
|
|
6558
6772
|
|
|
6559
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6773
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/lheading.mjs
|
|
6560
6774
|
function lheading(state, startLine, endLine) {
|
|
6561
6775
|
const terminatorRules = state.md.block.ruler.getRules("paragraph");
|
|
6562
6776
|
if (state.sCount[startLine] - state.blkIndent >= 4) {
|
|
@@ -6601,9 +6815,10 @@ function lheading(state, startLine, endLine) {
|
|
|
6601
6815
|
}
|
|
6602
6816
|
}
|
|
6603
6817
|
if (!level) {
|
|
6818
|
+
state.parentType = oldParentType;
|
|
6604
6819
|
return false;
|
|
6605
6820
|
}
|
|
6606
|
-
const content = state.getLines(startLine, nextLine, state.blkIndent, false)
|
|
6821
|
+
const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
|
|
6607
6822
|
state.line = nextLine + 1;
|
|
6608
6823
|
const token_o = state.push("heading_open", "h" + String(level), 1);
|
|
6609
6824
|
token_o.markup = String.fromCharCode(marker);
|
|
@@ -6618,7 +6833,7 @@ function lheading(state, startLine, endLine) {
|
|
|
6618
6833
|
return true;
|
|
6619
6834
|
}
|
|
6620
6835
|
|
|
6621
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6836
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_block/paragraph.mjs
|
|
6622
6837
|
function paragraph(state, startLine, endLine) {
|
|
6623
6838
|
const terminatorRules = state.md.block.ruler.getRules("paragraph");
|
|
6624
6839
|
const oldParentType = state.parentType;
|
|
@@ -6642,7 +6857,7 @@ function paragraph(state, startLine, endLine) {
|
|
|
6642
6857
|
break;
|
|
6643
6858
|
}
|
|
6644
6859
|
}
|
|
6645
|
-
const content = state.getLines(startLine, nextLine, state.blkIndent, false)
|
|
6860
|
+
const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
|
|
6646
6861
|
state.line = nextLine;
|
|
6647
6862
|
const token_o = state.push("paragraph_open", "p", 1);
|
|
6648
6863
|
token_o.map = [startLine, state.line];
|
|
@@ -6655,7 +6870,7 @@ function paragraph(state, startLine, endLine) {
|
|
|
6655
6870
|
return true;
|
|
6656
6871
|
}
|
|
6657
6872
|
|
|
6658
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6873
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/parser_block.mjs
|
|
6659
6874
|
var _rules2 = [
|
|
6660
6875
|
// First 2 params - rule name & source. Secondary array - list of rules,
|
|
6661
6876
|
// which can be terminated by this one.
|
|
@@ -6729,7 +6944,7 @@ ParserBlock.prototype.parse = function(src, md2, env, outTokens) {
|
|
|
6729
6944
|
ParserBlock.prototype.State = state_block_default;
|
|
6730
6945
|
var parser_block_default = ParserBlock;
|
|
6731
6946
|
|
|
6732
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
6947
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/state_inline.mjs
|
|
6733
6948
|
function StateInline(src, md2, env, outTokens) {
|
|
6734
6949
|
this.src = src;
|
|
6735
6950
|
this.env = env;
|
|
@@ -6781,15 +6996,37 @@ StateInline.prototype.push = function(type, tag, nesting) {
|
|
|
6781
6996
|
StateInline.prototype.scanDelims = function(start, canSplitWord) {
|
|
6782
6997
|
const max = this.posMax;
|
|
6783
6998
|
const marker = this.src.charCodeAt(start);
|
|
6784
|
-
|
|
6999
|
+
let lastChar;
|
|
7000
|
+
if (start === 0) {
|
|
7001
|
+
lastChar = 32;
|
|
7002
|
+
} else if (start === 1) {
|
|
7003
|
+
lastChar = this.src.charCodeAt(0);
|
|
7004
|
+
if ((lastChar & 63488) === 55296) {
|
|
7005
|
+
lastChar = 65533;
|
|
7006
|
+
}
|
|
7007
|
+
} else {
|
|
7008
|
+
lastChar = this.src.charCodeAt(start - 1);
|
|
7009
|
+
if ((lastChar & 64512) === 56320) {
|
|
7010
|
+
const highSurr = this.src.charCodeAt(start - 2);
|
|
7011
|
+
lastChar = (highSurr & 64512) === 55296 ? 65536 + (highSurr - 55296 << 10) + (lastChar - 56320) : 65533;
|
|
7012
|
+
} else if ((lastChar & 64512) === 55296) {
|
|
7013
|
+
lastChar = 65533;
|
|
7014
|
+
}
|
|
7015
|
+
}
|
|
6785
7016
|
let pos = start;
|
|
6786
7017
|
while (pos < max && this.src.charCodeAt(pos) === marker) {
|
|
6787
7018
|
pos++;
|
|
6788
7019
|
}
|
|
6789
7020
|
const count = pos - start;
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
7021
|
+
let nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
|
|
7022
|
+
if ((nextChar & 64512) === 55296) {
|
|
7023
|
+
const lowSurr = this.src.charCodeAt(pos + 1);
|
|
7024
|
+
nextChar = (lowSurr & 64512) === 56320 ? 65536 + (nextChar - 55296 << 10) + (lowSurr - 56320) : 65533;
|
|
7025
|
+
} else if ((nextChar & 64512) === 56320) {
|
|
7026
|
+
nextChar = 65533;
|
|
7027
|
+
}
|
|
7028
|
+
const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
|
|
7029
|
+
const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
|
|
6793
7030
|
const isLastWhiteSpace = isWhiteSpace(lastChar);
|
|
6794
7031
|
const isNextWhiteSpace = isWhiteSpace(nextChar);
|
|
6795
7032
|
const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
|
|
@@ -6801,7 +7038,7 @@ StateInline.prototype.scanDelims = function(start, canSplitWord) {
|
|
|
6801
7038
|
StateInline.prototype.Token = token_default;
|
|
6802
7039
|
var state_inline_default = StateInline;
|
|
6803
7040
|
|
|
6804
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7041
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/text.mjs
|
|
6805
7042
|
function isTerminatorChar(ch) {
|
|
6806
7043
|
switch (ch) {
|
|
6807
7044
|
case 10:
|
|
@@ -6847,7 +7084,7 @@ function text(state, silent) {
|
|
|
6847
7084
|
return true;
|
|
6848
7085
|
}
|
|
6849
7086
|
|
|
6850
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7087
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/linkify.mjs
|
|
6851
7088
|
var SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
|
|
6852
7089
|
function linkify2(state, silent) {
|
|
6853
7090
|
if (!state.md.options.linkify) return false;
|
|
@@ -6890,7 +7127,7 @@ function linkify2(state, silent) {
|
|
|
6890
7127
|
return true;
|
|
6891
7128
|
}
|
|
6892
7129
|
|
|
6893
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7130
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/newline.mjs
|
|
6894
7131
|
function newline(state, silent) {
|
|
6895
7132
|
let pos = state.pos;
|
|
6896
7133
|
if (state.src.charCodeAt(pos) !== 10) {
|
|
@@ -6921,7 +7158,7 @@ function newline(state, silent) {
|
|
|
6921
7158
|
return true;
|
|
6922
7159
|
}
|
|
6923
7160
|
|
|
6924
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7161
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/escape.mjs
|
|
6925
7162
|
var ESCAPED = [];
|
|
6926
7163
|
for (let i = 0; i < 256; i++) {
|
|
6927
7164
|
ESCAPED.push(0);
|
|
@@ -6949,6 +7186,16 @@ function escape2(state, silent) {
|
|
|
6949
7186
|
state.pos = pos;
|
|
6950
7187
|
return true;
|
|
6951
7188
|
}
|
|
7189
|
+
if (ch1 === 32) {
|
|
7190
|
+
if (!silent) {
|
|
7191
|
+
const token = state.push("text_special", "", 0);
|
|
7192
|
+
token.content = "\\";
|
|
7193
|
+
token.markup = "\\";
|
|
7194
|
+
token.info = "escape";
|
|
7195
|
+
}
|
|
7196
|
+
state.pos = pos;
|
|
7197
|
+
return true;
|
|
7198
|
+
}
|
|
6952
7199
|
let escapedStr = state.src[pos];
|
|
6953
7200
|
if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {
|
|
6954
7201
|
const ch2 = state.src.charCodeAt(pos + 1);
|
|
@@ -6972,7 +7219,7 @@ function escape2(state, silent) {
|
|
|
6972
7219
|
return true;
|
|
6973
7220
|
}
|
|
6974
7221
|
|
|
6975
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7222
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/backticks.mjs
|
|
6976
7223
|
function backtick(state, silent) {
|
|
6977
7224
|
let pos = state.pos;
|
|
6978
7225
|
const ch = state.src.charCodeAt(pos);
|
|
@@ -7017,7 +7264,7 @@ function backtick(state, silent) {
|
|
|
7017
7264
|
return true;
|
|
7018
7265
|
}
|
|
7019
7266
|
|
|
7020
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7267
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs
|
|
7021
7268
|
function strikethrough_tokenize(state, silent) {
|
|
7022
7269
|
const start = state.pos;
|
|
7023
7270
|
const marker = state.src.charCodeAt(start);
|
|
@@ -7113,7 +7360,7 @@ var strikethrough_default = {
|
|
|
7113
7360
|
postProcess: strikethrough_postProcess
|
|
7114
7361
|
};
|
|
7115
7362
|
|
|
7116
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7363
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/emphasis.mjs
|
|
7117
7364
|
function emphasis_tokenize(state, silent) {
|
|
7118
7365
|
const start = state.pos;
|
|
7119
7366
|
const marker = state.src.charCodeAt(start);
|
|
@@ -7200,7 +7447,7 @@ var emphasis_default = {
|
|
|
7200
7447
|
postProcess: emphasis_post_process
|
|
7201
7448
|
};
|
|
7202
7449
|
|
|
7203
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7450
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/link.mjs
|
|
7204
7451
|
function link(state, silent) {
|
|
7205
7452
|
let code2, label, res, ref;
|
|
7206
7453
|
let href = "";
|
|
@@ -7308,7 +7555,7 @@ function link(state, silent) {
|
|
|
7308
7555
|
return true;
|
|
7309
7556
|
}
|
|
7310
7557
|
|
|
7311
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7558
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/image.mjs
|
|
7312
7559
|
function image(state, silent) {
|
|
7313
7560
|
let code2, content, label, pos, ref, res, title, start;
|
|
7314
7561
|
let href = "";
|
|
@@ -7421,7 +7668,7 @@ function image(state, silent) {
|
|
|
7421
7668
|
return true;
|
|
7422
7669
|
}
|
|
7423
7670
|
|
|
7424
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7671
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/autolink.mjs
|
|
7425
7672
|
var EMAIL_RE = /^([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])?)*)$/;
|
|
7426
7673
|
var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
|
|
7427
7674
|
function autolink(state, silent) {
|
|
@@ -7479,7 +7726,7 @@ function autolink(state, silent) {
|
|
|
7479
7726
|
return false;
|
|
7480
7727
|
}
|
|
7481
7728
|
|
|
7482
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7729
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/html_inline.mjs
|
|
7483
7730
|
function isLinkOpen2(str) {
|
|
7484
7731
|
return /^<a[>\s]/i.test(str);
|
|
7485
7732
|
}
|
|
@@ -7517,7 +7764,7 @@ function html_inline(state, silent) {
|
|
|
7517
7764
|
return true;
|
|
7518
7765
|
}
|
|
7519
7766
|
|
|
7520
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7767
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/entity.mjs
|
|
7521
7768
|
var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
|
|
7522
7769
|
var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
|
|
7523
7770
|
function entity(state, silent) {
|
|
@@ -7542,7 +7789,7 @@ function entity(state, silent) {
|
|
|
7542
7789
|
} else {
|
|
7543
7790
|
const match3 = state.src.slice(pos).match(NAMED_RE);
|
|
7544
7791
|
if (match3) {
|
|
7545
|
-
const decoded =
|
|
7792
|
+
const decoded = decodeHTMLStrict(match3[0]);
|
|
7546
7793
|
if (decoded !== match3[0]) {
|
|
7547
7794
|
if (!silent) {
|
|
7548
7795
|
const token = state.push("text_special", "", 0);
|
|
@@ -7558,7 +7805,7 @@ function entity(state, silent) {
|
|
|
7558
7805
|
return false;
|
|
7559
7806
|
}
|
|
7560
7807
|
|
|
7561
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7808
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs
|
|
7562
7809
|
function processDelimiters(delimiters) {
|
|
7563
7810
|
const openersBottom = {};
|
|
7564
7811
|
const max = delimiters.length;
|
|
@@ -7622,7 +7869,7 @@ function link_pairs(state) {
|
|
|
7622
7869
|
}
|
|
7623
7870
|
}
|
|
7624
7871
|
|
|
7625
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7872
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs
|
|
7626
7873
|
function fragments_join(state) {
|
|
7627
7874
|
let curr, last;
|
|
7628
7875
|
let level = 0;
|
|
@@ -7646,7 +7893,7 @@ function fragments_join(state) {
|
|
|
7646
7893
|
}
|
|
7647
7894
|
}
|
|
7648
7895
|
|
|
7649
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
7896
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/parser_inline.mjs
|
|
7650
7897
|
var _rules3 = [
|
|
7651
7898
|
["text", text],
|
|
7652
7899
|
["linkify", linkify2],
|
|
@@ -7753,7 +8000,7 @@ ParserInline.prototype.parse = function(str, md2, env, outTokens) {
|
|
|
7753
8000
|
ParserInline.prototype.State = state_inline_default;
|
|
7754
8001
|
var parser_inline_default = ParserInline;
|
|
7755
8002
|
|
|
7756
|
-
// ../../node_modules/.pnpm/linkify-it@5.0.
|
|
8003
|
+
// ../../node_modules/.pnpm/linkify-it@5.0.2/node_modules/linkify-it/lib/re.mjs
|
|
7757
8004
|
function re_default(opts) {
|
|
7758
8005
|
const re = {};
|
|
7759
8006
|
opts = opts || {};
|
|
@@ -7764,38 +8011,38 @@ function re_default(opts) {
|
|
|
7764
8011
|
re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join("|");
|
|
7765
8012
|
re.src_ZCc = [re.src_Z, re.src_Cc].join("|");
|
|
7766
8013
|
const text_separators = "[><\uFF5C]";
|
|
7767
|
-
re.src_pseudo_letter =
|
|
8014
|
+
re.src_pseudo_letter = `(?:(?!${text_separators}|${re.src_ZPCc})${re.src_Any})`;
|
|
7768
8015
|
re.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
|
|
7769
|
-
re.src_auth =
|
|
8016
|
+
re.src_auth = `(?:(?:(?!${re.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`;
|
|
7770
8017
|
re.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";
|
|
7771
|
-
re.src_host_terminator =
|
|
7772
|
-
re.src_path =
|
|
7773
|
-
|
|
7774
|
-
re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]
|
|
8018
|
+
re.src_host_terminator = `(?=$|${text_separators}|${re.src_ZPCc})(?!${opts["---"] ? "-(?!--)|" : "-|"}_|:\\d|\\.-|\\.(?!$|${re.src_ZPCc}))`;
|
|
8019
|
+
re.src_path = `(?:[/?#](?:(?!${re.src_ZCc}|${text_separators}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${re.src_ZCc}|\\]).)*\\]|\\((?:(?!${re.src_ZCc}|[)]).)*\\)|\\{(?:(?!${re.src_ZCc}|[}]).)*\\}|\\"(?:(?!${re.src_ZCc}|["]).)+\\"|\\'(?:(?!${re.src_ZCc}|[']).)+\\'|\\'(?=${re.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${re.src_ZCc}|[.]|$)|` + (opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + // allow `,,,` in paths
|
|
8020
|
+
`,(?!${re.src_ZCc}|$)|;(?!${re.src_ZCc}|$)|\\!+(?!${re.src_ZCc}|[!]|$)|\\?(?!${re.src_ZCc}|[?]|$))+|\\/)?`;
|
|
8021
|
+
re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}';
|
|
7775
8022
|
re.src_xn = "xn--[a-z0-9\\-]{1,59}";
|
|
7776
8023
|
re.src_domain_root = // Allow letters & digits (http://test1)
|
|
7777
|
-
"(?:" + re.src_xn +
|
|
7778
|
-
re.src_domain = "(?:" + re.src_xn +
|
|
7779
|
-
re.src_host =
|
|
7780
|
-
re.tpl_host_fuzzy = "(?:" + re.src_ip4 +
|
|
7781
|
-
re.tpl_host_no_ip_fuzzy =
|
|
8024
|
+
"(?:" + re.src_xn + `|${re.src_pseudo_letter}{1,63})`;
|
|
8025
|
+
re.src_domain = "(?:" + re.src_xn + `|(?:${re.src_pseudo_letter})|(?:${re.src_pseudo_letter}(?:-|${re.src_pseudo_letter}){0,61}${re.src_pseudo_letter}))`;
|
|
8026
|
+
re.src_host = `(?:(?:(?:(?:${re.src_domain})\\.)*${re.src_domain}))`;
|
|
8027
|
+
re.tpl_host_fuzzy = "(?:" + re.src_ip4 + `|(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%)))`;
|
|
8028
|
+
re.tpl_host_no_ip_fuzzy = `(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%))`;
|
|
7782
8029
|
re.src_host_strict = re.src_host + re.src_host_terminator;
|
|
7783
8030
|
re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;
|
|
7784
8031
|
re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;
|
|
7785
8032
|
re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
|
|
7786
8033
|
re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
|
|
7787
|
-
re.tpl_host_fuzzy_test =
|
|
7788
|
-
re.tpl_email_fuzzy =
|
|
8034
|
+
re.tpl_host_fuzzy_test = `localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${re.src_ZPCc}|>|$))`;
|
|
8035
|
+
re.tpl_email_fuzzy = `(^|${text_separators}|"|\\(|${re.src_ZCc})(${re.src_email_name}@${re.tpl_host_fuzzy_strict})`;
|
|
7789
8036
|
re.tpl_link_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
7790
8037
|
// but can start with > (markdown blockquote)
|
|
7791
|
-
|
|
8038
|
+
`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${re.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${re.tpl_host_port_fuzzy_strict}${re.src_path})`;
|
|
7792
8039
|
re.tpl_link_no_ip_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
7793
8040
|
// but can start with > (markdown blockquote)
|
|
7794
|
-
|
|
8041
|
+
`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${re.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${re.tpl_host_port_no_ip_fuzzy_strict}${re.src_path})`;
|
|
7795
8042
|
return re;
|
|
7796
8043
|
}
|
|
7797
8044
|
|
|
7798
|
-
// ../../node_modules/.pnpm/linkify-it@5.0.
|
|
8045
|
+
// ../../node_modules/.pnpm/linkify-it@5.0.2/node_modules/linkify-it/index.mjs
|
|
7799
8046
|
function assign2(obj) {
|
|
7800
8047
|
const sources = Array.prototype.slice.call(arguments, 1);
|
|
7801
8048
|
sources.forEach(function(source) {
|
|
@@ -7842,7 +8089,7 @@ var defaultSchemas = {
|
|
|
7842
8089
|
const tail = text2.slice(pos);
|
|
7843
8090
|
if (!self.re.http) {
|
|
7844
8091
|
self.re.http = new RegExp(
|
|
7845
|
-
|
|
8092
|
+
`^\\/\\/${self.re.src_auth}${self.re.src_host_port_strict}${self.re.src_path}`,
|
|
7846
8093
|
"i"
|
|
7847
8094
|
);
|
|
7848
8095
|
}
|
|
@@ -7861,7 +8108,7 @@ var defaultSchemas = {
|
|
|
7861
8108
|
self.re.no_http = new RegExp(
|
|
7862
8109
|
"^" + self.re.src_auth + // Don't allow single-level domains, because of false positives like '//test'
|
|
7863
8110
|
// with code comments
|
|
7864
|
-
|
|
8111
|
+
`(?:localhost|(?:(?:${self.re.src_domain})\\.)+${self.re.src_domain_root})` + self.re.src_port + self.re.src_host_terminator + self.re.src_path,
|
|
7865
8112
|
"i"
|
|
7866
8113
|
);
|
|
7867
8114
|
}
|
|
@@ -7882,7 +8129,7 @@ var defaultSchemas = {
|
|
|
7882
8129
|
const tail = text2.slice(pos);
|
|
7883
8130
|
if (!self.re.mailto) {
|
|
7884
8131
|
self.re.mailto = new RegExp(
|
|
7885
|
-
|
|
8132
|
+
`^${self.re.src_email_name}@${self.re.src_host_strict}`,
|
|
7886
8133
|
"i"
|
|
7887
8134
|
);
|
|
7888
8135
|
}
|
|
@@ -7895,10 +8142,6 @@ var defaultSchemas = {
|
|
|
7895
8142
|
};
|
|
7896
8143
|
var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
|
|
7897
8144
|
var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");
|
|
7898
|
-
function resetScanCache(self) {
|
|
7899
|
-
self.__index__ = -1;
|
|
7900
|
-
self.__text_cache__ = "";
|
|
7901
|
-
}
|
|
7902
8145
|
function createValidator(re) {
|
|
7903
8146
|
return function(text2, pos) {
|
|
7904
8147
|
const tail = text2.slice(pos);
|
|
@@ -7926,13 +8169,16 @@ function compile(self) {
|
|
|
7926
8169
|
return tpl.replace("%TLDS%", re.src_tlds);
|
|
7927
8170
|
}
|
|
7928
8171
|
re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
|
|
8172
|
+
re.email_fuzzy_global = RegExp(untpl(re.tpl_email_fuzzy), "ig");
|
|
7929
8173
|
re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
|
|
8174
|
+
re.link_fuzzy_global = RegExp(untpl(re.tpl_link_fuzzy), "ig");
|
|
7930
8175
|
re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
|
|
8176
|
+
re.link_no_ip_fuzzy_global = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "ig");
|
|
7931
8177
|
re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
|
|
7932
8178
|
const aliases = [];
|
|
7933
8179
|
self.__compiled__ = {};
|
|
7934
8180
|
function schemaError(name, val) {
|
|
7935
|
-
throw new Error(
|
|
8181
|
+
throw new Error(`(LinkifyIt) Invalid schema "${name}": ${val}`);
|
|
7936
8182
|
}
|
|
7937
8183
|
Object.keys(self.__schemas__).forEach(function(name) {
|
|
7938
8184
|
const val = self.__schemas__[name];
|
|
@@ -7975,30 +8221,22 @@ function compile(self) {
|
|
|
7975
8221
|
const slist = Object.keys(self.__compiled__).filter(function(name) {
|
|
7976
8222
|
return name.length > 0 && self.__compiled__[name];
|
|
7977
8223
|
}).map(escapeRE2).join("|");
|
|
7978
|
-
self.re.schema_test = RegExp(
|
|
7979
|
-
self.re.schema_search = RegExp(
|
|
7980
|
-
self.re.schema_at_start = RegExp(
|
|
8224
|
+
self.re.schema_test = RegExp(`(^|(?!_)(?:[><\uFF5C]|${re.src_ZPCc}))(${slist})`, "i");
|
|
8225
|
+
self.re.schema_search = RegExp(`(^|(?!_)(?:[><\uFF5C]|${re.src_ZPCc}))(${slist})`, "ig");
|
|
8226
|
+
self.re.schema_at_start = RegExp(`^${self.re.schema_search.source}`, "i");
|
|
7981
8227
|
self.re.pretest = RegExp(
|
|
7982
|
-
|
|
8228
|
+
`(${self.re.schema_test.source})|(${self.re.host_fuzzy_test.source})|@`,
|
|
7983
8229
|
"i"
|
|
7984
8230
|
);
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
this.
|
|
7992
|
-
this.
|
|
7993
|
-
this.
|
|
7994
|
-
this.raw = text2;
|
|
7995
|
-
this.text = text2;
|
|
7996
|
-
this.url = text2;
|
|
7997
|
-
}
|
|
7998
|
-
function createMatch(self, shift) {
|
|
7999
|
-
const match3 = new Match(self, shift);
|
|
8000
|
-
self.__compiled__[match3.schema].normalize(match3, self);
|
|
8001
|
-
return match3;
|
|
8231
|
+
}
|
|
8232
|
+
function Match(text2, schema, index, lastIndex) {
|
|
8233
|
+
const raw2 = text2.slice(index, lastIndex);
|
|
8234
|
+
this.schema = schema.toLowerCase();
|
|
8235
|
+
this.index = index;
|
|
8236
|
+
this.lastIndex = lastIndex;
|
|
8237
|
+
this.raw = raw2;
|
|
8238
|
+
this.text = raw2;
|
|
8239
|
+
this.url = raw2;
|
|
8002
8240
|
}
|
|
8003
8241
|
function LinkifyIt(schemas, options) {
|
|
8004
8242
|
if (!(this instanceof LinkifyIt)) {
|
|
@@ -8011,10 +8249,6 @@ function LinkifyIt(schemas, options) {
|
|
|
8011
8249
|
}
|
|
8012
8250
|
}
|
|
8013
8251
|
this.__opts__ = assign2({}, defaultOptions, options);
|
|
8014
|
-
this.__index__ = -1;
|
|
8015
|
-
this.__last_index__ = -1;
|
|
8016
|
-
this.__schema__ = "";
|
|
8017
|
-
this.__text_cache__ = "";
|
|
8018
8252
|
this.__schemas__ = assign2({}, defaultSchemas, schemas);
|
|
8019
8253
|
this.__compiled__ = {};
|
|
8020
8254
|
this.__tlds__ = tlds_default;
|
|
@@ -8032,55 +8266,34 @@ LinkifyIt.prototype.set = function set(options) {
|
|
|
8032
8266
|
return this;
|
|
8033
8267
|
};
|
|
8034
8268
|
LinkifyIt.prototype.test = function test(text2) {
|
|
8035
|
-
this.__text_cache__ = text2;
|
|
8036
|
-
this.__index__ = -1;
|
|
8037
8269
|
if (!text2.length) {
|
|
8038
8270
|
return false;
|
|
8039
8271
|
}
|
|
8040
|
-
let m,
|
|
8272
|
+
let m, re;
|
|
8041
8273
|
if (this.re.schema_test.test(text2)) {
|
|
8042
8274
|
re = this.re.schema_search;
|
|
8043
8275
|
re.lastIndex = 0;
|
|
8044
8276
|
while ((m = re.exec(text2)) !== null) {
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
this.__schema__ = m[2];
|
|
8048
|
-
this.__index__ = m.index + m[1].length;
|
|
8049
|
-
this.__last_index__ = m.index + m[0].length + len;
|
|
8050
|
-
break;
|
|
8277
|
+
if (this.testSchemaAt(text2, m[2], re.lastIndex)) {
|
|
8278
|
+
return true;
|
|
8051
8279
|
}
|
|
8052
8280
|
}
|
|
8053
8281
|
}
|
|
8054
8282
|
if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
if ((ml = text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
|
|
8059
|
-
shift = ml.index + ml[1].length;
|
|
8060
|
-
if (this.__index__ < 0 || shift < this.__index__) {
|
|
8061
|
-
this.__schema__ = "";
|
|
8062
|
-
this.__index__ = shift;
|
|
8063
|
-
this.__last_index__ = ml.index + ml[0].length;
|
|
8064
|
-
}
|
|
8065
|
-
}
|
|
8283
|
+
if (text2.search(this.re.host_fuzzy_test) >= 0) {
|
|
8284
|
+
if (text2.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy) !== null) {
|
|
8285
|
+
return true;
|
|
8066
8286
|
}
|
|
8067
8287
|
}
|
|
8068
8288
|
}
|
|
8069
8289
|
if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
shift = me.index + me[1].length;
|
|
8074
|
-
next = me.index + me[0].length;
|
|
8075
|
-
if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {
|
|
8076
|
-
this.__schema__ = "mailto:";
|
|
8077
|
-
this.__index__ = shift;
|
|
8078
|
-
this.__last_index__ = next;
|
|
8079
|
-
}
|
|
8290
|
+
if (text2.indexOf("@") >= 0) {
|
|
8291
|
+
if (text2.match(this.re.email_fuzzy) !== null) {
|
|
8292
|
+
return true;
|
|
8080
8293
|
}
|
|
8081
8294
|
}
|
|
8082
8295
|
}
|
|
8083
|
-
return
|
|
8296
|
+
return false;
|
|
8084
8297
|
};
|
|
8085
8298
|
LinkifyIt.prototype.pretest = function pretest(text2) {
|
|
8086
8299
|
return this.re.pretest.test(text2);
|
|
@@ -8093,16 +8306,87 @@ LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text2, schema, pos) {
|
|
|
8093
8306
|
};
|
|
8094
8307
|
LinkifyIt.prototype.match = function match2(text2) {
|
|
8095
8308
|
const result = [];
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8309
|
+
const type_schemed = [];
|
|
8310
|
+
const type_fuzzy_link = [];
|
|
8311
|
+
const type_fuzzy_email = [];
|
|
8312
|
+
let m, len, re;
|
|
8313
|
+
function choose(a, b) {
|
|
8314
|
+
if (!a) {
|
|
8315
|
+
return b;
|
|
8316
|
+
}
|
|
8317
|
+
if (!b) {
|
|
8318
|
+
return a;
|
|
8319
|
+
}
|
|
8320
|
+
if (a.index !== b.index) {
|
|
8321
|
+
return a.index < b.index ? a : b;
|
|
8322
|
+
}
|
|
8323
|
+
return a.lastIndex >= b.lastIndex ? a : b;
|
|
8100
8324
|
}
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8325
|
+
if (!text2.length) {
|
|
8326
|
+
return null;
|
|
8327
|
+
}
|
|
8328
|
+
if (this.re.schema_test.test(text2)) {
|
|
8329
|
+
re = this.re.schema_search;
|
|
8330
|
+
re.lastIndex = 0;
|
|
8331
|
+
while ((m = re.exec(text2)) !== null) {
|
|
8332
|
+
len = this.testSchemaAt(text2, m[2], re.lastIndex);
|
|
8333
|
+
if (len) {
|
|
8334
|
+
type_schemed.push({
|
|
8335
|
+
schema: m[2],
|
|
8336
|
+
index: m.index + m[1].length,
|
|
8337
|
+
lastIndex: m.index + m[0].length + len
|
|
8338
|
+
});
|
|
8339
|
+
}
|
|
8340
|
+
}
|
|
8341
|
+
}
|
|
8342
|
+
if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
|
|
8343
|
+
re = this.__opts__.fuzzyIP ? this.re.link_fuzzy_global : this.re.link_no_ip_fuzzy_global;
|
|
8344
|
+
re.lastIndex = 0;
|
|
8345
|
+
while ((m = re.exec(text2)) !== null) {
|
|
8346
|
+
type_fuzzy_link.push({
|
|
8347
|
+
schema: "",
|
|
8348
|
+
index: m.index + m[1].length,
|
|
8349
|
+
lastIndex: m.index + m[0].length
|
|
8350
|
+
});
|
|
8351
|
+
}
|
|
8352
|
+
}
|
|
8353
|
+
if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
|
|
8354
|
+
re = this.re.email_fuzzy_global;
|
|
8355
|
+
re.lastIndex = 0;
|
|
8356
|
+
while ((m = re.exec(text2)) !== null) {
|
|
8357
|
+
type_fuzzy_email.push({
|
|
8358
|
+
schema: "mailto:",
|
|
8359
|
+
index: m.index + m[1].length,
|
|
8360
|
+
lastIndex: m.index + m[0].length
|
|
8361
|
+
});
|
|
8362
|
+
}
|
|
8363
|
+
}
|
|
8364
|
+
const indexes = [0, 0, 0];
|
|
8365
|
+
let lastIndex = 0;
|
|
8366
|
+
for (; ; ) {
|
|
8367
|
+
const candidates = [
|
|
8368
|
+
type_schemed[indexes[0]],
|
|
8369
|
+
type_fuzzy_email[indexes[1]],
|
|
8370
|
+
type_fuzzy_link[indexes[2]]
|
|
8371
|
+
];
|
|
8372
|
+
const candidate = choose(choose(candidates[0], candidates[1]), candidates[2]);
|
|
8373
|
+
if (!candidate) {
|
|
8374
|
+
break;
|
|
8375
|
+
}
|
|
8376
|
+
if (candidate === candidates[0]) {
|
|
8377
|
+
indexes[0]++;
|
|
8378
|
+
} else if (candidate === candidates[1]) {
|
|
8379
|
+
indexes[1]++;
|
|
8380
|
+
} else {
|
|
8381
|
+
indexes[2]++;
|
|
8382
|
+
}
|
|
8383
|
+
if (candidate.index < lastIndex) {
|
|
8384
|
+
continue;
|
|
8385
|
+
}
|
|
8386
|
+
const match3 = new Match(text2, candidate.schema, candidate.index, candidate.lastIndex);
|
|
8387
|
+
this.__compiled__[match3.schema].normalize(match3, this);
|
|
8388
|
+
result.push(match3);
|
|
8389
|
+
lastIndex = candidate.lastIndex;
|
|
8106
8390
|
}
|
|
8107
8391
|
if (result.length) {
|
|
8108
8392
|
return result;
|
|
@@ -8110,17 +8394,14 @@ LinkifyIt.prototype.match = function match2(text2) {
|
|
|
8110
8394
|
return null;
|
|
8111
8395
|
};
|
|
8112
8396
|
LinkifyIt.prototype.matchAtStart = function matchAtStart(text2) {
|
|
8113
|
-
this.__text_cache__ = text2;
|
|
8114
|
-
this.__index__ = -1;
|
|
8115
8397
|
if (!text2.length) return null;
|
|
8116
8398
|
const m = this.re.schema_at_start.exec(text2);
|
|
8117
8399
|
if (!m) return null;
|
|
8118
8400
|
const len = this.testSchemaAt(text2, m[2], m[0].length);
|
|
8119
8401
|
if (!len) return null;
|
|
8120
|
-
|
|
8121
|
-
this.
|
|
8122
|
-
|
|
8123
|
-
return createMatch(this, 0);
|
|
8402
|
+
const match3 = new Match(text2, m[2], m.index + m[1].length, m.index + m[0].length + len);
|
|
8403
|
+
this.__compiled__[match3.schema].normalize(match3, this);
|
|
8404
|
+
return match3;
|
|
8124
8405
|
};
|
|
8125
8406
|
LinkifyIt.prototype.tlds = function tlds(list2, keepOld) {
|
|
8126
8407
|
list2 = Array.isArray(list2) ? list2 : [list2];
|
|
@@ -8138,10 +8419,10 @@ LinkifyIt.prototype.tlds = function tlds(list2, keepOld) {
|
|
|
8138
8419
|
};
|
|
8139
8420
|
LinkifyIt.prototype.normalize = function normalize2(match3) {
|
|
8140
8421
|
if (!match3.schema) {
|
|
8141
|
-
match3.url =
|
|
8422
|
+
match3.url = `http://${match3.url}`;
|
|
8142
8423
|
}
|
|
8143
8424
|
if (match3.schema === "mailto:" && !/^mailto:/i.test(match3.url)) {
|
|
8144
|
-
match3.url =
|
|
8425
|
+
match3.url = `mailto:${match3.url}`;
|
|
8145
8426
|
}
|
|
8146
8427
|
};
|
|
8147
8428
|
LinkifyIt.prototype.onCompile = function onCompile() {
|
|
@@ -8382,7 +8663,7 @@ var punycode = {
|
|
|
8382
8663
|
};
|
|
8383
8664
|
var punycode_es6_default = punycode;
|
|
8384
8665
|
|
|
8385
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
8666
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/presets/default.mjs
|
|
8386
8667
|
var default_default = {
|
|
8387
8668
|
options: {
|
|
8388
8669
|
// Enable HTML tags in source
|
|
@@ -8421,7 +8702,7 @@ var default_default = {
|
|
|
8421
8702
|
}
|
|
8422
8703
|
};
|
|
8423
8704
|
|
|
8424
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
8705
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/presets/zero.mjs
|
|
8425
8706
|
var zero_default = {
|
|
8426
8707
|
options: {
|
|
8427
8708
|
// Enable HTML tags in source
|
|
@@ -8479,7 +8760,7 @@ var zero_default = {
|
|
|
8479
8760
|
}
|
|
8480
8761
|
};
|
|
8481
8762
|
|
|
8482
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
8763
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/presets/commonmark.mjs
|
|
8483
8764
|
var commonmark_default = {
|
|
8484
8765
|
options: {
|
|
8485
8766
|
// Enable HTML tags in source
|
|
@@ -8556,7 +8837,7 @@ var commonmark_default = {
|
|
|
8556
8837
|
}
|
|
8557
8838
|
};
|
|
8558
8839
|
|
|
8559
|
-
// ../../node_modules/.pnpm/markdown-it@14.
|
|
8840
|
+
// ../../node_modules/.pnpm/markdown-it@14.3.0/node_modules/markdown-it/lib/index.mjs
|
|
8560
8841
|
var config = {
|
|
8561
8842
|
default: default_default,
|
|
8562
8843
|
zero: zero_default,
|
|
@@ -8892,4 +9173,4 @@ if (import.meta.url === `file://${process.argv[1]?.replace(/\\/g, "/")}`) {
|
|
|
8892
9173
|
export {
|
|
8893
9174
|
startServer
|
|
8894
9175
|
};
|
|
8895
|
-
//# sourceMappingURL=server-
|
|
9176
|
+
//# sourceMappingURL=server-FUWTRVRZ.js.map
|