@scalar/code-highlight 0.4.15 → 0.4.16
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 +6 -0
- package/dist/chunks/code.js +3 -5
- package/dist/chunks/code.js.map +1 -1
- package/dist/chunks/languages.js +52 -104
- package/dist/chunks/languages.js.map +1 -1
- package/dist/chunks/lib.js +342 -208
- package/dist/chunks/lib.js.map +1 -1
- package/dist/chunks/markdown.js +975 -359
- package/dist/chunks/markdown.js.map +1 -1
- package/dist/chunks/rehype-alert.js +1 -2
- package/dist/chunks/rehype-highlight.js +206 -366
- package/dist/chunks/rehype-highlight.js.map +1 -1
- package/dist/chunks/shared-lowlight.js +84 -167
- package/dist/chunks/shared-lowlight.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/dist/chunks/markdown.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as __exportAll, i as isElement, r as convertElement, t as rehypeHighlight } from "./rehype-highlight.js";
|
|
2
1
|
import { _ as stringify$1, a as ccount, b as svg, c as rehypeParse, d as TokenizerMode, f as getTagID, g as parse$1, h as webNamespaces, i as whitespace, l as stringifyPosition, m as fromParse5, n as unified, o as zwitch, p as TokenType, r as rehypeStringify, s as htmlVoidElements, t as getSharedLowlight, u as Parser, v as stringify, x as find, y as html$2 } from "./shared-lowlight.js";
|
|
3
|
-
import { i as convert, n as SKIP, r as visitParents, t as visit } from "./lib.js";
|
|
2
|
+
import { i as convert, n as SKIP$1, r as visitParents$1, t as visit$1 } from "./lib.js";
|
|
3
|
+
import { o as __exportAll, t as rehypeHighlight } from "./rehype-highlight.js";
|
|
4
4
|
import { t as standardLanguages } from "./languages.js";
|
|
5
5
|
import { t as rehypeAlert } from "./rehype-alert.js";
|
|
6
|
-
|
|
6
|
+
// ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/deserialize.js
|
|
7
7
|
var env = typeof self === "object" ? self : globalThis;
|
|
8
8
|
var deserializer = ($, _) => {
|
|
9
9
|
const as = (out, index) => {
|
|
@@ -61,8 +61,7 @@ var deserializer = ($, _) => {
|
|
|
61
61
|
* @returns {any}
|
|
62
62
|
*/
|
|
63
63
|
var deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
64
|
-
|
|
65
|
-
//#region ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/serialize.js
|
|
64
|
+
// ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/serialize.js
|
|
66
65
|
var EMPTY = "";
|
|
67
66
|
var { toString: toString$1 } = {};
|
|
68
67
|
var { keys } = Object;
|
|
@@ -173,8 +172,7 @@ var serialize$1 = (value, { json, lossy } = {}) => {
|
|
|
173
172
|
const _ = [];
|
|
174
173
|
return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
|
|
175
174
|
};
|
|
176
|
-
|
|
177
|
-
//#region ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/index.js
|
|
175
|
+
// ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/index.js
|
|
178
176
|
/**
|
|
179
177
|
* @typedef {Array<string,any>} Record a type representation
|
|
180
178
|
*/
|
|
@@ -189,8 +187,184 @@ var serialize$1 = (value, { json, lossy } = {}) => {
|
|
|
189
187
|
var esm_default = typeof structuredClone === "function" ?
|
|
190
188
|
/* c8 ignore start */
|
|
191
189
|
(any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize$1(any, options)) : structuredClone(any) : (any, options) => deserialize(serialize$1(any, options));
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
// ../../node_modules/.pnpm/hast-util-is-element@3.0.0/node_modules/hast-util-is-element/lib/index.js
|
|
191
|
+
/**
|
|
192
|
+
* @typedef {import('hast').Element} Element
|
|
193
|
+
* @typedef {import('hast').Parents} Parents
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* @template Fn
|
|
197
|
+
* @template Fallback
|
|
198
|
+
* @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate
|
|
199
|
+
*/
|
|
200
|
+
/**
|
|
201
|
+
* @callback Check
|
|
202
|
+
* Check that an arbitrary value is an element.
|
|
203
|
+
* @param {unknown} this
|
|
204
|
+
* Context object (`this`) to call `test` with
|
|
205
|
+
* @param {unknown} [element]
|
|
206
|
+
* Anything (typically a node).
|
|
207
|
+
* @param {number | null | undefined} [index]
|
|
208
|
+
* Position of `element` in its parent.
|
|
209
|
+
* @param {Parents | null | undefined} [parent]
|
|
210
|
+
* Parent of `element`.
|
|
211
|
+
* @returns {boolean}
|
|
212
|
+
* Whether this is an element and passes a test.
|
|
213
|
+
*
|
|
214
|
+
* @typedef {Array<TestFunction | string> | TestFunction | string | null | undefined} Test
|
|
215
|
+
* Check for an arbitrary element.
|
|
216
|
+
*
|
|
217
|
+
* * when `string`, checks that the element has that tag name
|
|
218
|
+
* * when `function`, see `TestFunction`
|
|
219
|
+
* * when `Array`, checks if one of the subtests pass
|
|
220
|
+
*
|
|
221
|
+
* @callback TestFunction
|
|
222
|
+
* Check if an element passes a test.
|
|
223
|
+
* @param {unknown} this
|
|
224
|
+
* The given context.
|
|
225
|
+
* @param {Element} element
|
|
226
|
+
* An element.
|
|
227
|
+
* @param {number | undefined} [index]
|
|
228
|
+
* Position of `element` in its parent.
|
|
229
|
+
* @param {Parents | undefined} [parent]
|
|
230
|
+
* Parent of `element`.
|
|
231
|
+
* @returns {boolean | undefined | void}
|
|
232
|
+
* Whether this element passes the test.
|
|
233
|
+
*
|
|
234
|
+
* Note: `void` is included until TS sees no return as `undefined`.
|
|
235
|
+
*/
|
|
236
|
+
/**
|
|
237
|
+
* Check if `element` is an `Element` and whether it passes the given test.
|
|
238
|
+
*
|
|
239
|
+
* @param element
|
|
240
|
+
* Thing to check, typically `element`.
|
|
241
|
+
* @param test
|
|
242
|
+
* Check for a specific element.
|
|
243
|
+
* @param index
|
|
244
|
+
* Position of `element` in its parent.
|
|
245
|
+
* @param parent
|
|
246
|
+
* Parent of `element`.
|
|
247
|
+
* @param context
|
|
248
|
+
* Context object (`this`) to call `test` with.
|
|
249
|
+
* @returns
|
|
250
|
+
* Whether `element` is an `Element` and passes a test.
|
|
251
|
+
* @throws
|
|
252
|
+
* When an incorrect `test`, `index`, or `parent` is given; there is no error
|
|
253
|
+
* thrown when `element` is not a node or not an element.
|
|
254
|
+
*/
|
|
255
|
+
var isElement = (
|
|
256
|
+
/**
|
|
257
|
+
* @param {unknown} [element]
|
|
258
|
+
* @param {Test | undefined} [test]
|
|
259
|
+
* @param {number | null | undefined} [index]
|
|
260
|
+
* @param {Parents | null | undefined} [parent]
|
|
261
|
+
* @param {unknown} [context]
|
|
262
|
+
* @returns {boolean}
|
|
263
|
+
*/
|
|
264
|
+
function(element, test, index, parent, context) {
|
|
265
|
+
const check = convertElement(test);
|
|
266
|
+
if (index !== null && index !== void 0 && (typeof index !== "number" || index < 0 || index === Number.POSITIVE_INFINITY)) throw new Error("Expected positive finite `index`");
|
|
267
|
+
if (parent !== null && parent !== void 0 && (!parent.type || !parent.children)) throw new Error("Expected valid `parent`");
|
|
268
|
+
if ((index === null || index === void 0) !== (parent === null || parent === void 0)) throw new Error("Expected both `index` and `parent`");
|
|
269
|
+
return looksLikeAnElement(element) ? check.call(context, element, index, parent) : false;
|
|
270
|
+
});
|
|
271
|
+
/**
|
|
272
|
+
* Generate a check from a test.
|
|
273
|
+
*
|
|
274
|
+
* Useful if you’re going to test many nodes, for example when creating a
|
|
275
|
+
* utility where something else passes a compatible test.
|
|
276
|
+
*
|
|
277
|
+
* The created function is a bit faster because it expects valid input only:
|
|
278
|
+
* an `element`, `index`, and `parent`.
|
|
279
|
+
*
|
|
280
|
+
* @param test
|
|
281
|
+
* A test for a specific element.
|
|
282
|
+
* @returns
|
|
283
|
+
* A check.
|
|
284
|
+
*/
|
|
285
|
+
var convertElement = (
|
|
286
|
+
/**
|
|
287
|
+
* @param {Test | null | undefined} [test]
|
|
288
|
+
* @returns {Check}
|
|
289
|
+
*/
|
|
290
|
+
function(test) {
|
|
291
|
+
if (test === null || test === void 0) return element$3;
|
|
292
|
+
if (typeof test === "string") return tagNameFactory(test);
|
|
293
|
+
if (typeof test === "object") return anyFactory(test);
|
|
294
|
+
if (typeof test === "function") return castFactory(test);
|
|
295
|
+
throw new Error("Expected function, string, or array as `test`");
|
|
296
|
+
});
|
|
297
|
+
/**
|
|
298
|
+
* Handle multiple tests.
|
|
299
|
+
*
|
|
300
|
+
* @param {Array<TestFunction | string>} tests
|
|
301
|
+
* @returns {Check}
|
|
302
|
+
*/
|
|
303
|
+
function anyFactory(tests) {
|
|
304
|
+
/** @type {Array<Check>} */
|
|
305
|
+
const checks = [];
|
|
306
|
+
let index = -1;
|
|
307
|
+
while (++index < tests.length) checks[index] = convertElement(tests[index]);
|
|
308
|
+
return castFactory(any);
|
|
309
|
+
/**
|
|
310
|
+
* @this {unknown}
|
|
311
|
+
* @type {TestFunction}
|
|
312
|
+
*/
|
|
313
|
+
function any(...parameters) {
|
|
314
|
+
let index = -1;
|
|
315
|
+
while (++index < checks.length) if (checks[index].apply(this, parameters)) return true;
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Turn a string into a test for an element with a certain type.
|
|
321
|
+
*
|
|
322
|
+
* @param {string} check
|
|
323
|
+
* @returns {Check}
|
|
324
|
+
*/
|
|
325
|
+
function tagNameFactory(check) {
|
|
326
|
+
return castFactory(tagName);
|
|
327
|
+
/**
|
|
328
|
+
* @param {Element} element
|
|
329
|
+
* @returns {boolean}
|
|
330
|
+
*/
|
|
331
|
+
function tagName(element) {
|
|
332
|
+
return element.tagName === check;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Turn a custom test into a test for an element that passes that test.
|
|
337
|
+
*
|
|
338
|
+
* @param {TestFunction} testFunction
|
|
339
|
+
* @returns {Check}
|
|
340
|
+
*/
|
|
341
|
+
function castFactory(testFunction) {
|
|
342
|
+
return check;
|
|
343
|
+
/**
|
|
344
|
+
* @this {unknown}
|
|
345
|
+
* @type {Check}
|
|
346
|
+
*/
|
|
347
|
+
function check(value, index, parent) {
|
|
348
|
+
return Boolean(looksLikeAnElement(value) && testFunction.call(this, value, typeof index === "number" ? index : void 0, parent || void 0));
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Make sure something is an element.
|
|
353
|
+
*
|
|
354
|
+
* @param {unknown} element
|
|
355
|
+
* @returns {element is Element}
|
|
356
|
+
*/
|
|
357
|
+
function element$3(element) {
|
|
358
|
+
return Boolean(element && typeof element === "object" && "type" in element && element.type === "element" && "tagName" in element && typeof element.tagName === "string");
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* @param {unknown} value
|
|
362
|
+
* @returns {value is Element}
|
|
363
|
+
*/
|
|
364
|
+
function looksLikeAnElement(value) {
|
|
365
|
+
return value !== null && typeof value === "object" && "type" in value && "tagName" in value;
|
|
366
|
+
}
|
|
367
|
+
// ../../node_modules/.pnpm/is-absolute-url@4.0.1/node_modules/is-absolute-url/index.js
|
|
194
368
|
var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
195
369
|
var WINDOWS_PATH_REGEX = /^[a-zA-Z]:\\/;
|
|
196
370
|
function isAbsoluteUrl(url) {
|
|
@@ -198,8 +372,7 @@ function isAbsoluteUrl(url) {
|
|
|
198
372
|
if (WINDOWS_PATH_REGEX.test(url)) return false;
|
|
199
373
|
return ABSOLUTE_URL_REGEX.test(url);
|
|
200
374
|
}
|
|
201
|
-
|
|
202
|
-
//#region ../../node_modules/.pnpm/rehype-external-links@3.0.0/node_modules/rehype-external-links/lib/index.js
|
|
375
|
+
// ../../node_modules/.pnpm/rehype-external-links@3.0.0/node_modules/rehype-external-links/lib/index.js
|
|
203
376
|
/**
|
|
204
377
|
* @typedef {import('hast').Element} Element
|
|
205
378
|
* @typedef {import('hast').ElementContent} ElementContent
|
|
@@ -302,7 +475,7 @@ function rehypeExternalLinks(options) {
|
|
|
302
475
|
* Nothing.
|
|
303
476
|
*/
|
|
304
477
|
return function(tree) {
|
|
305
|
-
visit(tree, "element", function(node, index, parent) {
|
|
478
|
+
visit$1(tree, "element", function(node, index, parent) {
|
|
306
479
|
if (node.tagName === "a" && typeof node.properties.href === "string" && is(node, index, parent)) {
|
|
307
480
|
const url = node.properties.href;
|
|
308
481
|
if (isAbsoluteUrl(url) ? protocols.includes(url.slice(0, url.indexOf(":"))) : url.startsWith("//")) {
|
|
@@ -344,8 +517,7 @@ function rehypeExternalLinks(options) {
|
|
|
344
517
|
function createIfNeeded(value, element) {
|
|
345
518
|
return typeof value === "function" ? value(element) : value;
|
|
346
519
|
}
|
|
347
|
-
|
|
348
|
-
//#region ../../node_modules/.pnpm/hast-util-embedded@3.0.0/node_modules/hast-util-embedded/lib/index.js
|
|
520
|
+
// ../../node_modules/.pnpm/hast-util-embedded@3.0.0/node_modules/hast-util-embedded/lib/index.js
|
|
349
521
|
/**
|
|
350
522
|
* Check if a node is a *embedded content*.
|
|
351
523
|
*
|
|
@@ -366,8 +538,7 @@ var embedded = convertElement(
|
|
|
366
538
|
return element.tagName === "audio" || element.tagName === "canvas" || element.tagName === "embed" || element.tagName === "iframe" || element.tagName === "img" || element.tagName === "math" || element.tagName === "object" || element.tagName === "picture" || element.tagName === "svg" || element.tagName === "video";
|
|
367
539
|
}
|
|
368
540
|
);
|
|
369
|
-
|
|
370
|
-
//#region ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/block.js
|
|
541
|
+
// ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/block.js
|
|
371
542
|
var blocks = [
|
|
372
543
|
"address",
|
|
373
544
|
"article",
|
|
@@ -428,16 +599,14 @@ var blocks = [
|
|
|
428
599
|
"wbr",
|
|
429
600
|
"xmp"
|
|
430
601
|
];
|
|
431
|
-
|
|
432
|
-
//#region ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/content.js
|
|
602
|
+
// ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/content.js
|
|
433
603
|
var content$3 = [
|
|
434
604
|
"button",
|
|
435
605
|
"input",
|
|
436
606
|
"select",
|
|
437
607
|
"textarea"
|
|
438
608
|
];
|
|
439
|
-
|
|
440
|
-
//#region ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/skippable.js
|
|
609
|
+
// ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/skippable.js
|
|
441
610
|
var skippable$1 = [
|
|
442
611
|
"area",
|
|
443
612
|
"base",
|
|
@@ -458,8 +627,7 @@ var skippable$1 = [
|
|
|
458
627
|
"track",
|
|
459
628
|
"title"
|
|
460
629
|
];
|
|
461
|
-
|
|
462
|
-
//#region ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/index.js
|
|
630
|
+
// ../../node_modules/.pnpm/hast-util-minify-whitespace@1.0.1/node_modules/hast-util-minify-whitespace/lib/index.js
|
|
463
631
|
/**
|
|
464
632
|
* @import {Nodes, Parents, Text} from 'hast'
|
|
465
633
|
*/
|
|
@@ -740,8 +908,7 @@ function inferWhiteSpace(node, state) {
|
|
|
740
908
|
}
|
|
741
909
|
return state.whitespace;
|
|
742
910
|
}
|
|
743
|
-
|
|
744
|
-
//#region ../../node_modules/.pnpm/hast-util-has-property@3.0.0/node_modules/hast-util-has-property/lib/index.js
|
|
911
|
+
// ../../node_modules/.pnpm/hast-util-has-property@3.0.0/node_modules/hast-util-has-property/lib/index.js
|
|
745
912
|
/**
|
|
746
913
|
* @typedef {import('hast').Element} Element
|
|
747
914
|
* @typedef {import('hast').Nodes} Nodes
|
|
@@ -765,8 +932,7 @@ function hasProperty(node, name) {
|
|
|
765
932
|
const value = node.type === "element" && own$6.call(node.properties, name) && node.properties[name];
|
|
766
933
|
return value !== null && value !== void 0 && value !== false;
|
|
767
934
|
}
|
|
768
|
-
|
|
769
|
-
//#region ../../node_modules/.pnpm/hast-util-is-body-ok-link@3.0.0/node_modules/hast-util-is-body-ok-link/lib/index.js
|
|
935
|
+
// ../../node_modules/.pnpm/hast-util-is-body-ok-link@3.0.0/node_modules/hast-util-is-body-ok-link/lib/index.js
|
|
770
936
|
/**
|
|
771
937
|
* @typedef {import('hast').Nodes} Nodes
|
|
772
938
|
*/
|
|
@@ -792,8 +958,7 @@ function isBodyOkLink(node) {
|
|
|
792
958
|
while (++index < rel.length) if (!list$4.has(String(rel[index]))) return false;
|
|
793
959
|
return true;
|
|
794
960
|
}
|
|
795
|
-
|
|
796
|
-
//#region ../../node_modules/.pnpm/hast-util-phrasing@3.0.1/node_modules/hast-util-phrasing/lib/index.js
|
|
961
|
+
// ../../node_modules/.pnpm/hast-util-phrasing@3.0.1/node_modules/hast-util-phrasing/lib/index.js
|
|
797
962
|
/**
|
|
798
963
|
* @typedef {import('hast').Nodes} Nodes
|
|
799
964
|
*/
|
|
@@ -855,8 +1020,7 @@ var meta = convertElement("meta");
|
|
|
855
1020
|
function phrasing$1(value) {
|
|
856
1021
|
return Boolean(value.type === "text" || basic(value) || embedded(value) || isBodyOkLink(value) || meta(value) && hasProperty(value, "itemProp"));
|
|
857
1022
|
}
|
|
858
|
-
|
|
859
|
-
//#region ../../node_modules/.pnpm/html-whitespace-sensitive-tag-names@3.0.0/node_modules/html-whitespace-sensitive-tag-names/lib/index.js
|
|
1023
|
+
// ../../node_modules/.pnpm/html-whitespace-sensitive-tag-names@3.0.0/node_modules/html-whitespace-sensitive-tag-names/lib/index.js
|
|
860
1024
|
/**
|
|
861
1025
|
* List of HTML tag names that are whitespace sensitive.
|
|
862
1026
|
*/
|
|
@@ -866,8 +1030,7 @@ var whitespaceSensitiveTagNames = [
|
|
|
866
1030
|
"style",
|
|
867
1031
|
"textarea"
|
|
868
1032
|
];
|
|
869
|
-
|
|
870
|
-
//#region ../../node_modules/.pnpm/hast-util-format@1.1.0/node_modules/hast-util-format/lib/index.js
|
|
1033
|
+
// ../../node_modules/.pnpm/hast-util-format@1.1.0/node_modules/hast-util-format/lib/index.js
|
|
871
1034
|
/**
|
|
872
1035
|
* @import {Nodes, RootContent, Root} from 'hast'
|
|
873
1036
|
* @import {BuildVisitor} from 'unist-util-visit-parents'
|
|
@@ -895,7 +1058,7 @@ function format(tree, options) {
|
|
|
895
1058
|
indent: typeof settings.indent === "number" ? " ".repeat(settings.indent) : typeof settings.indent === "string" ? settings.indent : " "
|
|
896
1059
|
};
|
|
897
1060
|
minifyWhitespace(tree, { newlines: true });
|
|
898
|
-
visitParents(tree, visitor);
|
|
1061
|
+
visitParents$1(tree, visitor);
|
|
899
1062
|
/**
|
|
900
1063
|
* @type {BuildVisitor<Root>}
|
|
901
1064
|
*/
|
|
@@ -903,7 +1066,7 @@ function format(tree, options) {
|
|
|
903
1066
|
if (!("children" in node)) return;
|
|
904
1067
|
if (node.type === "element" && node.tagName === "head") state.head = true;
|
|
905
1068
|
if (state.head && node.type === "element" && node.tagName === "body") state.head = false;
|
|
906
|
-
if (node.type === "element" && whitespaceSensitiveTagNames.includes(node.tagName)) return SKIP;
|
|
1069
|
+
if (node.type === "element" && whitespaceSensitiveTagNames.includes(node.tagName)) return SKIP$1;
|
|
907
1070
|
if (node.children.length === 0 || !padding(state, node)) return;
|
|
908
1071
|
let level = parents.length;
|
|
909
1072
|
if (!state.indentInitial) level--;
|
|
@@ -976,8 +1139,7 @@ function blank(state, node) {
|
|
|
976
1139
|
function padding(state, node) {
|
|
977
1140
|
return node.type === "root" || (node.type === "element" ? state.head || node.tagName === "script" || embedded(node) || !phrasing$1(node) : false);
|
|
978
1141
|
}
|
|
979
|
-
|
|
980
|
-
//#region ../../node_modules/.pnpm/rehype-format@5.0.1/node_modules/rehype-format/lib/index.js
|
|
1142
|
+
// ../../node_modules/.pnpm/rehype-format@5.0.1/node_modules/rehype-format/lib/index.js
|
|
981
1143
|
/**
|
|
982
1144
|
* @import {Options} from 'hast-util-format'
|
|
983
1145
|
* @import {Root} from 'hast'
|
|
@@ -1003,8 +1165,7 @@ function rehypeFormat(options) {
|
|
|
1003
1165
|
format(tree, options);
|
|
1004
1166
|
};
|
|
1005
1167
|
}
|
|
1006
|
-
|
|
1007
|
-
//#region ../../node_modules/.pnpm/hast-util-to-parse5@8.0.0/node_modules/hast-util-to-parse5/lib/index.js
|
|
1168
|
+
// ../../node_modules/.pnpm/hast-util-to-parse5@8.0.0/node_modules/hast-util-to-parse5/lib/index.js
|
|
1008
1169
|
/**
|
|
1009
1170
|
* @typedef {import('hast').Comment} Comment
|
|
1010
1171
|
* @typedef {import('hast').Doctype} Doctype
|
|
@@ -1269,8 +1430,7 @@ function patch$2(from, to) {
|
|
|
1269
1430
|
};
|
|
1270
1431
|
}
|
|
1271
1432
|
}
|
|
1272
|
-
|
|
1273
|
-
//#region ../../node_modules/.pnpm/unist-util-position@5.0.0/node_modules/unist-util-position/lib/index.js
|
|
1433
|
+
// ../../node_modules/.pnpm/unist-util-position@5.0.0/node_modules/unist-util-position/lib/index.js
|
|
1274
1434
|
/**
|
|
1275
1435
|
* @typedef {import('unist').Node} Node
|
|
1276
1436
|
* @typedef {import('unist').Point} Point
|
|
@@ -1349,8 +1509,7 @@ function position(node) {
|
|
|
1349
1509
|
end
|
|
1350
1510
|
};
|
|
1351
1511
|
}
|
|
1352
|
-
|
|
1353
|
-
//#region ../../node_modules/.pnpm/hast-util-raw@9.0.3/node_modules/hast-util-raw/lib/index.js
|
|
1512
|
+
// ../../node_modules/.pnpm/hast-util-raw@9.0.3/node_modules/hast-util-raw/lib/index.js
|
|
1354
1513
|
/**
|
|
1355
1514
|
* @typedef {import('hast').Comment} Comment
|
|
1356
1515
|
* @typedef {import('hast').Doctype} Doctype
|
|
@@ -1445,7 +1604,7 @@ function raw(tree, options) {
|
|
|
1445
1604
|
resetTokenizer(state, pointStart());
|
|
1446
1605
|
const p5 = document ? state.parser.document : state.parser.getFragment();
|
|
1447
1606
|
const result = fromParse5(p5, { file: state.options.file });
|
|
1448
|
-
if (state.stitches) visit(result, "comment", function(node, index, parent) {
|
|
1607
|
+
if (state.stitches) visit$1(result, "comment", function(node, index, parent) {
|
|
1449
1608
|
const stitch = node;
|
|
1450
1609
|
if (stitch.value.stitch && parent && index !== void 0) {
|
|
1451
1610
|
/** @type {Array<RootContent>} */
|
|
@@ -1820,8 +1979,7 @@ function cloneWithoutChildren(node) {
|
|
|
1820
1979
|
children: []
|
|
1821
1980
|
}) : esm_default(node);
|
|
1822
1981
|
}
|
|
1823
|
-
|
|
1824
|
-
//#region ../../node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js
|
|
1982
|
+
// ../../node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js
|
|
1825
1983
|
/**
|
|
1826
1984
|
* @typedef {import('hast').Root} Root
|
|
1827
1985
|
* @typedef {import('hast-util-raw').Options} RawOptions
|
|
@@ -1855,8 +2013,7 @@ function rehypeRaw(options) {
|
|
|
1855
2013
|
});
|
|
1856
2014
|
};
|
|
1857
2015
|
}
|
|
1858
|
-
|
|
1859
|
-
//#region ../../node_modules/.pnpm/hast-util-sanitize@5.0.1/node_modules/hast-util-sanitize/lib/schema.js
|
|
2016
|
+
// ../../node_modules/.pnpm/hast-util-sanitize@5.0.1/node_modules/hast-util-sanitize/lib/schema.js
|
|
1860
2017
|
var aria = [
|
|
1861
2018
|
"ariaDescribedBy",
|
|
1862
2019
|
"ariaLabel",
|
|
@@ -2054,8 +2211,7 @@ var defaultSchema = {
|
|
|
2054
2211
|
"var"
|
|
2055
2212
|
]
|
|
2056
2213
|
};
|
|
2057
|
-
|
|
2058
|
-
//#region ../../node_modules/.pnpm/hast-util-sanitize@5.0.1/node_modules/hast-util-sanitize/lib/index.js
|
|
2214
|
+
// ../../node_modules/.pnpm/hast-util-sanitize@5.0.1/node_modules/hast-util-sanitize/lib/index.js
|
|
2059
2215
|
/**
|
|
2060
2216
|
* @typedef {import('hast').Comment} Comment
|
|
2061
2217
|
* @typedef {import('hast').Doctype} Doctype
|
|
@@ -2631,8 +2787,7 @@ function findDefinition(definitions, key) {
|
|
|
2631
2787
|
}
|
|
2632
2788
|
if (key.length > 4 && key.slice(0, 4).toLowerCase() === "data") return dataDefault;
|
|
2633
2789
|
}
|
|
2634
|
-
|
|
2635
|
-
//#region ../../node_modules/.pnpm/rehype-sanitize@6.0.0/node_modules/rehype-sanitize/lib/index.js
|
|
2790
|
+
// ../../node_modules/.pnpm/rehype-sanitize@6.0.0/node_modules/rehype-sanitize/lib/index.js
|
|
2636
2791
|
/**
|
|
2637
2792
|
* @typedef {import('hast').Root} Root
|
|
2638
2793
|
* @typedef {import('hast-util-sanitize').Schema} Schema
|
|
@@ -2656,8 +2811,7 @@ function rehypeSanitize(options) {
|
|
|
2656
2811
|
return sanitize(tree, options);
|
|
2657
2812
|
};
|
|
2658
2813
|
}
|
|
2659
|
-
|
|
2660
|
-
//#region ../../node_modules/.pnpm/micromark-util-character@2.1.0/node_modules/micromark-util-character/index.js
|
|
2814
|
+
// ../../node_modules/.pnpm/micromark-util-character@2.1.0/node_modules/micromark-util-character/index.js
|
|
2661
2815
|
/**
|
|
2662
2816
|
* @typedef {import('micromark-util-types').Code} Code
|
|
2663
2817
|
*/
|
|
@@ -2882,14 +3036,340 @@ function regexCheck(regex) {
|
|
|
2882
3036
|
return code !== null && code > -1 && regex.test(String.fromCharCode(code));
|
|
2883
3037
|
}
|
|
2884
3038
|
}
|
|
2885
|
-
|
|
2886
|
-
//#region ../../node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js
|
|
3039
|
+
// ../../node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.js
|
|
2887
3040
|
function escapeStringRegexp(string) {
|
|
2888
3041
|
if (typeof string !== "string") throw new TypeError("Expected a string");
|
|
2889
3042
|
return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2890
3043
|
}
|
|
2891
|
-
|
|
2892
|
-
|
|
3044
|
+
// ../../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.js
|
|
3045
|
+
/**
|
|
3046
|
+
* @param {string} d
|
|
3047
|
+
* @returns {string}
|
|
3048
|
+
*/
|
|
3049
|
+
function color(d) {
|
|
3050
|
+
return d;
|
|
3051
|
+
}
|
|
3052
|
+
// ../../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.js
|
|
3053
|
+
/**
|
|
3054
|
+
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
3055
|
+
*/
|
|
3056
|
+
/**
|
|
3057
|
+
* @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
|
|
3058
|
+
* Test from `unist-util-is`.
|
|
3059
|
+
*
|
|
3060
|
+
* Note: we have remove and add `undefined`, because otherwise when generating
|
|
3061
|
+
* automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
|
|
3062
|
+
* which doesn’t work when publishing on npm.
|
|
3063
|
+
*/
|
|
3064
|
+
/**
|
|
3065
|
+
* @typedef {(
|
|
3066
|
+
* Fn extends (value: any) => value is infer Thing
|
|
3067
|
+
* ? Thing
|
|
3068
|
+
* : Fallback
|
|
3069
|
+
* )} Predicate
|
|
3070
|
+
* Get the value of a type guard `Fn`.
|
|
3071
|
+
* @template Fn
|
|
3072
|
+
* Value; typically function that is a type guard (such as `(x): x is Y`).
|
|
3073
|
+
* @template Fallback
|
|
3074
|
+
* Value to yield if `Fn` is not a type guard.
|
|
3075
|
+
*/
|
|
3076
|
+
/**
|
|
3077
|
+
* @typedef {(
|
|
3078
|
+
* Check extends null | undefined // No test.
|
|
3079
|
+
* ? Value
|
|
3080
|
+
* : Value extends {type: Check} // String (type) test.
|
|
3081
|
+
* ? Value
|
|
3082
|
+
* : Value extends Check // Partial test.
|
|
3083
|
+
* ? Value
|
|
3084
|
+
* : Check extends Function // Function test.
|
|
3085
|
+
* ? Predicate<Check, Value> extends Value
|
|
3086
|
+
* ? Predicate<Check, Value>
|
|
3087
|
+
* : never
|
|
3088
|
+
* : never // Some other test?
|
|
3089
|
+
* )} MatchesOne
|
|
3090
|
+
* Check whether a node matches a primitive check in the type system.
|
|
3091
|
+
* @template Value
|
|
3092
|
+
* Value; typically unist `Node`.
|
|
3093
|
+
* @template Check
|
|
3094
|
+
* Value; typically `unist-util-is`-compatible test, but not arrays.
|
|
3095
|
+
*/
|
|
3096
|
+
/**
|
|
3097
|
+
* @typedef {(
|
|
3098
|
+
* Check extends ReadonlyArray<infer T>
|
|
3099
|
+
* ? MatchesOne<Value, T>
|
|
3100
|
+
* : Check extends Array<infer T>
|
|
3101
|
+
* ? MatchesOne<Value, T>
|
|
3102
|
+
* : MatchesOne<Value, Check>
|
|
3103
|
+
* )} Matches
|
|
3104
|
+
* Check whether a node matches a check in the type system.
|
|
3105
|
+
* @template Value
|
|
3106
|
+
* Value; typically unist `Node`.
|
|
3107
|
+
* @template Check
|
|
3108
|
+
* Value; typically `unist-util-is`-compatible test.
|
|
3109
|
+
*/
|
|
3110
|
+
/**
|
|
3111
|
+
* @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint
|
|
3112
|
+
* Number; capped reasonably.
|
|
3113
|
+
*/
|
|
3114
|
+
/**
|
|
3115
|
+
* @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment
|
|
3116
|
+
* Increment a number in the type system.
|
|
3117
|
+
* @template {Uint} [I=0]
|
|
3118
|
+
* Index.
|
|
3119
|
+
*/
|
|
3120
|
+
/**
|
|
3121
|
+
* @typedef {(
|
|
3122
|
+
* Node extends UnistParent
|
|
3123
|
+
* ? Node extends {children: Array<infer Children>}
|
|
3124
|
+
* ? Child extends Children ? Node : never
|
|
3125
|
+
* : never
|
|
3126
|
+
* : never
|
|
3127
|
+
* )} InternalParent
|
|
3128
|
+
* Collect nodes that can be parents of `Child`.
|
|
3129
|
+
* @template {UnistNode} Node
|
|
3130
|
+
* All node types in a tree.
|
|
3131
|
+
* @template {UnistNode} Child
|
|
3132
|
+
* Node to search for.
|
|
3133
|
+
*/
|
|
3134
|
+
/**
|
|
3135
|
+
* @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent
|
|
3136
|
+
* Collect nodes in `Tree` that can be parents of `Child`.
|
|
3137
|
+
* @template {UnistNode} Tree
|
|
3138
|
+
* All node types in a tree.
|
|
3139
|
+
* @template {UnistNode} Child
|
|
3140
|
+
* Node to search for.
|
|
3141
|
+
*/
|
|
3142
|
+
/**
|
|
3143
|
+
* @typedef {(
|
|
3144
|
+
* Depth extends Max
|
|
3145
|
+
* ? never
|
|
3146
|
+
* :
|
|
3147
|
+
* | InternalParent<Node, Child>
|
|
3148
|
+
* | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>
|
|
3149
|
+
* )} InternalAncestor
|
|
3150
|
+
* Collect nodes in `Tree` that can be ancestors of `Child`.
|
|
3151
|
+
* @template {UnistNode} Node
|
|
3152
|
+
* All node types in a tree.
|
|
3153
|
+
* @template {UnistNode} Child
|
|
3154
|
+
* Node to search for.
|
|
3155
|
+
* @template {Uint} [Max=10]
|
|
3156
|
+
* Max; searches up to this depth.
|
|
3157
|
+
* @template {Uint} [Depth=0]
|
|
3158
|
+
* Current depth.
|
|
3159
|
+
*/
|
|
3160
|
+
/**
|
|
3161
|
+
* @typedef {InternalAncestor<InclusiveDescendant<Tree>, Child>} Ancestor
|
|
3162
|
+
* Collect nodes in `Tree` that can be ancestors of `Child`.
|
|
3163
|
+
* @template {UnistNode} Tree
|
|
3164
|
+
* All node types in a tree.
|
|
3165
|
+
* @template {UnistNode} Child
|
|
3166
|
+
* Node to search for.
|
|
3167
|
+
*/
|
|
3168
|
+
/**
|
|
3169
|
+
* @typedef {(
|
|
3170
|
+
* Tree extends UnistParent
|
|
3171
|
+
* ? Depth extends Max
|
|
3172
|
+
* ? Tree
|
|
3173
|
+
* : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>
|
|
3174
|
+
* : Tree
|
|
3175
|
+
* )} InclusiveDescendant
|
|
3176
|
+
* Collect all (inclusive) descendants of `Tree`.
|
|
3177
|
+
*
|
|
3178
|
+
* > 👉 **Note**: for performance reasons, this seems to be the fastest way to
|
|
3179
|
+
* > recurse without actually running into an infinite loop, which the
|
|
3180
|
+
* > previous version did.
|
|
3181
|
+
* >
|
|
3182
|
+
* > Practically, a max of `2` is typically enough assuming a `Root` is
|
|
3183
|
+
* > passed, but it doesn’t improve performance.
|
|
3184
|
+
* > It gets higher with `List > ListItem > Table > TableRow > TableCell`.
|
|
3185
|
+
* > Using up to `10` doesn’t hurt or help either.
|
|
3186
|
+
* @template {UnistNode} Tree
|
|
3187
|
+
* Tree type.
|
|
3188
|
+
* @template {Uint} [Max=10]
|
|
3189
|
+
* Max; searches up to this depth.
|
|
3190
|
+
* @template {Uint} [Depth=0]
|
|
3191
|
+
* Current depth.
|
|
3192
|
+
*/
|
|
3193
|
+
/**
|
|
3194
|
+
* @typedef {'skip' | boolean} Action
|
|
3195
|
+
* Union of the action types.
|
|
3196
|
+
*
|
|
3197
|
+
* @typedef {number} Index
|
|
3198
|
+
* Move to the sibling at `index` next (after node itself is completely
|
|
3199
|
+
* traversed).
|
|
3200
|
+
*
|
|
3201
|
+
* Useful if mutating the tree, such as removing the node the visitor is
|
|
3202
|
+
* currently on, or any of its previous siblings.
|
|
3203
|
+
* Results less than 0 or greater than or equal to `children.length` stop
|
|
3204
|
+
* traversing the parent.
|
|
3205
|
+
*
|
|
3206
|
+
* @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple
|
|
3207
|
+
* List with one or two values, the first an action, the second an index.
|
|
3208
|
+
*
|
|
3209
|
+
* @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult
|
|
3210
|
+
* Any value that can be returned from a visitor.
|
|
3211
|
+
*/
|
|
3212
|
+
/**
|
|
3213
|
+
* @callback Visitor
|
|
3214
|
+
* Handle a node (matching `test`, if given).
|
|
3215
|
+
*
|
|
3216
|
+
* Visitors are free to transform `node`.
|
|
3217
|
+
* They can also transform the parent of node (the last of `ancestors`).
|
|
3218
|
+
*
|
|
3219
|
+
* Replacing `node` itself, if `SKIP` is not returned, still causes its
|
|
3220
|
+
* descendants to be walked (which is a bug).
|
|
3221
|
+
*
|
|
3222
|
+
* When adding or removing previous siblings of `node` (or next siblings, in
|
|
3223
|
+
* case of reverse), the `Visitor` should return a new `Index` to specify the
|
|
3224
|
+
* sibling to traverse after `node` is traversed.
|
|
3225
|
+
* Adding or removing next siblings of `node` (or previous siblings, in case
|
|
3226
|
+
* of reverse) is handled as expected without needing to return a new `Index`.
|
|
3227
|
+
*
|
|
3228
|
+
* Removing the children property of an ancestor still results in them being
|
|
3229
|
+
* traversed.
|
|
3230
|
+
* @param {Visited} node
|
|
3231
|
+
* Found node.
|
|
3232
|
+
* @param {Array<VisitedParents>} ancestors
|
|
3233
|
+
* Ancestors of `node`.
|
|
3234
|
+
* @returns {VisitorResult}
|
|
3235
|
+
* What to do next.
|
|
3236
|
+
*
|
|
3237
|
+
* An `Index` is treated as a tuple of `[CONTINUE, Index]`.
|
|
3238
|
+
* An `Action` is treated as a tuple of `[Action]`.
|
|
3239
|
+
*
|
|
3240
|
+
* Passing a tuple back only makes sense if the `Action` is `SKIP`.
|
|
3241
|
+
* When the `Action` is `EXIT`, that action can be returned.
|
|
3242
|
+
* When the `Action` is `CONTINUE`, `Index` can be returned.
|
|
3243
|
+
* @template {UnistNode} [Visited=UnistNode]
|
|
3244
|
+
* Visited node type.
|
|
3245
|
+
* @template {UnistParent} [VisitedParents=UnistParent]
|
|
3246
|
+
* Ancestor type.
|
|
3247
|
+
*/
|
|
3248
|
+
/**
|
|
3249
|
+
* @typedef {Visitor<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitor
|
|
3250
|
+
* Build a typed `Visitor` function from a tree and a test.
|
|
3251
|
+
*
|
|
3252
|
+
* It will infer which values are passed as `node` and which as `parents`.
|
|
3253
|
+
* @template {UnistNode} [Tree=UnistNode]
|
|
3254
|
+
* Tree type.
|
|
3255
|
+
* @template {Test} [Check=Test]
|
|
3256
|
+
* Test type.
|
|
3257
|
+
*/
|
|
3258
|
+
/** @type {Readonly<ActionTuple>} */
|
|
3259
|
+
var empty = [];
|
|
3260
|
+
/**
|
|
3261
|
+
* Visit nodes, with ancestral information.
|
|
3262
|
+
*
|
|
3263
|
+
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
3264
|
+
* (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
|
|
3265
|
+
*
|
|
3266
|
+
* You can choose for which nodes `visitor` is called by passing a `test`.
|
|
3267
|
+
* For complex tests, you should test yourself in `visitor`, as it will be
|
|
3268
|
+
* faster and will have improved type information.
|
|
3269
|
+
*
|
|
3270
|
+
* Walking the tree is an intensive task.
|
|
3271
|
+
* Make use of the return values of the visitor when possible.
|
|
3272
|
+
* Instead of walking a tree multiple times, walk it once, use `unist-util-is`
|
|
3273
|
+
* to check if a node matches, and then perform different operations.
|
|
3274
|
+
*
|
|
3275
|
+
* You can change the tree.
|
|
3276
|
+
* See `Visitor` for more info.
|
|
3277
|
+
*
|
|
3278
|
+
* @overload
|
|
3279
|
+
* @param {Tree} tree
|
|
3280
|
+
* @param {Check} check
|
|
3281
|
+
* @param {BuildVisitor<Tree, Check>} visitor
|
|
3282
|
+
* @param {boolean | null | undefined} [reverse]
|
|
3283
|
+
* @returns {undefined}
|
|
3284
|
+
*
|
|
3285
|
+
* @overload
|
|
3286
|
+
* @param {Tree} tree
|
|
3287
|
+
* @param {BuildVisitor<Tree>} visitor
|
|
3288
|
+
* @param {boolean | null | undefined} [reverse]
|
|
3289
|
+
* @returns {undefined}
|
|
3290
|
+
*
|
|
3291
|
+
* @param {UnistNode} tree
|
|
3292
|
+
* Tree to traverse.
|
|
3293
|
+
* @param {Visitor | Test} test
|
|
3294
|
+
* `unist-util-is`-compatible test
|
|
3295
|
+
* @param {Visitor | boolean | null | undefined} [visitor]
|
|
3296
|
+
* Handle each node.
|
|
3297
|
+
* @param {boolean | null | undefined} [reverse]
|
|
3298
|
+
* Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
|
|
3299
|
+
* @returns {undefined}
|
|
3300
|
+
* Nothing.
|
|
3301
|
+
*
|
|
3302
|
+
* @template {UnistNode} Tree
|
|
3303
|
+
* Node type.
|
|
3304
|
+
* @template {Test} Check
|
|
3305
|
+
* `unist-util-is`-compatible test.
|
|
3306
|
+
*/
|
|
3307
|
+
function visitParents(tree, test, visitor, reverse) {
|
|
3308
|
+
/** @type {Test} */
|
|
3309
|
+
let check;
|
|
3310
|
+
if (typeof test === "function" && typeof visitor !== "function") {
|
|
3311
|
+
reverse = visitor;
|
|
3312
|
+
visitor = test;
|
|
3313
|
+
} else check = test;
|
|
3314
|
+
const is = convert(check);
|
|
3315
|
+
const step = reverse ? -1 : 1;
|
|
3316
|
+
factory(tree, void 0, [])();
|
|
3317
|
+
/**
|
|
3318
|
+
* @param {UnistNode} node
|
|
3319
|
+
* @param {number | undefined} index
|
|
3320
|
+
* @param {Array<UnistParent>} parents
|
|
3321
|
+
*/
|
|
3322
|
+
function factory(node, index, parents) {
|
|
3323
|
+
const value = node && typeof node === "object" ? node : {};
|
|
3324
|
+
if (typeof value.type === "string") {
|
|
3325
|
+
const name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : void 0;
|
|
3326
|
+
Object.defineProperty(visit, "name", { value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")" });
|
|
3327
|
+
}
|
|
3328
|
+
return visit;
|
|
3329
|
+
function visit() {
|
|
3330
|
+
/** @type {Readonly<ActionTuple>} */
|
|
3331
|
+
let result = empty;
|
|
3332
|
+
/** @type {Readonly<ActionTuple>} */
|
|
3333
|
+
let subresult;
|
|
3334
|
+
/** @type {number} */
|
|
3335
|
+
let offset;
|
|
3336
|
+
/** @type {Array<UnistParent>} */
|
|
3337
|
+
let grandparents;
|
|
3338
|
+
if (!test || is(node, index, parents[parents.length - 1] || void 0)) {
|
|
3339
|
+
result = toResult(visitor(node, parents));
|
|
3340
|
+
if (result[0] === false) return result;
|
|
3341
|
+
}
|
|
3342
|
+
if ("children" in node && node.children) {
|
|
3343
|
+
const nodeAsParent = node;
|
|
3344
|
+
if (nodeAsParent.children && result[0] !== "skip") {
|
|
3345
|
+
offset = (reverse ? nodeAsParent.children.length : -1) + step;
|
|
3346
|
+
grandparents = parents.concat(nodeAsParent);
|
|
3347
|
+
while (offset > -1 && offset < nodeAsParent.children.length) {
|
|
3348
|
+
const child = nodeAsParent.children[offset];
|
|
3349
|
+
subresult = factory(child, offset, grandparents)();
|
|
3350
|
+
if (subresult[0] === false) return subresult;
|
|
3351
|
+
offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
return result;
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
/**
|
|
3360
|
+
* Turn a return value into a clean result.
|
|
3361
|
+
*
|
|
3362
|
+
* @param {VisitorResult} value
|
|
3363
|
+
* Valid return values from visitors.
|
|
3364
|
+
* @returns {Readonly<ActionTuple>}
|
|
3365
|
+
* Clean result.
|
|
3366
|
+
*/
|
|
3367
|
+
function toResult(value) {
|
|
3368
|
+
if (Array.isArray(value)) return value;
|
|
3369
|
+
if (typeof value === "number") return [true, value];
|
|
3370
|
+
return value === null || value === void 0 ? empty : [value];
|
|
3371
|
+
}
|
|
3372
|
+
// ../../node_modules/.pnpm/mdast-util-find-and-replace@3.0.1/node_modules/mdast-util-find-and-replace/lib/index.js
|
|
2893
3373
|
/**
|
|
2894
3374
|
* @typedef {import('mdast').Nodes} Nodes
|
|
2895
3375
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -3088,8 +3568,7 @@ function toFunction(replace) {
|
|
|
3088
3568
|
return replace;
|
|
3089
3569
|
};
|
|
3090
3570
|
}
|
|
3091
|
-
|
|
3092
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.0/node_modules/mdast-util-gfm-autolink-literal/lib/index.js
|
|
3571
|
+
// ../../node_modules/.pnpm/mdast-util-gfm-autolink-literal@2.0.0/node_modules/mdast-util-gfm-autolink-literal/lib/index.js
|
|
3093
3572
|
/**
|
|
3094
3573
|
* @typedef {import('mdast').Link} Link
|
|
3095
3574
|
* @typedef {import('mdast').PhrasingContent} PhrasingContent
|
|
@@ -3318,8 +3797,7 @@ function previous$1(match, email) {
|
|
|
3318
3797
|
const code = match.input.charCodeAt(match.index - 1);
|
|
3319
3798
|
return (match.index === 0 || unicodeWhitespace(code) || unicodePunctuation(code)) && (!email || code !== 47);
|
|
3320
3799
|
}
|
|
3321
|
-
|
|
3322
|
-
//#region ../../node_modules/.pnpm/micromark-util-normalize-identifier@2.0.0/node_modules/micromark-util-normalize-identifier/index.js
|
|
3800
|
+
// ../../node_modules/.pnpm/micromark-util-normalize-identifier@2.0.0/node_modules/micromark-util-normalize-identifier/index.js
|
|
3323
3801
|
/**
|
|
3324
3802
|
* Normalize an identifier (as found in references, definitions).
|
|
3325
3803
|
*
|
|
@@ -3342,8 +3820,7 @@ function previous$1(match, email) {
|
|
|
3342
3820
|
function normalizeIdentifier(value) {
|
|
3343
3821
|
return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
3344
3822
|
}
|
|
3345
|
-
|
|
3346
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-footnote@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-footnote/lib/index.js
|
|
3823
|
+
// ../../node_modules/.pnpm/mdast-util-gfm-footnote@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-footnote/lib/index.js
|
|
3347
3824
|
/**
|
|
3348
3825
|
* @typedef {import('mdast').FootnoteDefinition} FootnoteDefinition
|
|
3349
3826
|
* @typedef {import('mdast').FootnoteReference} FootnoteReference
|
|
@@ -3523,8 +4000,7 @@ function map$3(line, index, blank) {
|
|
|
3523
4000
|
if (index === 0) return line;
|
|
3524
4001
|
return (blank ? "" : " ") + line;
|
|
3525
4002
|
}
|
|
3526
|
-
|
|
3527
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
4003
|
+
// ../../node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
3528
4004
|
/**
|
|
3529
4005
|
* @typedef {import('mdast').Delete} Delete
|
|
3530
4006
|
*
|
|
@@ -3624,8 +4100,7 @@ function handleDelete(node, _, state, info) {
|
|
|
3624
4100
|
function peekDelete() {
|
|
3625
4101
|
return "~";
|
|
3626
4102
|
}
|
|
3627
|
-
|
|
3628
|
-
//#region ../../node_modules/.pnpm/markdown-table@3.0.3/node_modules/markdown-table/index.js
|
|
4103
|
+
// ../../node_modules/.pnpm/markdown-table@3.0.3/node_modules/markdown-table/index.js
|
|
3629
4104
|
/**
|
|
3630
4105
|
* @typedef Options
|
|
3631
4106
|
* Configuration (optional).
|
|
@@ -3902,8 +4377,7 @@ function toAlignment(value) {
|
|
|
3902
4377
|
const code = typeof value === "string" ? value.codePointAt(0) : 0;
|
|
3903
4378
|
return code === 67 || code === 99 ? 99 : code === 76 || code === 108 ? 108 : code === 82 || code === 114 ? 114 : 0;
|
|
3904
4379
|
}
|
|
3905
|
-
|
|
3906
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/configure.js
|
|
4380
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/configure.js
|
|
3907
4381
|
/**
|
|
3908
4382
|
* @typedef {import('./types.js').Options} Options
|
|
3909
4383
|
* @typedef {import('./types.js').State} State
|
|
@@ -3951,8 +4425,7 @@ function list$3(left, right) {
|
|
|
3951
4425
|
function map$2(left, right) {
|
|
3952
4426
|
if (right) Object.assign(left, right);
|
|
3953
4427
|
}
|
|
3954
|
-
|
|
3955
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
|
|
4428
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
|
|
3956
4429
|
/**
|
|
3957
4430
|
* @typedef {import('mdast').Blockquote} Blockquote
|
|
3958
4431
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -3980,8 +4453,7 @@ function blockquote$1(node, _, state, info) {
|
|
|
3980
4453
|
function map$1(line, _, blank) {
|
|
3981
4454
|
return ">" + (blank ? "" : " ") + line;
|
|
3982
4455
|
}
|
|
3983
|
-
|
|
3984
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
|
|
4456
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
|
|
3985
4457
|
/**
|
|
3986
4458
|
* @typedef {import('../types.js').ConstructName} ConstructName
|
|
3987
4459
|
* @typedef {import('../types.js').Unsafe} Unsafe
|
|
@@ -4007,8 +4479,7 @@ function listInScope(stack, list, none) {
|
|
|
4007
4479
|
while (++index < list.length) if (stack.includes(list[index])) return true;
|
|
4008
4480
|
return false;
|
|
4009
4481
|
}
|
|
4010
|
-
|
|
4011
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/break.js
|
|
4482
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/break.js
|
|
4012
4483
|
/**
|
|
4013
4484
|
* @typedef {import('mdast').Break} Break
|
|
4014
4485
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4027,8 +4498,7 @@ function hardBreak$1(_, _1, state, info) {
|
|
|
4027
4498
|
while (++index < state.unsafe.length) if (state.unsafe[index].character === "\n" && patternInScope(state.stack, state.unsafe[index])) return /[ \t]/.test(info.before) ? "" : " ";
|
|
4028
4499
|
return "\\\n";
|
|
4029
4500
|
}
|
|
4030
|
-
|
|
4031
|
-
//#region ../../node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.js
|
|
4501
|
+
// ../../node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.js
|
|
4032
4502
|
/**
|
|
4033
4503
|
* Get the count of the longest repeating streak of `substring` in `value`.
|
|
4034
4504
|
*
|
|
@@ -4055,8 +4525,7 @@ function longestStreak(value, substring) {
|
|
|
4055
4525
|
}
|
|
4056
4526
|
return max;
|
|
4057
4527
|
}
|
|
4058
|
-
|
|
4059
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
|
|
4528
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
|
|
4060
4529
|
/**
|
|
4061
4530
|
* @typedef {import('mdast').Code} Code
|
|
4062
4531
|
* @typedef {import('../types.js').State} State
|
|
@@ -4069,8 +4538,7 @@ function longestStreak(value, substring) {
|
|
|
4069
4538
|
function formatCodeAsIndented(node, state) {
|
|
4070
4539
|
return Boolean(state.options.fences === false && node.value && !node.lang && /[^ \r\n]/.test(node.value) && !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node.value));
|
|
4071
4540
|
}
|
|
4072
|
-
|
|
4073
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
|
|
4541
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
|
|
4074
4542
|
/**
|
|
4075
4543
|
* @typedef {import('../types.js').Options} Options
|
|
4076
4544
|
* @typedef {import('../types.js').State} State
|
|
@@ -4084,8 +4552,7 @@ function checkFence(state) {
|
|
|
4084
4552
|
if (marker !== "`" && marker !== "~") throw new Error("Cannot serialize code with `" + marker + "` for `options.fence`, expected `` ` `` or `~`");
|
|
4085
4553
|
return marker;
|
|
4086
4554
|
}
|
|
4087
|
-
|
|
4088
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/code.js
|
|
4555
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/code.js
|
|
4089
4556
|
/**
|
|
4090
4557
|
* @typedef {import('mdast').Code} Code
|
|
4091
4558
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4145,8 +4612,7 @@ function code$2(node, _, state, info) {
|
|
|
4145
4612
|
function map(line, _, blank) {
|
|
4146
4613
|
return (blank ? "" : " ") + line;
|
|
4147
4614
|
}
|
|
4148
|
-
|
|
4149
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
|
|
4615
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
|
|
4150
4616
|
/**
|
|
4151
4617
|
* @typedef {import('../types.js').Options} Options
|
|
4152
4618
|
* @typedef {import('../types.js').State} State
|
|
@@ -4160,8 +4626,7 @@ function checkQuote(state) {
|
|
|
4160
4626
|
if (marker !== "\"" && marker !== "'") throw new Error("Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`");
|
|
4161
4627
|
return marker;
|
|
4162
4628
|
}
|
|
4163
|
-
|
|
4164
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/definition.js
|
|
4629
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/definition.js
|
|
4165
4630
|
/**
|
|
4166
4631
|
* @typedef {import('mdast').Definition} Definition
|
|
4167
4632
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4221,8 +4686,7 @@ function definition$1(node, _, state, info) {
|
|
|
4221
4686
|
exit();
|
|
4222
4687
|
return value;
|
|
4223
4688
|
}
|
|
4224
|
-
|
|
4225
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
|
|
4689
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
|
|
4226
4690
|
/**
|
|
4227
4691
|
* @typedef {import('../types.js').Options} Options
|
|
4228
4692
|
* @typedef {import('../types.js').State} State
|
|
@@ -4236,8 +4700,7 @@ function checkEmphasis(state) {
|
|
|
4236
4700
|
if (marker !== "*" && marker !== "_") throw new Error("Cannot serialize emphasis with `" + marker + "` for `options.emphasis`, expected `*`, or `_`");
|
|
4237
4701
|
return marker;
|
|
4238
4702
|
}
|
|
4239
|
-
|
|
4240
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
|
|
4703
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
|
|
4241
4704
|
/**
|
|
4242
4705
|
* @typedef {import('mdast').Emphasis} Emphasis
|
|
4243
4706
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4275,8 +4738,291 @@ function emphasis$1(node, _, state, info) {
|
|
|
4275
4738
|
function emphasisPeek(_, _1, state) {
|
|
4276
4739
|
return state.options.emphasis || "*";
|
|
4277
4740
|
}
|
|
4278
|
-
|
|
4279
|
-
|
|
4741
|
+
// ../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js
|
|
4742
|
+
/**
|
|
4743
|
+
* @import {Node as UnistNode, Parent as UnistParent} from 'unist'
|
|
4744
|
+
* @import {VisitorResult} from 'unist-util-visit-parents'
|
|
4745
|
+
*/
|
|
4746
|
+
/**
|
|
4747
|
+
* @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
|
|
4748
|
+
* Test from `unist-util-is`.
|
|
4749
|
+
*
|
|
4750
|
+
* Note: we have remove and add `undefined`, because otherwise when generating
|
|
4751
|
+
* automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
|
|
4752
|
+
* which doesn’t work when publishing on npm.
|
|
4753
|
+
*/
|
|
4754
|
+
/**
|
|
4755
|
+
* @typedef {(
|
|
4756
|
+
* Fn extends (value: any) => value is infer Thing
|
|
4757
|
+
* ? Thing
|
|
4758
|
+
* : Fallback
|
|
4759
|
+
* )} Predicate
|
|
4760
|
+
* Get the value of a type guard `Fn`.
|
|
4761
|
+
* @template Fn
|
|
4762
|
+
* Value; typically function that is a type guard (such as `(x): x is Y`).
|
|
4763
|
+
* @template Fallback
|
|
4764
|
+
* Value to yield if `Fn` is not a type guard.
|
|
4765
|
+
*/
|
|
4766
|
+
/**
|
|
4767
|
+
* @typedef {(
|
|
4768
|
+
* Check extends null | undefined // No test.
|
|
4769
|
+
* ? Value
|
|
4770
|
+
* : Value extends {type: Check} // String (type) test.
|
|
4771
|
+
* ? Value
|
|
4772
|
+
* : Value extends Check // Partial test.
|
|
4773
|
+
* ? Value
|
|
4774
|
+
* : Check extends Function // Function test.
|
|
4775
|
+
* ? Predicate<Check, Value> extends Value
|
|
4776
|
+
* ? Predicate<Check, Value>
|
|
4777
|
+
* : never
|
|
4778
|
+
* : never // Some other test?
|
|
4779
|
+
* )} MatchesOne
|
|
4780
|
+
* Check whether a node matches a primitive check in the type system.
|
|
4781
|
+
* @template Value
|
|
4782
|
+
* Value; typically unist `Node`.
|
|
4783
|
+
* @template Check
|
|
4784
|
+
* Value; typically `unist-util-is`-compatible test, but not arrays.
|
|
4785
|
+
*/
|
|
4786
|
+
/**
|
|
4787
|
+
* @typedef {(
|
|
4788
|
+
* Check extends ReadonlyArray<any>
|
|
4789
|
+
* ? MatchesOne<Value, Check[number]>
|
|
4790
|
+
* : MatchesOne<Value, Check>
|
|
4791
|
+
* )} Matches
|
|
4792
|
+
* Check whether a node matches a check in the type system.
|
|
4793
|
+
* @template Value
|
|
4794
|
+
* Value; typically unist `Node`.
|
|
4795
|
+
* @template Check
|
|
4796
|
+
* Value; typically `unist-util-is`-compatible test.
|
|
4797
|
+
*/
|
|
4798
|
+
/**
|
|
4799
|
+
* @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint
|
|
4800
|
+
* Number; capped reasonably.
|
|
4801
|
+
*/
|
|
4802
|
+
/**
|
|
4803
|
+
* @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment
|
|
4804
|
+
* Increment a number in the type system.
|
|
4805
|
+
* @template {Uint} [I=0]
|
|
4806
|
+
* Index.
|
|
4807
|
+
*/
|
|
4808
|
+
/**
|
|
4809
|
+
* @typedef {(
|
|
4810
|
+
* Node extends UnistParent
|
|
4811
|
+
* ? Node extends {children: Array<infer Children>}
|
|
4812
|
+
* ? Child extends Children ? Node : never
|
|
4813
|
+
* : never
|
|
4814
|
+
* : never
|
|
4815
|
+
* )} InternalParent
|
|
4816
|
+
* Collect nodes that can be parents of `Child`.
|
|
4817
|
+
* @template {UnistNode} Node
|
|
4818
|
+
* All node types in a tree.
|
|
4819
|
+
* @template {UnistNode} Child
|
|
4820
|
+
* Node to search for.
|
|
4821
|
+
*/
|
|
4822
|
+
/**
|
|
4823
|
+
* @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent
|
|
4824
|
+
* Collect nodes in `Tree` that can be parents of `Child`.
|
|
4825
|
+
* @template {UnistNode} Tree
|
|
4826
|
+
* All node types in a tree.
|
|
4827
|
+
* @template {UnistNode} Child
|
|
4828
|
+
* Node to search for.
|
|
4829
|
+
*/
|
|
4830
|
+
/**
|
|
4831
|
+
* @typedef {(
|
|
4832
|
+
* Depth extends Max
|
|
4833
|
+
* ? never
|
|
4834
|
+
* :
|
|
4835
|
+
* | InternalParent<Node, Child>
|
|
4836
|
+
* | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>
|
|
4837
|
+
* )} InternalAncestor
|
|
4838
|
+
* Collect nodes in `Tree` that can be ancestors of `Child`.
|
|
4839
|
+
* @template {UnistNode} Node
|
|
4840
|
+
* All node types in a tree.
|
|
4841
|
+
* @template {UnistNode} Child
|
|
4842
|
+
* Node to search for.
|
|
4843
|
+
* @template {Uint} [Max=10]
|
|
4844
|
+
* Max; searches up to this depth.
|
|
4845
|
+
* @template {Uint} [Depth=0]
|
|
4846
|
+
* Current depth.
|
|
4847
|
+
*/
|
|
4848
|
+
/**
|
|
4849
|
+
* @typedef {(
|
|
4850
|
+
* Tree extends UnistParent
|
|
4851
|
+
* ? Depth extends Max
|
|
4852
|
+
* ? Tree
|
|
4853
|
+
* : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>
|
|
4854
|
+
* : Tree
|
|
4855
|
+
* )} InclusiveDescendant
|
|
4856
|
+
* Collect all (inclusive) descendants of `Tree`.
|
|
4857
|
+
*
|
|
4858
|
+
* > 👉 **Note**: for performance reasons, this seems to be the fastest way to
|
|
4859
|
+
* > recurse without actually running into an infinite loop, which the
|
|
4860
|
+
* > previous version did.
|
|
4861
|
+
* >
|
|
4862
|
+
* > Practically, a max of `2` is typically enough assuming a `Root` is
|
|
4863
|
+
* > passed, but it doesn’t improve performance.
|
|
4864
|
+
* > It gets higher with `List > ListItem > Table > TableRow > TableCell`.
|
|
4865
|
+
* > Using up to `10` doesn’t hurt or help either.
|
|
4866
|
+
* @template {UnistNode} Tree
|
|
4867
|
+
* Tree type.
|
|
4868
|
+
* @template {Uint} [Max=10]
|
|
4869
|
+
* Max; searches up to this depth.
|
|
4870
|
+
* @template {Uint} [Depth=0]
|
|
4871
|
+
* Current depth.
|
|
4872
|
+
*/
|
|
4873
|
+
/**
|
|
4874
|
+
* @callback Visitor
|
|
4875
|
+
* Handle a node (matching `test`, if given).
|
|
4876
|
+
*
|
|
4877
|
+
* Visitors are free to transform `node`.
|
|
4878
|
+
* They can also transform `parent`.
|
|
4879
|
+
*
|
|
4880
|
+
* Replacing `node` itself, if `SKIP` is not returned, still causes its
|
|
4881
|
+
* descendants to be walked (which is a bug).
|
|
4882
|
+
*
|
|
4883
|
+
* When adding or removing previous siblings of `node` (or next siblings, in
|
|
4884
|
+
* case of reverse), the `Visitor` should return a new `Index` to specify the
|
|
4885
|
+
* sibling to traverse after `node` is traversed.
|
|
4886
|
+
* Adding or removing next siblings of `node` (or previous siblings, in case
|
|
4887
|
+
* of reverse) is handled as expected without needing to return a new `Index`.
|
|
4888
|
+
*
|
|
4889
|
+
* Removing the children property of `parent` still results in them being
|
|
4890
|
+
* traversed.
|
|
4891
|
+
* @param {Visited} node
|
|
4892
|
+
* Found node.
|
|
4893
|
+
* @param {Visited extends UnistNode ? number | undefined : never} index
|
|
4894
|
+
* Index of `node` in `parent`.
|
|
4895
|
+
* @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent
|
|
4896
|
+
* Parent of `node`.
|
|
4897
|
+
* @returns {VisitorResult}
|
|
4898
|
+
* What to do next.
|
|
4899
|
+
*
|
|
4900
|
+
* An `Index` is treated as a tuple of `[CONTINUE, Index]`.
|
|
4901
|
+
* An `Action` is treated as a tuple of `[Action]`.
|
|
4902
|
+
*
|
|
4903
|
+
* Passing a tuple back only makes sense if the `Action` is `SKIP`.
|
|
4904
|
+
* When the `Action` is `EXIT`, that action can be returned.
|
|
4905
|
+
* When the `Action` is `CONTINUE`, `Index` can be returned.
|
|
4906
|
+
* @template {UnistNode} [Visited=UnistNode]
|
|
4907
|
+
* Visited node type.
|
|
4908
|
+
* @template {UnistParent} [Ancestor=UnistParent]
|
|
4909
|
+
* Ancestor type.
|
|
4910
|
+
*/
|
|
4911
|
+
/**
|
|
4912
|
+
* @typedef {Visitor<Visited, Parent<Ancestor, Visited>>} BuildVisitorFromMatch
|
|
4913
|
+
* Build a typed `Visitor` function from a node and all possible parents.
|
|
4914
|
+
*
|
|
4915
|
+
* It will infer which values are passed as `node` and which as `parent`.
|
|
4916
|
+
* @template {UnistNode} Visited
|
|
4917
|
+
* Node type.
|
|
4918
|
+
* @template {UnistParent} Ancestor
|
|
4919
|
+
* Parent type.
|
|
4920
|
+
*/
|
|
4921
|
+
/**
|
|
4922
|
+
* @typedef {(
|
|
4923
|
+
* BuildVisitorFromMatch<
|
|
4924
|
+
* Matches<Descendant, Check>,
|
|
4925
|
+
* Extract<Descendant, UnistParent>
|
|
4926
|
+
* >
|
|
4927
|
+
* )} BuildVisitorFromDescendants
|
|
4928
|
+
* Build a typed `Visitor` function from a list of descendants and a test.
|
|
4929
|
+
*
|
|
4930
|
+
* It will infer which values are passed as `node` and which as `parent`.
|
|
4931
|
+
* @template {UnistNode} Descendant
|
|
4932
|
+
* Node type.
|
|
4933
|
+
* @template {Test} Check
|
|
4934
|
+
* Test type.
|
|
4935
|
+
*/
|
|
4936
|
+
/**
|
|
4937
|
+
* @typedef {(
|
|
4938
|
+
* BuildVisitorFromDescendants<
|
|
4939
|
+
* InclusiveDescendant<Tree>,
|
|
4940
|
+
* Check
|
|
4941
|
+
* >
|
|
4942
|
+
* )} BuildVisitor
|
|
4943
|
+
* Build a typed `Visitor` function from a tree and a test.
|
|
4944
|
+
*
|
|
4945
|
+
* It will infer which values are passed as `node` and which as `parent`.
|
|
4946
|
+
* @template {UnistNode} [Tree=UnistNode]
|
|
4947
|
+
* Node type.
|
|
4948
|
+
* @template {Test} [Check=Test]
|
|
4949
|
+
* Test type.
|
|
4950
|
+
*/
|
|
4951
|
+
/**
|
|
4952
|
+
* Visit nodes.
|
|
4953
|
+
*
|
|
4954
|
+
* This algorithm performs *depth-first* *tree traversal* in *preorder*
|
|
4955
|
+
* (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
|
|
4956
|
+
*
|
|
4957
|
+
* You can choose for which nodes `visitor` is called by passing a `test`.
|
|
4958
|
+
* For complex tests, you should test yourself in `visitor`, as it will be
|
|
4959
|
+
* faster and will have improved type information.
|
|
4960
|
+
*
|
|
4961
|
+
* Walking the tree is an intensive task.
|
|
4962
|
+
* Make use of the return values of the visitor when possible.
|
|
4963
|
+
* Instead of walking a tree multiple times, walk it once, use `unist-util-is`
|
|
4964
|
+
* to check if a node matches, and then perform different operations.
|
|
4965
|
+
*
|
|
4966
|
+
* You can change the tree.
|
|
4967
|
+
* See `Visitor` for more info.
|
|
4968
|
+
*
|
|
4969
|
+
* @overload
|
|
4970
|
+
* @param {Tree} tree
|
|
4971
|
+
* @param {Check} check
|
|
4972
|
+
* @param {BuildVisitor<Tree, Check>} visitor
|
|
4973
|
+
* @param {boolean | null | undefined} [reverse]
|
|
4974
|
+
* @returns {undefined}
|
|
4975
|
+
*
|
|
4976
|
+
* @overload
|
|
4977
|
+
* @param {Tree} tree
|
|
4978
|
+
* @param {BuildVisitor<Tree>} visitor
|
|
4979
|
+
* @param {boolean | null | undefined} [reverse]
|
|
4980
|
+
* @returns {undefined}
|
|
4981
|
+
*
|
|
4982
|
+
* @param {UnistNode} tree
|
|
4983
|
+
* Tree to traverse.
|
|
4984
|
+
* @param {Visitor | Test} testOrVisitor
|
|
4985
|
+
* `unist-util-is`-compatible test (optional, omit to pass a visitor).
|
|
4986
|
+
* @param {Visitor | boolean | null | undefined} [visitorOrReverse]
|
|
4987
|
+
* Handle each node (when test is omitted, pass `reverse`).
|
|
4988
|
+
* @param {boolean | null | undefined} [maybeReverse=false]
|
|
4989
|
+
* Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
|
|
4990
|
+
* @returns {undefined}
|
|
4991
|
+
* Nothing.
|
|
4992
|
+
*
|
|
4993
|
+
* @template {UnistNode} Tree
|
|
4994
|
+
* Node type.
|
|
4995
|
+
* @template {Test} Check
|
|
4996
|
+
* `unist-util-is`-compatible test.
|
|
4997
|
+
*/
|
|
4998
|
+
function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
|
|
4999
|
+
/** @type {boolean | null | undefined} */
|
|
5000
|
+
let reverse;
|
|
5001
|
+
/** @type {Test} */
|
|
5002
|
+
let test;
|
|
5003
|
+
/** @type {Visitor} */
|
|
5004
|
+
let visitor;
|
|
5005
|
+
if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
|
|
5006
|
+
test = void 0;
|
|
5007
|
+
visitor = testOrVisitor;
|
|
5008
|
+
reverse = visitorOrReverse;
|
|
5009
|
+
} else {
|
|
5010
|
+
test = testOrVisitor;
|
|
5011
|
+
visitor = visitorOrReverse;
|
|
5012
|
+
reverse = maybeReverse;
|
|
5013
|
+
}
|
|
5014
|
+
visitParents(tree, test, overload, reverse);
|
|
5015
|
+
/**
|
|
5016
|
+
* @param {UnistNode} node
|
|
5017
|
+
* @param {Array<UnistParent>} parents
|
|
5018
|
+
*/
|
|
5019
|
+
function overload(node, parents) {
|
|
5020
|
+
const parent = parents[parents.length - 1];
|
|
5021
|
+
const index = parent ? parent.children.indexOf(node) : void 0;
|
|
5022
|
+
return visitor(node, index, parent);
|
|
5023
|
+
}
|
|
5024
|
+
}
|
|
5025
|
+
// ../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
|
|
4280
5026
|
/**
|
|
4281
5027
|
* @typedef {import('mdast').Nodes} Nodes
|
|
4282
5028
|
*
|
|
@@ -4357,8 +5103,7 @@ function all(values, includeImageAlt, includeHtml) {
|
|
|
4357
5103
|
function node(value) {
|
|
4358
5104
|
return Boolean(value && typeof value === "object");
|
|
4359
5105
|
}
|
|
4360
|
-
|
|
4361
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
|
|
5106
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
|
|
4362
5107
|
/**
|
|
4363
5108
|
* @typedef {import('mdast').Heading} Heading
|
|
4364
5109
|
* @typedef {import('../types.js').State} State
|
|
@@ -4378,8 +5123,7 @@ function formatHeadingAsSetext(node, state) {
|
|
|
4378
5123
|
});
|
|
4379
5124
|
return Boolean((!node.depth || node.depth < 3) && toString(node) && (state.options.setext || literalWithBreak));
|
|
4380
5125
|
}
|
|
4381
|
-
|
|
4382
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/heading.js
|
|
5126
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/heading.js
|
|
4383
5127
|
/**
|
|
4384
5128
|
* @typedef {import('mdast').Heading} Heading
|
|
4385
5129
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4424,8 +5168,7 @@ function heading$1(node, _, state, info) {
|
|
|
4424
5168
|
exit();
|
|
4425
5169
|
return value;
|
|
4426
5170
|
}
|
|
4427
|
-
|
|
4428
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/html.js
|
|
5171
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/html.js
|
|
4429
5172
|
/**
|
|
4430
5173
|
* @typedef {import('mdast').Html} Html
|
|
4431
5174
|
*/
|
|
@@ -4443,8 +5186,7 @@ function html$1(node) {
|
|
|
4443
5186
|
function htmlPeek() {
|
|
4444
5187
|
return "<";
|
|
4445
5188
|
}
|
|
4446
|
-
|
|
4447
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/image.js
|
|
5189
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/image.js
|
|
4448
5190
|
/**
|
|
4449
5191
|
* @typedef {import('mdast').Image} Image
|
|
4450
5192
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4512,8 +5254,7 @@ function image$1(node, _, state, info) {
|
|
|
4512
5254
|
function imagePeek() {
|
|
4513
5255
|
return "!";
|
|
4514
5256
|
}
|
|
4515
|
-
|
|
4516
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
|
|
5257
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
|
|
4517
5258
|
/**
|
|
4518
5259
|
* @typedef {import('mdast').ImageReference} ImageReference
|
|
4519
5260
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4563,8 +5304,7 @@ function imageReference$1(node, _, state, info) {
|
|
|
4563
5304
|
function imageReferencePeek() {
|
|
4564
5305
|
return "!";
|
|
4565
5306
|
}
|
|
4566
|
-
|
|
4567
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
|
|
5307
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
|
|
4568
5308
|
/**
|
|
4569
5309
|
* @typedef {import('mdast').InlineCode} InlineCode
|
|
4570
5310
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4603,8 +5343,7 @@ function inlineCode$1(node, _, state) {
|
|
|
4603
5343
|
function inlineCodePeek() {
|
|
4604
5344
|
return "`";
|
|
4605
5345
|
}
|
|
4606
|
-
|
|
4607
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
|
|
5346
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
|
|
4608
5347
|
/**
|
|
4609
5348
|
* @typedef {import('mdast').Link} Link
|
|
4610
5349
|
* @typedef {import('../types.js').State} State
|
|
@@ -4618,8 +5357,7 @@ function formatLinkAsAutolink(node, state) {
|
|
|
4618
5357
|
const raw = toString(node);
|
|
4619
5358
|
return Boolean(!state.options.resourceLink && node.url && !node.title && node.children && node.children.length === 1 && node.children[0].type === "text" && (raw === node.url || "mailto:" + raw === node.url) && /^[a-z][a-z+.-]+:/i.test(node.url) && !/[\0- <>\u007F]/.test(node.url));
|
|
4620
5359
|
}
|
|
4621
|
-
|
|
4622
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/link.js
|
|
5360
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/link.js
|
|
4623
5361
|
/**
|
|
4624
5362
|
* @typedef {import('mdast').Link} Link
|
|
4625
5363
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4710,8 +5448,7 @@ function link$1(node, _, state, info) {
|
|
|
4710
5448
|
function linkPeek(node, _, state) {
|
|
4711
5449
|
return formatLinkAsAutolink(node, state) ? "<" : "[";
|
|
4712
5450
|
}
|
|
4713
|
-
|
|
4714
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
|
|
5451
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
|
|
4715
5452
|
/**
|
|
4716
5453
|
* @typedef {import('mdast').LinkReference} LinkReference
|
|
4717
5454
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4761,8 +5498,7 @@ function linkReference$1(node, _, state, info) {
|
|
|
4761
5498
|
function linkReferencePeek() {
|
|
4762
5499
|
return "[";
|
|
4763
5500
|
}
|
|
4764
|
-
|
|
4765
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
|
|
5501
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
|
|
4766
5502
|
/**
|
|
4767
5503
|
* @typedef {import('../types.js').Options} Options
|
|
4768
5504
|
* @typedef {import('../types.js').State} State
|
|
@@ -4776,8 +5512,7 @@ function checkBullet(state) {
|
|
|
4776
5512
|
if (marker !== "*" && marker !== "+" && marker !== "-") throw new Error("Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`");
|
|
4777
5513
|
return marker;
|
|
4778
5514
|
}
|
|
4779
|
-
|
|
4780
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
|
|
5515
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
|
|
4781
5516
|
/**
|
|
4782
5517
|
* @typedef {import('../types.js').Options} Options
|
|
4783
5518
|
* @typedef {import('../types.js').State} State
|
|
@@ -4794,8 +5529,7 @@ function checkBulletOther(state) {
|
|
|
4794
5529
|
if (bulletOther === bullet) throw new Error("Expected `bullet` (`" + bullet + "`) and `bulletOther` (`" + bulletOther + "`) to be different");
|
|
4795
5530
|
return bulletOther;
|
|
4796
5531
|
}
|
|
4797
|
-
|
|
4798
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
|
|
5532
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
|
|
4799
5533
|
/**
|
|
4800
5534
|
* @typedef {import('../types.js').Options} Options
|
|
4801
5535
|
* @typedef {import('../types.js').State} State
|
|
@@ -4809,8 +5543,7 @@ function checkBulletOrdered(state) {
|
|
|
4809
5543
|
if (marker !== "." && marker !== ")") throw new Error("Cannot serialize items with `" + marker + "` for `options.bulletOrdered`, expected `.` or `)`");
|
|
4810
5544
|
return marker;
|
|
4811
5545
|
}
|
|
4812
|
-
|
|
4813
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
|
|
5546
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
|
|
4814
5547
|
/**
|
|
4815
5548
|
* @typedef {import('../types.js').Options} Options
|
|
4816
5549
|
* @typedef {import('../types.js').State} State
|
|
@@ -4824,8 +5557,7 @@ function checkRule(state) {
|
|
|
4824
5557
|
if (marker !== "*" && marker !== "-" && marker !== "_") throw new Error("Cannot serialize rules with `" + marker + "` for `options.rule`, expected `*`, `-`, or `_`");
|
|
4825
5558
|
return marker;
|
|
4826
5559
|
}
|
|
4827
|
-
|
|
4828
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/list.js
|
|
5560
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/list.js
|
|
4829
5561
|
/**
|
|
4830
5562
|
* @typedef {import('mdast').List} List
|
|
4831
5563
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4869,8 +5601,7 @@ function list$2(node, parent, state, info) {
|
|
|
4869
5601
|
exit();
|
|
4870
5602
|
return value;
|
|
4871
5603
|
}
|
|
4872
|
-
|
|
4873
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
|
|
5604
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
|
|
4874
5605
|
/**
|
|
4875
5606
|
* @typedef {import('../types.js').Options} Options
|
|
4876
5607
|
* @typedef {import('../types.js').State} State
|
|
@@ -4884,8 +5615,7 @@ function checkListItemIndent(state) {
|
|
|
4884
5615
|
if (style !== "tab" && style !== "one" && style !== "mixed") throw new Error("Cannot serialize items with `" + style + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");
|
|
4885
5616
|
return style;
|
|
4886
5617
|
}
|
|
4887
|
-
|
|
4888
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
|
|
5618
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
|
|
4889
5619
|
/**
|
|
4890
5620
|
* @typedef {import('mdast').ListItem} ListItem
|
|
4891
5621
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4919,8 +5649,7 @@ function listItem$1(node, parent, state, info) {
|
|
|
4919
5649
|
return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line;
|
|
4920
5650
|
}
|
|
4921
5651
|
}
|
|
4922
|
-
|
|
4923
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
|
|
5652
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
|
|
4924
5653
|
/**
|
|
4925
5654
|
* @typedef {import('mdast').Paragraph} Paragraph
|
|
4926
5655
|
* @typedef {import('mdast').Parents} Parents
|
|
@@ -4942,8 +5671,7 @@ function paragraph$1(node, _, state, info) {
|
|
|
4942
5671
|
exit();
|
|
4943
5672
|
return value;
|
|
4944
5673
|
}
|
|
4945
|
-
|
|
4946
|
-
//#region ../../node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.js
|
|
5674
|
+
// ../../node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.js
|
|
4947
5675
|
/**
|
|
4948
5676
|
* @typedef {import('mdast').Html} Html
|
|
4949
5677
|
* @typedef {import('mdast').PhrasingContent} PhrasingContent
|
|
@@ -4976,8 +5704,7 @@ var phrasing = convert([
|
|
|
4976
5704
|
"text",
|
|
4977
5705
|
"textDirective"
|
|
4978
5706
|
]);
|
|
4979
|
-
|
|
4980
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/root.js
|
|
5707
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/root.js
|
|
4981
5708
|
/**
|
|
4982
5709
|
* @typedef {import('mdast').Parents} Parents
|
|
4983
5710
|
* @typedef {import('mdast').Root} Root
|
|
@@ -4996,8 +5723,7 @@ function root$1(node, _, state, info) {
|
|
|
4996
5723
|
return phrasing(d);
|
|
4997
5724
|
}) ? state.containerPhrasing : state.containerFlow).call(state, node, info);
|
|
4998
5725
|
}
|
|
4999
|
-
|
|
5000
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
|
|
5726
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
|
|
5001
5727
|
/**
|
|
5002
5728
|
* @typedef {import('../types.js').Options} Options
|
|
5003
5729
|
* @typedef {import('../types.js').State} State
|
|
@@ -5011,8 +5737,7 @@ function checkStrong(state) {
|
|
|
5011
5737
|
if (marker !== "*" && marker !== "_") throw new Error("Cannot serialize strong with `" + marker + "` for `options.strong`, expected `*`, or `_`");
|
|
5012
5738
|
return marker;
|
|
5013
5739
|
}
|
|
5014
|
-
|
|
5015
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/strong.js
|
|
5740
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/strong.js
|
|
5016
5741
|
/**
|
|
5017
5742
|
* @typedef {import('mdast').Parents} Parents
|
|
5018
5743
|
* @typedef {import('mdast').Strong} Strong
|
|
@@ -5050,8 +5775,7 @@ function strong$1(node, _, state, info) {
|
|
|
5050
5775
|
function strongPeek(_, _1, state) {
|
|
5051
5776
|
return state.options.strong || "*";
|
|
5052
5777
|
}
|
|
5053
|
-
|
|
5054
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/text.js
|
|
5778
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/text.js
|
|
5055
5779
|
/**
|
|
5056
5780
|
* @typedef {import('mdast').Parents} Parents
|
|
5057
5781
|
* @typedef {import('mdast').Text} Text
|
|
@@ -5068,8 +5792,7 @@ function strongPeek(_, _1, state) {
|
|
|
5068
5792
|
function text$4(node, _, state, info) {
|
|
5069
5793
|
return state.safe(node.value, info);
|
|
5070
5794
|
}
|
|
5071
|
-
|
|
5072
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
|
|
5795
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
|
|
5073
5796
|
/**
|
|
5074
5797
|
* @typedef {import('../types.js').Options} Options
|
|
5075
5798
|
* @typedef {import('../types.js').State} State
|
|
@@ -5083,8 +5806,7 @@ function checkRuleRepetition(state) {
|
|
|
5083
5806
|
if (repetition < 3) throw new Error("Cannot serialize rules with repetition `" + repetition + "` for `options.ruleRepetition`, expected `3` or more");
|
|
5084
5807
|
return repetition;
|
|
5085
5808
|
}
|
|
5086
|
-
|
|
5087
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
|
|
5809
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
|
|
5088
5810
|
/**
|
|
5089
5811
|
* @typedef {import('mdast').Parents} Parents
|
|
5090
5812
|
* @typedef {import('mdast').ThematicBreak} ThematicBreak
|
|
@@ -5100,8 +5822,7 @@ function thematicBreak$2(_, _1, state) {
|
|
|
5100
5822
|
const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
|
|
5101
5823
|
return state.options.ruleSpaces ? value.slice(0, -1) : value;
|
|
5102
5824
|
}
|
|
5103
|
-
|
|
5104
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/index.js
|
|
5825
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/handle/index.js
|
|
5105
5826
|
/**
|
|
5106
5827
|
* Default (CommonMark) handlers.
|
|
5107
5828
|
*/
|
|
@@ -5127,8 +5848,7 @@ var handle = {
|
|
|
5127
5848
|
text: text$4,
|
|
5128
5849
|
thematicBreak: thematicBreak$2
|
|
5129
5850
|
};
|
|
5130
|
-
|
|
5131
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/join.js
|
|
5851
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/join.js
|
|
5132
5852
|
/**
|
|
5133
5853
|
* @typedef {import('./types.js').Join} Join
|
|
5134
5854
|
*/
|
|
@@ -5142,8 +5862,7 @@ function joinDefaults(left, right, parent, state) {
|
|
|
5142
5862
|
return parent.spread ? 1 : 0;
|
|
5143
5863
|
}
|
|
5144
5864
|
}
|
|
5145
|
-
|
|
5146
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/unsafe.js
|
|
5865
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/unsafe.js
|
|
5147
5866
|
/**
|
|
5148
5867
|
* @typedef {import('./types.js').ConstructName} ConstructName
|
|
5149
5868
|
* @typedef {import('./types.js').Unsafe} Unsafe
|
|
@@ -5365,8 +6084,7 @@ var unsafe = [
|
|
|
5365
6084
|
character: "~"
|
|
5366
6085
|
}
|
|
5367
6086
|
];
|
|
5368
|
-
|
|
5369
|
-
//#region ../../node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js
|
|
6087
|
+
// ../../node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js
|
|
5370
6088
|
/**
|
|
5371
6089
|
* Map of named character references.
|
|
5372
6090
|
*
|
|
@@ -7499,8 +8217,7 @@ var characterEntities = {
|
|
|
7499
8217
|
zwj: "",
|
|
7500
8218
|
zwnj: ""
|
|
7501
8219
|
};
|
|
7502
|
-
|
|
7503
|
-
//#region ../../node_modules/.pnpm/decode-named-character-reference@1.0.2/node_modules/decode-named-character-reference/index.js
|
|
8220
|
+
// ../../node_modules/.pnpm/decode-named-character-reference@1.0.2/node_modules/decode-named-character-reference/index.js
|
|
7504
8221
|
var own$2 = {}.hasOwnProperty;
|
|
7505
8222
|
/**
|
|
7506
8223
|
* Decode a single character reference (without the `&` or `;`).
|
|
@@ -7516,8 +8233,7 @@ var own$2 = {}.hasOwnProperty;
|
|
|
7516
8233
|
function decodeNamedCharacterReference(value) {
|
|
7517
8234
|
return own$2.call(characterEntities, value) ? characterEntities[value] : false;
|
|
7518
8235
|
}
|
|
7519
|
-
|
|
7520
|
-
//#region ../../node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.1/node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
8236
|
+
// ../../node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.1/node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
7521
8237
|
/**
|
|
7522
8238
|
* Turn the number (in string form as either hexa- or plain decimal) coming from
|
|
7523
8239
|
* a numeric character reference into a character.
|
|
@@ -7537,8 +8253,7 @@ function decodeNumericCharacterReference(value, base) {
|
|
|
7537
8253
|
if (code < 9 || code === 11 || code > 13 && code < 32 || code > 126 && code < 160 || code > 55295 && code < 57344 || code > 64975 && code < 65008 || (code & 65535) === 65535 || (code & 65535) === 65534 || code > 1114111) return "�";
|
|
7538
8254
|
return String.fromCodePoint(code);
|
|
7539
8255
|
}
|
|
7540
|
-
|
|
7541
|
-
//#region ../../node_modules/.pnpm/micromark-util-decode-string@2.0.0/node_modules/micromark-util-decode-string/index.js
|
|
8256
|
+
// ../../node_modules/.pnpm/micromark-util-decode-string@2.0.0/node_modules/micromark-util-decode-string/index.js
|
|
7542
8257
|
var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
7543
8258
|
/**
|
|
7544
8259
|
* Decode markdown strings (which occur in places such as fenced code info
|
|
@@ -7570,8 +8285,7 @@ function decode($0, $1, $2) {
|
|
|
7570
8285
|
}
|
|
7571
8286
|
return decodeNamedCharacterReference($2) || $0;
|
|
7572
8287
|
}
|
|
7573
|
-
|
|
7574
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/association.js
|
|
8288
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/association.js
|
|
7575
8289
|
/**
|
|
7576
8290
|
* @typedef {import('../types.js').AssociationId} AssociationId
|
|
7577
8291
|
*/
|
|
@@ -7599,8 +8313,7 @@ function association(node) {
|
|
|
7599
8313
|
if (node.label || !node.identifier) return node.label || "";
|
|
7600
8314
|
return decodeString(node.identifier);
|
|
7601
8315
|
}
|
|
7602
|
-
|
|
7603
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js
|
|
8316
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js
|
|
7604
8317
|
/**
|
|
7605
8318
|
* @typedef {import('../types.js').CompilePattern} CompilePattern
|
|
7606
8319
|
*/
|
|
@@ -7614,8 +8327,7 @@ function compilePattern(pattern) {
|
|
|
7614
8327
|
}
|
|
7615
8328
|
return pattern._compiled;
|
|
7616
8329
|
}
|
|
7617
|
-
|
|
7618
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
|
|
8330
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
|
|
7619
8331
|
/**
|
|
7620
8332
|
* @typedef {import('../types.js').Handle} Handle
|
|
7621
8333
|
* @typedef {import('../types.js').Info} Info
|
|
@@ -7677,8 +8389,7 @@ function containerPhrasing(parent, state, info) {
|
|
|
7677
8389
|
indexStack.pop();
|
|
7678
8390
|
return results.join("");
|
|
7679
8391
|
}
|
|
7680
|
-
|
|
7681
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
|
|
8392
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
|
|
7682
8393
|
/**
|
|
7683
8394
|
* @typedef {import('../types.js').FlowParents} FlowParents
|
|
7684
8395
|
* @typedef {import('../types.js').FlowChildren} FlowChildren
|
|
@@ -7734,8 +8445,7 @@ function between(left, right, parent, state) {
|
|
|
7734
8445
|
}
|
|
7735
8446
|
return "\n\n";
|
|
7736
8447
|
}
|
|
7737
|
-
|
|
7738
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
|
|
8448
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
|
|
7739
8449
|
/**
|
|
7740
8450
|
* @typedef {import('../types.js').IndentLines} IndentLines
|
|
7741
8451
|
*/
|
|
@@ -7765,8 +8475,7 @@ function indentLines(value, map) {
|
|
|
7765
8475
|
result.push(map(value, line, !value));
|
|
7766
8476
|
}
|
|
7767
8477
|
}
|
|
7768
|
-
|
|
7769
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/safe.js
|
|
8478
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/safe.js
|
|
7770
8479
|
/**
|
|
7771
8480
|
* @typedef {import('../types.js').SafeConfig} SafeConfig
|
|
7772
8481
|
* @typedef {import('../types.js').State} State
|
|
@@ -7879,8 +8588,7 @@ function escapeBackslashes(value, after) {
|
|
|
7879
8588
|
results.push(value.slice(start));
|
|
7880
8589
|
return results.join("");
|
|
7881
8590
|
}
|
|
7882
|
-
|
|
7883
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
8591
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
7884
8592
|
/**
|
|
7885
8593
|
* @typedef {import('../types.js').CreateTracker} CreateTracker
|
|
7886
8594
|
* @typedef {import('../types.js').TrackCurrent} TrackCurrent
|
|
@@ -7940,8 +8648,7 @@ function track(config) {
|
|
|
7940
8648
|
return value;
|
|
7941
8649
|
}
|
|
7942
8650
|
}
|
|
7943
|
-
|
|
7944
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/index.js
|
|
8651
|
+
// ../../node_modules/.pnpm/mdast-util-to-markdown@2.1.0/node_modules/mdast-util-to-markdown/lib/index.js
|
|
7945
8652
|
/**
|
|
7946
8653
|
* @typedef {import('mdast').Nodes} Nodes
|
|
7947
8654
|
* @typedef {import('./types.js').Enter} Enter
|
|
@@ -8094,8 +8801,7 @@ function containerFlowBound(parent, info) {
|
|
|
8094
8801
|
function safeBound(value, config) {
|
|
8095
8802
|
return safe(this, value, config);
|
|
8096
8803
|
}
|
|
8097
|
-
|
|
8098
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-table@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-table/lib/index.js
|
|
8804
|
+
// ../../node_modules/.pnpm/mdast-util-gfm-table@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-table/lib/index.js
|
|
8099
8805
|
/**
|
|
8100
8806
|
* @typedef {import('mdast').InlineCode} InlineCode
|
|
8101
8807
|
* @typedef {import('mdast').Table} Table
|
|
@@ -8358,8 +9064,7 @@ function gfmTableToMarkdown(options) {
|
|
|
8358
9064
|
return value;
|
|
8359
9065
|
}
|
|
8360
9066
|
}
|
|
8361
|
-
|
|
8362
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-task-list-item/lib/index.js
|
|
9067
|
+
// ../../node_modules/.pnpm/mdast-util-gfm-task-list-item@2.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm-task-list-item/lib/index.js
|
|
8363
9068
|
/**
|
|
8364
9069
|
* @typedef {import('mdast').ListItem} ListItem
|
|
8365
9070
|
* @typedef {import('mdast').Paragraph} Paragraph
|
|
@@ -8468,8 +9173,7 @@ function listItemWithTaskListItem(node, parent, state, info) {
|
|
|
8468
9173
|
return $0 + checkbox;
|
|
8469
9174
|
}
|
|
8470
9175
|
}
|
|
8471
|
-
|
|
8472
|
-
//#region ../../node_modules/.pnpm/mdast-util-gfm@3.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm/lib/index.js
|
|
9176
|
+
// ../../node_modules/.pnpm/mdast-util-gfm@3.0.0_supports-color@10.2.2/node_modules/mdast-util-gfm/lib/index.js
|
|
8473
9177
|
/**
|
|
8474
9178
|
* @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
|
|
8475
9179
|
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
|
|
@@ -8514,8 +9218,7 @@ function gfmToMarkdown(options) {
|
|
|
8514
9218
|
gfmTaskListItemToMarkdown()
|
|
8515
9219
|
] };
|
|
8516
9220
|
}
|
|
8517
|
-
|
|
8518
|
-
//#region ../../node_modules/.pnpm/micromark-util-chunked@2.0.0/node_modules/micromark-util-chunked/index.js
|
|
9221
|
+
// ../../node_modules/.pnpm/micromark-util-chunked@2.0.0/node_modules/micromark-util-chunked/index.js
|
|
8519
9222
|
/**
|
|
8520
9223
|
* Like `Array#splice`, but smarter for giant arrays.
|
|
8521
9224
|
*
|
|
@@ -8584,8 +9287,7 @@ function push(list, items) {
|
|
|
8584
9287
|
}
|
|
8585
9288
|
return items;
|
|
8586
9289
|
}
|
|
8587
|
-
|
|
8588
|
-
//#region ../../node_modules/.pnpm/micromark-util-combine-extensions@2.0.0/node_modules/micromark-util-combine-extensions/index.js
|
|
9290
|
+
// ../../node_modules/.pnpm/micromark-util-combine-extensions@2.0.0/node_modules/micromark-util-combine-extensions/index.js
|
|
8589
9291
|
/**
|
|
8590
9292
|
* @typedef {import('micromark-util-types').Extension} Extension
|
|
8591
9293
|
* @typedef {import('micromark-util-types').Handles} Handles
|
|
@@ -8649,8 +9351,7 @@ function constructs(existing, list) {
|
|
|
8649
9351
|
while (++index < list.length) (list[index].add === "after" ? existing : before).push(list[index]);
|
|
8650
9352
|
splice(existing, 0, 0, before);
|
|
8651
9353
|
}
|
|
8652
|
-
|
|
8653
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.0.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
9354
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.0.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
8654
9355
|
/**
|
|
8655
9356
|
* @typedef {import('micromark-util-types').Code} Code
|
|
8656
9357
|
* @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord
|
|
@@ -9354,8 +10055,7 @@ function previousUnbalanced(events) {
|
|
|
9354
10055
|
if (events.length > 0 && !result) events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;
|
|
9355
10056
|
return result;
|
|
9356
10057
|
}
|
|
9357
|
-
|
|
9358
|
-
//#region ../../node_modules/.pnpm/micromark-util-sanitize-uri@2.0.0/node_modules/micromark-util-sanitize-uri/index.js
|
|
10058
|
+
// ../../node_modules/.pnpm/micromark-util-sanitize-uri@2.0.0/node_modules/micromark-util-sanitize-uri/index.js
|
|
9359
10059
|
/**
|
|
9360
10060
|
* Normalize a URL.
|
|
9361
10061
|
*
|
|
@@ -9399,8 +10099,7 @@ function normalizeUri(value) {
|
|
|
9399
10099
|
}
|
|
9400
10100
|
return result.join("") + value.slice(start);
|
|
9401
10101
|
}
|
|
9402
|
-
|
|
9403
|
-
//#region ../../node_modules/.pnpm/micromark-util-classify-character@2.0.0/node_modules/micromark-util-classify-character/index.js
|
|
10102
|
+
// ../../node_modules/.pnpm/micromark-util-classify-character@2.0.0/node_modules/micromark-util-classify-character/index.js
|
|
9404
10103
|
/**
|
|
9405
10104
|
* @typedef {import('micromark-util-types').Code} Code
|
|
9406
10105
|
*/
|
|
@@ -9422,8 +10121,7 @@ function classifyCharacter(code) {
|
|
|
9422
10121
|
if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return 1;
|
|
9423
10122
|
if (unicodePunctuation(code)) return 2;
|
|
9424
10123
|
}
|
|
9425
|
-
|
|
9426
|
-
//#region ../../node_modules/.pnpm/micromark-util-resolve-all@2.0.0/node_modules/micromark-util-resolve-all/index.js
|
|
10124
|
+
// ../../node_modules/.pnpm/micromark-util-resolve-all@2.0.0/node_modules/micromark-util-resolve-all/index.js
|
|
9427
10125
|
/**
|
|
9428
10126
|
* @typedef {import('micromark-util-types').Event} Event
|
|
9429
10127
|
* @typedef {import('micromark-util-types').Resolver} Resolver
|
|
@@ -9454,8 +10152,7 @@ function resolveAll(constructs, events, context) {
|
|
|
9454
10152
|
}
|
|
9455
10153
|
return events;
|
|
9456
10154
|
}
|
|
9457
|
-
|
|
9458
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/attention.js
|
|
10155
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/attention.js
|
|
9459
10156
|
/**
|
|
9460
10157
|
* @typedef {import('micromark-util-types').Code} Code
|
|
9461
10158
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -9668,8 +10365,7 @@ function movePoint(point, offset) {
|
|
|
9668
10365
|
point.offset += offset;
|
|
9669
10366
|
point._bufferIndex += offset;
|
|
9670
10367
|
}
|
|
9671
|
-
|
|
9672
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/autolink.js
|
|
10368
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/autolink.js
|
|
9673
10369
|
/**
|
|
9674
10370
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
9675
10371
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -9876,8 +10572,7 @@ function tokenizeAutolink(effects, ok, nok) {
|
|
|
9876
10572
|
return nok(code);
|
|
9877
10573
|
}
|
|
9878
10574
|
}
|
|
9879
|
-
|
|
9880
|
-
//#region ../../node_modules/.pnpm/micromark-factory-space@2.0.0/node_modules/micromark-factory-space/index.js
|
|
10575
|
+
// ../../node_modules/.pnpm/micromark-factory-space@2.0.0/node_modules/micromark-factory-space/index.js
|
|
9881
10576
|
/**
|
|
9882
10577
|
* @typedef {import('micromark-util-types').Effects} Effects
|
|
9883
10578
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -9937,8 +10632,7 @@ function factorySpace(effects, ok, type, max) {
|
|
|
9937
10632
|
return ok(code);
|
|
9938
10633
|
}
|
|
9939
10634
|
}
|
|
9940
|
-
|
|
9941
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
10635
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
9942
10636
|
/**
|
|
9943
10637
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
9944
10638
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -9991,8 +10685,7 @@ function tokenizeBlankLine(effects, ok, nok) {
|
|
|
9991
10685
|
return code === null || markdownLineEnding(code) ? ok(code) : nok(code);
|
|
9992
10686
|
}
|
|
9993
10687
|
}
|
|
9994
|
-
|
|
9995
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/block-quote.js
|
|
10688
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/block-quote.js
|
|
9996
10689
|
/**
|
|
9997
10690
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
9998
10691
|
* @typedef {import('micromark-util-types').Exiter} Exiter
|
|
@@ -10114,8 +10807,7 @@ function tokenizeBlockQuoteContinuation(effects, ok, nok) {
|
|
|
10114
10807
|
function exit(effects) {
|
|
10115
10808
|
effects.exit("blockQuote");
|
|
10116
10809
|
}
|
|
10117
|
-
|
|
10118
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/character-escape.js
|
|
10810
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/character-escape.js
|
|
10119
10811
|
/**
|
|
10120
10812
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
10121
10813
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -10171,8 +10863,7 @@ function tokenizeCharacterEscape(effects, ok, nok) {
|
|
|
10171
10863
|
return nok(code);
|
|
10172
10864
|
}
|
|
10173
10865
|
}
|
|
10174
|
-
|
|
10175
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/character-reference.js
|
|
10866
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/character-reference.js
|
|
10176
10867
|
/**
|
|
10177
10868
|
* @typedef {import('micromark-util-types').Code} Code
|
|
10178
10869
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -10306,8 +10997,7 @@ function tokenizeCharacterReference(effects, ok, nok) {
|
|
|
10306
10997
|
return nok(code);
|
|
10307
10998
|
}
|
|
10308
10999
|
}
|
|
10309
|
-
|
|
10310
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/code-fenced.js
|
|
11000
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/code-fenced.js
|
|
10311
11001
|
/**
|
|
10312
11002
|
* @typedef {import('micromark-util-types').Code} Code
|
|
10313
11003
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -10716,8 +11406,7 @@ function tokenizeNonLazyContinuation(effects, ok, nok) {
|
|
|
10716
11406
|
return self.parser.lazy[self.now().line] ? nok(code) : ok(code);
|
|
10717
11407
|
}
|
|
10718
11408
|
}
|
|
10719
|
-
|
|
10720
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/code-indented.js
|
|
11409
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/code-indented.js
|
|
10721
11410
|
/**
|
|
10722
11411
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
10723
11412
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -10856,8 +11545,7 @@ function tokenizeFurtherStart(effects, ok, nok) {
|
|
|
10856
11545
|
return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? furtherStart(code) : nok(code);
|
|
10857
11546
|
}
|
|
10858
11547
|
}
|
|
10859
|
-
|
|
10860
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/code-text.js
|
|
11548
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/code-text.js
|
|
10861
11549
|
/**
|
|
10862
11550
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
10863
11551
|
* @typedef {import('micromark-util-types').Previous} Previous
|
|
@@ -11037,8 +11725,7 @@ function tokenizeCodeText(effects, ok, nok) {
|
|
|
11037
11725
|
return data(code);
|
|
11038
11726
|
}
|
|
11039
11727
|
}
|
|
11040
|
-
|
|
11041
|
-
//#region ../../node_modules/.pnpm/micromark-util-subtokenize@2.0.1/node_modules/micromark-util-subtokenize/lib/splice-buffer.js
|
|
11728
|
+
// ../../node_modules/.pnpm/micromark-util-subtokenize@2.0.1/node_modules/micromark-util-subtokenize/lib/splice-buffer.js
|
|
11042
11729
|
/**
|
|
11043
11730
|
* Some of the internal operations of micromark do lots of editing
|
|
11044
11731
|
* operations on very large arrays. This runs into problems with two
|
|
@@ -11267,8 +11954,7 @@ function chunkedPush(list, right) {
|
|
|
11267
11954
|
chunkStart += 1e4;
|
|
11268
11955
|
}
|
|
11269
11956
|
}
|
|
11270
|
-
|
|
11271
|
-
//#region ../../node_modules/.pnpm/micromark-util-subtokenize@2.0.1/node_modules/micromark-util-subtokenize/index.js
|
|
11957
|
+
// ../../node_modules/.pnpm/micromark-util-subtokenize@2.0.1/node_modules/micromark-util-subtokenize/index.js
|
|
11272
11958
|
/**
|
|
11273
11959
|
* @typedef {import('micromark-util-types').Chunk} Chunk
|
|
11274
11960
|
* @typedef {import('micromark-util-types').Event} Event
|
|
@@ -11417,8 +12103,7 @@ function subcontent(events, eventIndex) {
|
|
|
11417
12103
|
}
|
|
11418
12104
|
return gaps;
|
|
11419
12105
|
}
|
|
11420
|
-
|
|
11421
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/content.js
|
|
12106
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/content.js
|
|
11422
12107
|
/**
|
|
11423
12108
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
11424
12109
|
* @typedef {import('micromark-util-types').Resolver} Resolver
|
|
@@ -11546,8 +12231,7 @@ function tokenizeContinuation(effects, ok, nok) {
|
|
|
11546
12231
|
return effects.interrupt(self.parser.constructs.flow, nok, ok)(code);
|
|
11547
12232
|
}
|
|
11548
12233
|
}
|
|
11549
|
-
|
|
11550
|
-
//#region ../../node_modules/.pnpm/micromark-factory-destination@2.0.0/node_modules/micromark-factory-destination/index.js
|
|
12234
|
+
// ../../node_modules/.pnpm/micromark-factory-destination@2.0.0/node_modules/micromark-factory-destination/index.js
|
|
11551
12235
|
/**
|
|
11552
12236
|
* @typedef {import('micromark-util-types').Effects} Effects
|
|
11553
12237
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -11731,8 +12415,7 @@ function tokenizeContinuation(effects, ok, nok) {
|
|
|
11731
12415
|
return raw(code);
|
|
11732
12416
|
}
|
|
11733
12417
|
}
|
|
11734
|
-
|
|
11735
|
-
//#region ../../node_modules/.pnpm/micromark-factory-label@2.0.0/node_modules/micromark-factory-label/index.js
|
|
12418
|
+
// ../../node_modules/.pnpm/micromark-factory-label@2.0.0/node_modules/micromark-factory-label/index.js
|
|
11736
12419
|
/**
|
|
11737
12420
|
* @typedef {import('micromark-util-types').Effects} Effects
|
|
11738
12421
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -11860,8 +12543,7 @@ function tokenizeContinuation(effects, ok, nok) {
|
|
|
11860
12543
|
return labelInside(code);
|
|
11861
12544
|
}
|
|
11862
12545
|
}
|
|
11863
|
-
|
|
11864
|
-
//#region ../../node_modules/.pnpm/micromark-factory-title@2.0.0/node_modules/micromark-factory-title/index.js
|
|
12546
|
+
// ../../node_modules/.pnpm/micromark-factory-title@2.0.0/node_modules/micromark-factory-title/index.js
|
|
11865
12547
|
/**
|
|
11866
12548
|
* @typedef {import('micromark-util-types').Code} Code
|
|
11867
12549
|
* @typedef {import('micromark-util-types').Effects} Effects
|
|
@@ -12002,8 +12684,7 @@ function tokenizeContinuation(effects, ok, nok) {
|
|
|
12002
12684
|
return inside(code);
|
|
12003
12685
|
}
|
|
12004
12686
|
}
|
|
12005
|
-
|
|
12006
|
-
//#region ../../node_modules/.pnpm/micromark-factory-whitespace@2.0.0/node_modules/micromark-factory-whitespace/index.js
|
|
12687
|
+
// ../../node_modules/.pnpm/micromark-factory-whitespace@2.0.0/node_modules/micromark-factory-whitespace/index.js
|
|
12007
12688
|
/**
|
|
12008
12689
|
* @typedef {import('micromark-util-types').Effects} Effects
|
|
12009
12690
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -12043,8 +12724,7 @@ function factoryWhitespace(effects, ok) {
|
|
|
12043
12724
|
return ok(code);
|
|
12044
12725
|
}
|
|
12045
12726
|
}
|
|
12046
|
-
|
|
12047
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/definition.js
|
|
12727
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/definition.js
|
|
12048
12728
|
/**
|
|
12049
12729
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
12050
12730
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -12254,8 +12934,7 @@ function tokenizeTitleBefore(effects, ok, nok) {
|
|
|
12254
12934
|
return code === null || markdownLineEnding(code) ? ok(code) : nok(code);
|
|
12255
12935
|
}
|
|
12256
12936
|
}
|
|
12257
|
-
|
|
12258
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/hard-break-escape.js
|
|
12937
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/hard-break-escape.js
|
|
12259
12938
|
/**
|
|
12260
12939
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
12261
12940
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -12308,8 +12987,7 @@ function tokenizeHardBreakEscape(effects, ok, nok) {
|
|
|
12308
12987
|
return nok(code);
|
|
12309
12988
|
}
|
|
12310
12989
|
}
|
|
12311
|
-
|
|
12312
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/heading-atx.js
|
|
12990
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/heading-atx.js
|
|
12313
12991
|
/**
|
|
12314
12992
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
12315
12993
|
* @typedef {import('micromark-util-types').Resolver} Resolver
|
|
@@ -12490,8 +13168,7 @@ function tokenizeHeadingAtx(effects, ok, nok) {
|
|
|
12490
13168
|
return data;
|
|
12491
13169
|
}
|
|
12492
13170
|
}
|
|
12493
|
-
|
|
12494
|
-
//#region ../../node_modules/.pnpm/micromark-util-html-tag-name@2.0.0/node_modules/micromark-util-html-tag-name/index.js
|
|
13171
|
+
// ../../node_modules/.pnpm/micromark-util-html-tag-name@2.0.0/node_modules/micromark-util-html-tag-name/index.js
|
|
12495
13172
|
/**
|
|
12496
13173
|
* List of lowercase HTML “block” tag names.
|
|
12497
13174
|
*
|
|
@@ -12589,8 +13266,7 @@ var htmlRawNames = [
|
|
|
12589
13266
|
"style",
|
|
12590
13267
|
"textarea"
|
|
12591
13268
|
];
|
|
12592
|
-
|
|
12593
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
13269
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
12594
13270
|
/**
|
|
12595
13271
|
* @typedef {import('micromark-util-types').Code} Code
|
|
12596
13272
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -13357,8 +14033,7 @@ function tokenizeBlankLineBefore(effects, ok, nok) {
|
|
|
13357
14033
|
return effects.attempt(blankLine, ok, nok);
|
|
13358
14034
|
}
|
|
13359
14035
|
}
|
|
13360
|
-
|
|
13361
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/html-text.js
|
|
14036
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/html-text.js
|
|
13362
14037
|
/**
|
|
13363
14038
|
* @typedef {import('micromark-util-types').Code} Code
|
|
13364
14039
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -13968,8 +14643,7 @@ function tokenizeHtmlText(effects, ok, nok) {
|
|
|
13968
14643
|
return returnState(code);
|
|
13969
14644
|
}
|
|
13970
14645
|
}
|
|
13971
|
-
|
|
13972
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/label-end.js
|
|
14646
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/label-end.js
|
|
13973
14647
|
/**
|
|
13974
14648
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
13975
14649
|
* @typedef {import('micromark-util-types').Event} Event
|
|
@@ -14428,8 +15102,7 @@ function tokenizeReferenceCollapsed(effects, ok, nok) {
|
|
|
14428
15102
|
return nok(code);
|
|
14429
15103
|
}
|
|
14430
15104
|
}
|
|
14431
|
-
|
|
14432
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/label-start-image.js
|
|
15105
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/label-start-image.js
|
|
14433
15106
|
/**
|
|
14434
15107
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
14435
15108
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -14518,8 +15191,7 @@ function tokenizeLabelStartImage(effects, ok, nok) {
|
|
|
14518
15191
|
return code === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code) : ok(code);
|
|
14519
15192
|
}
|
|
14520
15193
|
}
|
|
14521
|
-
|
|
14522
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/label-start-link.js
|
|
15194
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/label-start-link.js
|
|
14523
15195
|
/**
|
|
14524
15196
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
14525
15197
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -14563,8 +15235,7 @@ function tokenizeLabelStartLink(effects, ok, nok) {
|
|
|
14563
15235
|
return code === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code) : ok(code);
|
|
14564
15236
|
}
|
|
14565
15237
|
}
|
|
14566
|
-
|
|
14567
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/line-ending.js
|
|
15238
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/line-ending.js
|
|
14568
15239
|
/**
|
|
14569
15240
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
14570
15241
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -14590,8 +15261,7 @@ function tokenizeLineEnding(effects, ok) {
|
|
|
14590
15261
|
return factorySpace(effects, ok, "linePrefix");
|
|
14591
15262
|
}
|
|
14592
15263
|
}
|
|
14593
|
-
|
|
14594
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/thematic-break.js
|
|
15264
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/thematic-break.js
|
|
14595
15265
|
/**
|
|
14596
15266
|
* @typedef {import('micromark-util-types').Code} Code
|
|
14597
15267
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -14682,8 +15352,7 @@ function tokenizeThematicBreak(effects, ok, nok) {
|
|
|
14682
15352
|
return markdownSpace(code) ? factorySpace(effects, atBreak, "whitespace")(code) : atBreak(code);
|
|
14683
15353
|
}
|
|
14684
15354
|
}
|
|
14685
|
-
|
|
14686
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/list.js
|
|
15355
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/list.js
|
|
14687
15356
|
/**
|
|
14688
15357
|
* @typedef {import('micromark-util-types').Code} Code
|
|
14689
15358
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -14848,8 +15517,7 @@ function tokenizeListItemPrefixWhitespace(effects, ok, nok) {
|
|
|
14848
15517
|
return !markdownSpace(code) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok(code) : nok(code);
|
|
14849
15518
|
}
|
|
14850
15519
|
}
|
|
14851
|
-
|
|
14852
|
-
//#region ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/setext-underline.js
|
|
15520
|
+
// ../../node_modules/.pnpm/micromark-core-commonmark@2.0.1/node_modules/micromark-core-commonmark/lib/setext-underline.js
|
|
14853
15521
|
/**
|
|
14854
15522
|
* @typedef {import('micromark-util-types').Code} Code
|
|
14855
15523
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
@@ -14997,8 +15665,7 @@ function tokenizeSetextUnderline(effects, ok, nok) {
|
|
|
14997
15665
|
return nok(code);
|
|
14998
15666
|
}
|
|
14999
15667
|
}
|
|
15000
|
-
|
|
15001
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm-footnote@2.0.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
15668
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm-footnote@2.0.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
15002
15669
|
/**
|
|
15003
15670
|
* @typedef {import('micromark-util-types').Event} Event
|
|
15004
15671
|
* @typedef {import('micromark-util-types').Exiter} Exiter
|
|
@@ -15418,8 +16085,7 @@ function tokenizeIndent(effects, ok, nok) {
|
|
|
15418
16085
|
return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);
|
|
15419
16086
|
}
|
|
15420
16087
|
}
|
|
15421
|
-
|
|
15422
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.0.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
16088
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.0.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
15423
16089
|
/**
|
|
15424
16090
|
* @typedef {import('micromark-util-types').Event} Event
|
|
15425
16091
|
* @typedef {import('micromark-util-types').Extension} Extension
|
|
@@ -15571,8 +16237,7 @@ function gfmStrikethrough(options) {
|
|
|
15571
16237
|
}
|
|
15572
16238
|
}
|
|
15573
16239
|
}
|
|
15574
|
-
|
|
15575
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm-table@2.0.0/node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
16240
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm-table@2.0.0/node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
15576
16241
|
/**
|
|
15577
16242
|
* @typedef {import('micromark-util-types').Event} Event
|
|
15578
16243
|
*/
|
|
@@ -15663,8 +16328,7 @@ function addImpl(editMap, at, remove, add) {
|
|
|
15663
16328
|
add
|
|
15664
16329
|
]);
|
|
15665
16330
|
}
|
|
15666
|
-
|
|
15667
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm-table@2.0.0/node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
16331
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm-table@2.0.0/node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
15668
16332
|
/**
|
|
15669
16333
|
* @typedef {import('micromark-util-types').Event} Event
|
|
15670
16334
|
*/
|
|
@@ -15701,8 +16365,7 @@ function gfmTableAlign(events, index) {
|
|
|
15701
16365
|
}
|
|
15702
16366
|
return align;
|
|
15703
16367
|
}
|
|
15704
|
-
|
|
15705
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm-table@2.0.0/node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
16368
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm-table@2.0.0/node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
15706
16369
|
/**
|
|
15707
16370
|
* @typedef {import('micromark-util-types').Event} Event
|
|
15708
16371
|
* @typedef {import('micromark-util-types').Extension} Extension
|
|
@@ -16403,8 +17066,7 @@ function getPoint(events, index) {
|
|
|
16403
17066
|
const side = event[0] === "enter" ? "start" : "end";
|
|
16404
17067
|
return event[1][side];
|
|
16405
17068
|
}
|
|
16406
|
-
|
|
16407
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.0.1/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
17069
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.0.1/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
16408
17070
|
/**
|
|
16409
17071
|
* @typedef {import('micromark-util-types').Extension} Extension
|
|
16410
17072
|
* @typedef {import('micromark-util-types').State} State
|
|
@@ -16522,8 +17184,7 @@ function spaceThenNonSpace(effects, ok, nok) {
|
|
|
16522
17184
|
return code === null ? nok(code) : ok(code);
|
|
16523
17185
|
}
|
|
16524
17186
|
}
|
|
16525
|
-
|
|
16526
|
-
//#region ../../node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.js
|
|
17187
|
+
// ../../node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.js
|
|
16527
17188
|
/**
|
|
16528
17189
|
* @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
|
|
16529
17190
|
* @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
|
|
@@ -16550,8 +17211,7 @@ function gfm(options) {
|
|
|
16550
17211
|
gfmTaskListItem()
|
|
16551
17212
|
]);
|
|
16552
17213
|
}
|
|
16553
|
-
|
|
16554
|
-
//#region ../../node_modules/.pnpm/remark-gfm@4.0.1_supports-color@10.2.2/node_modules/remark-gfm/lib/index.js
|
|
17214
|
+
// ../../node_modules/.pnpm/remark-gfm@4.0.1_supports-color@10.2.2/node_modules/remark-gfm/lib/index.js
|
|
16555
17215
|
/**
|
|
16556
17216
|
* @import {Root} from 'mdast'
|
|
16557
17217
|
* @import {Options} from 'remark-gfm'
|
|
@@ -16581,8 +17241,7 @@ function remarkGfm(options) {
|
|
|
16581
17241
|
fromMarkdownExtensions.push(gfmFromMarkdown());
|
|
16582
17242
|
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
16583
17243
|
}
|
|
16584
|
-
|
|
16585
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/content.js
|
|
17244
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/content.js
|
|
16586
17245
|
/**
|
|
16587
17246
|
* @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
|
|
16588
17247
|
* @typedef {import('micromark-util-types').Initializer} Initializer
|
|
@@ -16644,8 +17303,7 @@ function initializeContent(effects) {
|
|
|
16644
17303
|
return data;
|
|
16645
17304
|
}
|
|
16646
17305
|
}
|
|
16647
|
-
|
|
16648
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/document.js
|
|
17306
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/document.js
|
|
16649
17307
|
/**
|
|
16650
17308
|
* @typedef {import('micromark-util-types').Construct} Construct
|
|
16651
17309
|
* @typedef {import('micromark-util-types').ContainerState} ContainerState
|
|
@@ -16848,8 +17506,7 @@ function initializeDocument(effects) {
|
|
|
16848
17506
|
function tokenizeContainer(effects, ok, nok) {
|
|
16849
17507
|
return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
|
|
16850
17508
|
}
|
|
16851
|
-
|
|
16852
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/flow.js
|
|
17509
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/flow.js
|
|
16853
17510
|
/**
|
|
16854
17511
|
* @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
|
|
16855
17512
|
* @typedef {import('micromark-util-types').Initializer} Initializer
|
|
@@ -16891,8 +17548,7 @@ function initializeFlow(effects) {
|
|
|
16891
17548
|
return initial;
|
|
16892
17549
|
}
|
|
16893
17550
|
}
|
|
16894
|
-
|
|
16895
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/text.js
|
|
17551
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/initialize/text.js
|
|
16896
17552
|
/**
|
|
16897
17553
|
* @typedef {import('micromark-util-types').Code} Code
|
|
16898
17554
|
* @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct
|
|
@@ -17058,8 +17714,7 @@ function resolveAllLineSuffixes(events, context) {
|
|
|
17058
17714
|
}
|
|
17059
17715
|
return events;
|
|
17060
17716
|
}
|
|
17061
|
-
|
|
17062
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/create-tokenizer.js
|
|
17717
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/create-tokenizer.js
|
|
17063
17718
|
/**
|
|
17064
17719
|
* @typedef {import('micromark-util-types').Chunk} Chunk
|
|
17065
17720
|
* @typedef {import('micromark-util-types').Code} Code
|
|
@@ -17488,8 +18143,7 @@ function serializeChunks(chunks, expandTabs) {
|
|
|
17488
18143
|
}
|
|
17489
18144
|
return result.join("");
|
|
17490
18145
|
}
|
|
17491
|
-
|
|
17492
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/constructs.js
|
|
18146
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/constructs.js
|
|
17493
18147
|
/**
|
|
17494
18148
|
* @typedef {import('micromark-util-types').Extension} Extension
|
|
17495
18149
|
*/
|
|
@@ -17566,8 +18220,7 @@ var insideSpan = { null: [attention, resolver] };
|
|
|
17566
18220
|
var attentionMarkers = { null: [42, 95] };
|
|
17567
18221
|
/** @satisfies {Extension['disable']} */
|
|
17568
18222
|
var disable = { null: [] };
|
|
17569
|
-
|
|
17570
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/parse.js
|
|
18223
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/parse.js
|
|
17571
18224
|
/**
|
|
17572
18225
|
* @typedef {import('micromark-util-types').Create} Create
|
|
17573
18226
|
* @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension
|
|
@@ -17603,8 +18256,7 @@ function parse(options) {
|
|
|
17603
18256
|
}
|
|
17604
18257
|
}
|
|
17605
18258
|
}
|
|
17606
|
-
|
|
17607
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/postprocess.js
|
|
18259
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/postprocess.js
|
|
17608
18260
|
/**
|
|
17609
18261
|
* @typedef {import('micromark-util-types').Event} Event
|
|
17610
18262
|
*/
|
|
@@ -17616,8 +18268,7 @@ function postprocess(events) {
|
|
|
17616
18268
|
while (!subtokenize(events));
|
|
17617
18269
|
return events;
|
|
17618
18270
|
}
|
|
17619
|
-
|
|
17620
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/preprocess.js
|
|
18271
|
+
// ../../node_modules/.pnpm/micromark@4.0.0_supports-color@10.2.2/node_modules/micromark/lib/preprocess.js
|
|
17621
18272
|
/**
|
|
17622
18273
|
* @typedef {import('micromark-util-types').Chunk} Chunk
|
|
17623
18274
|
* @typedef {import('micromark-util-types').Code} Code
|
|
@@ -17714,8 +18365,7 @@ function preprocess() {
|
|
|
17714
18365
|
return chunks;
|
|
17715
18366
|
}
|
|
17716
18367
|
}
|
|
17717
|
-
|
|
17718
|
-
//#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.1_supports-color@10.2.2/node_modules/mdast-util-from-markdown/lib/index.js
|
|
18368
|
+
// ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.1_supports-color@10.2.2/node_modules/mdast-util-from-markdown/lib/index.js
|
|
17719
18369
|
/**
|
|
17720
18370
|
* @typedef {import('mdast').Break} Break
|
|
17721
18371
|
* @typedef {import('mdast').Blockquote} Blockquote
|
|
@@ -18793,8 +19443,7 @@ function defaultOnError(left, right) {
|
|
|
18793
19443
|
end: right.end
|
|
18794
19444
|
}) + ") is still open");
|
|
18795
19445
|
}
|
|
18796
|
-
|
|
18797
|
-
//#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@10.2.2/node_modules/remark-parse/lib/index.js
|
|
19446
|
+
// ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@10.2.2/node_modules/remark-parse/lib/index.js
|
|
18798
19447
|
/**
|
|
18799
19448
|
* @typedef {import('mdast').Root} Root
|
|
18800
19449
|
* @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions
|
|
@@ -18828,8 +19477,7 @@ function remarkParse(options) {
|
|
|
18828
19477
|
});
|
|
18829
19478
|
}
|
|
18830
19479
|
}
|
|
18831
|
-
|
|
18832
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js
|
|
19480
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js
|
|
18833
19481
|
/**
|
|
18834
19482
|
* @import {Element} from 'hast'
|
|
18835
19483
|
* @import {Blockquote} from 'mdast'
|
|
@@ -18856,8 +19504,7 @@ function blockquote(state, node) {
|
|
|
18856
19504
|
state.patch(node, result);
|
|
18857
19505
|
return state.applyData(node, result);
|
|
18858
19506
|
}
|
|
18859
|
-
|
|
18860
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/break.js
|
|
19507
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/break.js
|
|
18861
19508
|
/**
|
|
18862
19509
|
* @import {Element, Text} from 'hast'
|
|
18863
19510
|
* @import {Break} from 'mdast'
|
|
@@ -18887,8 +19534,7 @@ function hardBreak(state, node) {
|
|
|
18887
19534
|
value: "\n"
|
|
18888
19535
|
}];
|
|
18889
19536
|
}
|
|
18890
|
-
|
|
18891
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/code.js
|
|
19537
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/code.js
|
|
18892
19538
|
/**
|
|
18893
19539
|
* @import {Element, Properties} from 'hast'
|
|
18894
19540
|
* @import {Code} from 'mdast'
|
|
@@ -18932,8 +19578,7 @@ function code(state, node) {
|
|
|
18932
19578
|
state.patch(node, result);
|
|
18933
19579
|
return result;
|
|
18934
19580
|
}
|
|
18935
|
-
|
|
18936
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/delete.js
|
|
19581
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/delete.js
|
|
18937
19582
|
/**
|
|
18938
19583
|
* @import {Element} from 'hast'
|
|
18939
19584
|
* @import {Delete} from 'mdast'
|
|
@@ -18960,8 +19605,7 @@ function strikethrough(state, node) {
|
|
|
18960
19605
|
state.patch(node, result);
|
|
18961
19606
|
return state.applyData(node, result);
|
|
18962
19607
|
}
|
|
18963
|
-
|
|
18964
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js
|
|
19608
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js
|
|
18965
19609
|
/**
|
|
18966
19610
|
* @import {Element} from 'hast'
|
|
18967
19611
|
* @import {Emphasis} from 'mdast'
|
|
@@ -18988,8 +19632,7 @@ function emphasis(state, node) {
|
|
|
18988
19632
|
state.patch(node, result);
|
|
18989
19633
|
return state.applyData(node, result);
|
|
18990
19634
|
}
|
|
18991
|
-
|
|
18992
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js
|
|
19635
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js
|
|
18993
19636
|
/**
|
|
18994
19637
|
* @import {Element} from 'hast'
|
|
18995
19638
|
* @import {FootnoteReference} from 'mdast'
|
|
@@ -19046,8 +19689,7 @@ function footnoteReference(state, node) {
|
|
|
19046
19689
|
state.patch(node, sup);
|
|
19047
19690
|
return state.applyData(node, sup);
|
|
19048
19691
|
}
|
|
19049
|
-
|
|
19050
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/heading.js
|
|
19692
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/heading.js
|
|
19051
19693
|
/**
|
|
19052
19694
|
* @import {Element} from 'hast'
|
|
19053
19695
|
* @import {Heading} from 'mdast'
|
|
@@ -19074,8 +19716,7 @@ function heading(state, node) {
|
|
|
19074
19716
|
state.patch(node, result);
|
|
19075
19717
|
return state.applyData(node, result);
|
|
19076
19718
|
}
|
|
19077
|
-
|
|
19078
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/html.js
|
|
19719
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/html.js
|
|
19079
19720
|
/**
|
|
19080
19721
|
* @import {Element} from 'hast'
|
|
19081
19722
|
* @import {Html} from 'mdast'
|
|
@@ -19104,8 +19745,7 @@ function html(state, node) {
|
|
|
19104
19745
|
return state.applyData(node, result);
|
|
19105
19746
|
}
|
|
19106
19747
|
}
|
|
19107
|
-
|
|
19108
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/revert.js
|
|
19748
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/revert.js
|
|
19109
19749
|
/**
|
|
19110
19750
|
* @import {ElementContent} from 'hast'
|
|
19111
19751
|
* @import {Reference, Nodes} from 'mdast'
|
|
@@ -19145,8 +19785,7 @@ function revert(state, node) {
|
|
|
19145
19785
|
});
|
|
19146
19786
|
return contents;
|
|
19147
19787
|
}
|
|
19148
|
-
|
|
19149
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js
|
|
19788
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js
|
|
19150
19789
|
/**
|
|
19151
19790
|
* @import {ElementContent, Element, Properties} from 'hast'
|
|
19152
19791
|
* @import {ImageReference} from 'mdast'
|
|
@@ -19182,8 +19821,7 @@ function imageReference(state, node) {
|
|
|
19182
19821
|
state.patch(node, result);
|
|
19183
19822
|
return state.applyData(node, result);
|
|
19184
19823
|
}
|
|
19185
|
-
|
|
19186
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/image.js
|
|
19824
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/image.js
|
|
19187
19825
|
/**
|
|
19188
19826
|
* @import {Element, Properties} from 'hast'
|
|
19189
19827
|
* @import {Image} from 'mdast'
|
|
@@ -19214,8 +19852,7 @@ function image(state, node) {
|
|
|
19214
19852
|
state.patch(node, result);
|
|
19215
19853
|
return state.applyData(node, result);
|
|
19216
19854
|
}
|
|
19217
|
-
|
|
19218
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js
|
|
19855
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js
|
|
19219
19856
|
/**
|
|
19220
19857
|
* @import {Element, Text} from 'hast'
|
|
19221
19858
|
* @import {InlineCode} from 'mdast'
|
|
@@ -19248,8 +19885,7 @@ function inlineCode(state, node) {
|
|
|
19248
19885
|
state.patch(node, result);
|
|
19249
19886
|
return state.applyData(node, result);
|
|
19250
19887
|
}
|
|
19251
|
-
|
|
19252
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js
|
|
19888
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js
|
|
19253
19889
|
/**
|
|
19254
19890
|
* @import {ElementContent, Element, Properties} from 'hast'
|
|
19255
19891
|
* @import {LinkReference} from 'mdast'
|
|
@@ -19282,8 +19918,7 @@ function linkReference(state, node) {
|
|
|
19282
19918
|
state.patch(node, result);
|
|
19283
19919
|
return state.applyData(node, result);
|
|
19284
19920
|
}
|
|
19285
|
-
|
|
19286
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/link.js
|
|
19921
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/link.js
|
|
19287
19922
|
/**
|
|
19288
19923
|
* @import {Element, Properties} from 'hast'
|
|
19289
19924
|
* @import {Link} from 'mdast'
|
|
@@ -19313,8 +19948,7 @@ function link(state, node) {
|
|
|
19313
19948
|
state.patch(node, result);
|
|
19314
19949
|
return state.applyData(node, result);
|
|
19315
19950
|
}
|
|
19316
|
-
|
|
19317
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/list-item.js
|
|
19951
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/list-item.js
|
|
19318
19952
|
/**
|
|
19319
19953
|
* @import {ElementContent, Element, Properties} from 'hast'
|
|
19320
19954
|
* @import {ListItem, Parents} from 'mdast'
|
|
@@ -19416,8 +20050,7 @@ function listItemLoose(node) {
|
|
|
19416
20050
|
const spread = node.spread;
|
|
19417
20051
|
return spread === null || spread === void 0 ? node.children.length > 1 : spread;
|
|
19418
20052
|
}
|
|
19419
|
-
|
|
19420
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/list.js
|
|
20053
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/list.js
|
|
19421
20054
|
/**
|
|
19422
20055
|
* @import {Element, Properties} from 'hast'
|
|
19423
20056
|
* @import {List} from 'mdast'
|
|
@@ -19456,8 +20089,7 @@ function list(state, node) {
|
|
|
19456
20089
|
state.patch(node, result);
|
|
19457
20090
|
return state.applyData(node, result);
|
|
19458
20091
|
}
|
|
19459
|
-
|
|
19460
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js
|
|
20092
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js
|
|
19461
20093
|
/**
|
|
19462
20094
|
* @import {Element} from 'hast'
|
|
19463
20095
|
* @import {Paragraph} from 'mdast'
|
|
@@ -19484,8 +20116,7 @@ function paragraph(state, node) {
|
|
|
19484
20116
|
state.patch(node, result);
|
|
19485
20117
|
return state.applyData(node, result);
|
|
19486
20118
|
}
|
|
19487
|
-
|
|
19488
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/root.js
|
|
20119
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/root.js
|
|
19489
20120
|
/**
|
|
19490
20121
|
* @import {Parents as HastParents, Root as HastRoot} from 'hast'
|
|
19491
20122
|
* @import {Root as MdastRoot} from 'mdast'
|
|
@@ -19510,8 +20141,7 @@ function root(state, node) {
|
|
|
19510
20141
|
state.patch(node, result);
|
|
19511
20142
|
return state.applyData(node, result);
|
|
19512
20143
|
}
|
|
19513
|
-
|
|
19514
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/strong.js
|
|
20144
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/strong.js
|
|
19515
20145
|
/**
|
|
19516
20146
|
* @import {Element} from 'hast'
|
|
19517
20147
|
* @import {Strong} from 'mdast'
|
|
@@ -19538,8 +20168,7 @@ function strong(state, node) {
|
|
|
19538
20168
|
state.patch(node, result);
|
|
19539
20169
|
return state.applyData(node, result);
|
|
19540
20170
|
}
|
|
19541
|
-
|
|
19542
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/table.js
|
|
20171
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/table.js
|
|
19543
20172
|
/**
|
|
19544
20173
|
* @import {Table} from 'mdast'
|
|
19545
20174
|
* @import {Element} from 'hast'
|
|
@@ -19597,8 +20226,7 @@ function table(state, node) {
|
|
|
19597
20226
|
state.patch(node, result);
|
|
19598
20227
|
return state.applyData(node, result);
|
|
19599
20228
|
}
|
|
19600
|
-
|
|
19601
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/table-row.js
|
|
20229
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/table-row.js
|
|
19602
20230
|
/**
|
|
19603
20231
|
* @import {Element, ElementContent, Properties} from 'hast'
|
|
19604
20232
|
* @import {Parents, TableRow} from 'mdast'
|
|
@@ -19654,8 +20282,7 @@ function tableRow(state, node, parent) {
|
|
|
19654
20282
|
state.patch(node, result);
|
|
19655
20283
|
return state.applyData(node, result);
|
|
19656
20284
|
}
|
|
19657
|
-
|
|
19658
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js
|
|
20285
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js
|
|
19659
20286
|
/**
|
|
19660
20287
|
* @import {Element} from 'hast'
|
|
19661
20288
|
* @import {TableCell} from 'mdast'
|
|
@@ -19682,8 +20309,7 @@ function tableCell(state, node) {
|
|
|
19682
20309
|
state.patch(node, result);
|
|
19683
20310
|
return state.applyData(node, result);
|
|
19684
20311
|
}
|
|
19685
|
-
|
|
19686
|
-
//#region ../../node_modules/.pnpm/trim-lines@3.0.1/node_modules/trim-lines/index.js
|
|
20312
|
+
// ../../node_modules/.pnpm/trim-lines@3.0.1/node_modules/trim-lines/index.js
|
|
19687
20313
|
var tab = 9;
|
|
19688
20314
|
var space = 32;
|
|
19689
20315
|
/**
|
|
@@ -19739,8 +20365,7 @@ function trimLine(value, start, end) {
|
|
|
19739
20365
|
}
|
|
19740
20366
|
return endIndex > startIndex ? value.slice(startIndex, endIndex) : "";
|
|
19741
20367
|
}
|
|
19742
|
-
|
|
19743
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/text.js
|
|
20368
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/text.js
|
|
19744
20369
|
/**
|
|
19745
20370
|
* @import {Element as HastElement, Text as HastText} from 'hast'
|
|
19746
20371
|
* @import {Text as MdastText} from 'mdast'
|
|
@@ -19765,8 +20390,7 @@ function text(state, node) {
|
|
|
19765
20390
|
state.patch(node, result);
|
|
19766
20391
|
return state.applyData(node, result);
|
|
19767
20392
|
}
|
|
19768
|
-
|
|
19769
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js
|
|
20393
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js
|
|
19770
20394
|
/**
|
|
19771
20395
|
* @import {Element} from 'hast'
|
|
19772
20396
|
* @import {ThematicBreak} from 'mdast'
|
|
@@ -19793,8 +20417,7 @@ function thematicBreak(state, node) {
|
|
|
19793
20417
|
state.patch(node, result);
|
|
19794
20418
|
return state.applyData(node, result);
|
|
19795
20419
|
}
|
|
19796
|
-
|
|
19797
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/index.js
|
|
20420
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/handlers/index.js
|
|
19798
20421
|
/**
|
|
19799
20422
|
* @import {Handlers} from '../state.js'
|
|
19800
20423
|
*/
|
|
@@ -19833,8 +20456,7 @@ var handlers = {
|
|
|
19833
20456
|
footnoteDefinition: ignore
|
|
19834
20457
|
};
|
|
19835
20458
|
function ignore() {}
|
|
19836
|
-
|
|
19837
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/footer.js
|
|
20459
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/footer.js
|
|
19838
20460
|
/**
|
|
19839
20461
|
* @import {ElementContent, Element} from 'hast'
|
|
19840
20462
|
* @import {State} from './state.js'
|
|
@@ -20047,8 +20669,7 @@ function footer(state) {
|
|
|
20047
20669
|
]
|
|
20048
20670
|
};
|
|
20049
20671
|
}
|
|
20050
|
-
|
|
20051
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/state.js
|
|
20672
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/state.js
|
|
20052
20673
|
/**
|
|
20053
20674
|
* @import {
|
|
20054
20675
|
* ElementContent as HastElementContent,
|
|
@@ -20260,7 +20881,7 @@ function createState(tree, options) {
|
|
|
20260
20881
|
patch,
|
|
20261
20882
|
wrap
|
|
20262
20883
|
};
|
|
20263
|
-
visit(tree, function(node) {
|
|
20884
|
+
visit$1(tree, function(node) {
|
|
20264
20885
|
if (node.type === "definition" || node.type === "footnoteDefinition") {
|
|
20265
20886
|
const map = node.type === "definition" ? definitionById : footnoteById;
|
|
20266
20887
|
const id = String(node.identifier).toUpperCase();
|
|
@@ -20446,8 +21067,7 @@ function trimMarkdownSpaceStart(value) {
|
|
|
20446
21067
|
}
|
|
20447
21068
|
return value.slice(index);
|
|
20448
21069
|
}
|
|
20449
|
-
|
|
20450
|
-
//#region ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/index.js
|
|
21070
|
+
// ../../node_modules/.pnpm/mdast-util-to-hast@13.2.1/node_modules/mdast-util-to-hast/lib/index.js
|
|
20451
21071
|
/**
|
|
20452
21072
|
* @import {Nodes as HastNodes} from 'hast'
|
|
20453
21073
|
* @import {Nodes as MdastNodes} from 'mdast'
|
|
@@ -20551,8 +21171,7 @@ function toHast(tree, options) {
|
|
|
20551
21171
|
}
|
|
20552
21172
|
return result;
|
|
20553
21173
|
}
|
|
20554
|
-
|
|
20555
|
-
//#region ../../node_modules/.pnpm/remark-rehype@11.1.2/node_modules/remark-rehype/lib/index.js
|
|
21174
|
+
// ../../node_modules/.pnpm/remark-rehype@11.1.2/node_modules/remark-rehype/lib/index.js
|
|
20556
21175
|
/**
|
|
20557
21176
|
* @import {Root as HastRoot} from 'hast'
|
|
20558
21177
|
* @import {Root as MdastRoot} from 'mdast'
|
|
@@ -20718,8 +21337,7 @@ function remarkRehype(destination, options) {
|
|
|
20718
21337
|
});
|
|
20719
21338
|
};
|
|
20720
21339
|
}
|
|
20721
|
-
|
|
20722
|
-
//#region ../../node_modules/.pnpm/remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.js
|
|
21340
|
+
// ../../node_modules/.pnpm/remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.js
|
|
20723
21341
|
/**
|
|
20724
21342
|
* @typedef {import('mdast').Root} Root
|
|
20725
21343
|
* @typedef {import('mdast-util-to-markdown').Options} ToMarkdownOptions
|
|
@@ -20752,8 +21370,7 @@ function remarkStringify(options) {
|
|
|
20752
21370
|
});
|
|
20753
21371
|
}
|
|
20754
21372
|
}
|
|
20755
|
-
|
|
20756
|
-
//#region src/markdown/markdown.ts
|
|
21373
|
+
// src/markdown/markdown.ts
|
|
20757
21374
|
/**
|
|
20758
21375
|
* Type-guard to check if a node is a heading.
|
|
20759
21376
|
*/
|
|
@@ -20765,9 +21382,9 @@ var isHeading = (node) => {
|
|
|
20765
21382
|
*/
|
|
20766
21383
|
var transformNodes = (options, ..._ignored) => (tree) => {
|
|
20767
21384
|
if (!options?.transform || !options?.type) return;
|
|
20768
|
-
visit(tree, options?.type, (node) => {
|
|
21385
|
+
visit$1(tree, options?.type, (node) => {
|
|
20769
21386
|
options?.transform && options?.transform(node);
|
|
20770
|
-
return SKIP;
|
|
21387
|
+
return SKIP$1;
|
|
20771
21388
|
});
|
|
20772
21389
|
};
|
|
20773
21390
|
var TAGS_WITH_INLINE_MARKDOWN = /* @__PURE__ */ new Set([
|
|
@@ -20784,7 +21401,7 @@ var MAY_CONTAIN_INLINE_MARKDOWN = /[`*_\[~]/;
|
|
|
20784
21401
|
* Preserve HTML-like text in inline markdown by turning mdast `html` nodes into text nodes.
|
|
20785
21402
|
*/
|
|
20786
21403
|
var preserveHtmlLikeText = () => (tree) => {
|
|
20787
|
-
visit(tree, "html", (node, index, parent) => {
|
|
21404
|
+
visit$1(tree, "html", (node, index, parent) => {
|
|
20788
21405
|
if (typeof index !== "number" || !parent || !("children" in parent) || !Array.isArray(parent.children)) return;
|
|
20789
21406
|
parent.children[index] = {
|
|
20790
21407
|
type: "text",
|
|
@@ -20809,7 +21426,7 @@ var extractInlineChildrenFromMarkdown = (value) => {
|
|
|
20809
21426
|
* Re-parses text nodes in selected HTML tags so inline markdown works in tags like <p>.
|
|
20810
21427
|
*/
|
|
20811
21428
|
var transformInlineMarkdownInHtml = () => (tree) => {
|
|
20812
|
-
visit(tree, "element", (node) => {
|
|
21429
|
+
visit$1(tree, "element", (node) => {
|
|
20813
21430
|
if (!TAGS_WITH_INLINE_MARKDOWN.has(node.tagName)) return;
|
|
20814
21431
|
node.children = node.children.flatMap((child) => {
|
|
20815
21432
|
if (child.type !== "text" || !MAY_CONTAIN_INLINE_MARKDOWN.test(child.value)) return [child];
|
|
@@ -20822,7 +21439,7 @@ var transformInlineMarkdownInHtml = () => (tree) => {
|
|
|
20822
21439
|
* Rewrites raw HTML strings so inline markdown parsing is only applied to raw HTML input.
|
|
20823
21440
|
*/
|
|
20824
21441
|
var transformInlineMarkdownInRawHtml = () => (tree) => {
|
|
20825
|
-
visit(tree, "raw", (node) => {
|
|
21442
|
+
visit$1(tree, "raw", (node) => {
|
|
20826
21443
|
if (typeof node.value !== "string" || !MAY_CONTAIN_INLINE_MARKDOWN.test(node.value)) return;
|
|
20827
21444
|
const htmlFragmentTree = htmlFragmentParser.parse(node.value);
|
|
20828
21445
|
transformInlineMarkdownInHtml()(htmlFragmentTree);
|
|
@@ -20924,7 +21541,7 @@ function getMarkdownAst(markdown) {
|
|
|
20924
21541
|
function getHeadings(markdown, depth = 1) {
|
|
20925
21542
|
const tree = getMarkdownAst(markdown);
|
|
20926
21543
|
const nodes = [];
|
|
20927
|
-
visit(tree, "heading", (node) => {
|
|
21544
|
+
visit$1(tree, "heading", (node) => {
|
|
20928
21545
|
const text = textFromNode(node);
|
|
20929
21546
|
if (text) nodes.push({
|
|
20930
21547
|
depth: node.depth ?? depth,
|
|
@@ -20971,7 +21588,6 @@ function createDocument(nodes) {
|
|
|
20971
21588
|
children: nodes
|
|
20972
21589
|
}).trim();
|
|
20973
21590
|
}
|
|
20974
|
-
//#endregion
|
|
20975
21591
|
export { textFromNode as a, splitContent as i, htmlFromMarkdown as n, isHeading as r, getHeadings as t };
|
|
20976
21592
|
|
|
20977
21593
|
//# sourceMappingURL=markdown.js.map
|