@fruggr/zendesk-mcp-server 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -442,7 +442,7 @@ function members(proto, table) {
|
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
444
|
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
|
|
445
|
-
function own$
|
|
445
|
+
function own$13(inst, key, value, enumerable = true) {
|
|
446
446
|
Object.defineProperty(inst, key, {
|
|
447
447
|
configurable: true,
|
|
448
448
|
writable: true,
|
|
@@ -453,7 +453,7 @@ function own$12(inst, key, value, enumerable = true) {
|
|
|
453
453
|
}
|
|
454
454
|
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
|
|
455
455
|
function hide(inst, key, value) {
|
|
456
|
-
return own$
|
|
456
|
+
return own$13(inst, key, value, false);
|
|
457
457
|
}
|
|
458
458
|
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
459
459
|
function derived(computes, table) {
|
|
@@ -463,10 +463,10 @@ function derived(computes, table) {
|
|
|
463
463
|
configurable: true,
|
|
464
464
|
enumerable: true,
|
|
465
465
|
get() {
|
|
466
|
-
return own$
|
|
466
|
+
return own$13(this, key, compute(this));
|
|
467
467
|
},
|
|
468
468
|
set(value) {
|
|
469
|
-
own$
|
|
469
|
+
own$13(this, key, value);
|
|
470
470
|
}
|
|
471
471
|
});
|
|
472
472
|
}
|
|
@@ -476,10 +476,10 @@ function defineBound(proto, key, fn) {
|
|
|
476
476
|
Object.defineProperty(proto, key, {
|
|
477
477
|
configurable: true,
|
|
478
478
|
get() {
|
|
479
|
-
return this == null ? fn : own$
|
|
479
|
+
return this == null ? fn : own$13(this, key, fn.bind(this));
|
|
480
480
|
},
|
|
481
481
|
set(value) {
|
|
482
|
-
own$
|
|
482
|
+
own$13(this, key, value);
|
|
483
483
|
}
|
|
484
484
|
});
|
|
485
485
|
}
|
|
@@ -1766,7 +1766,7 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
1766
1766
|
return hide(this, "~standard", standardProps(this));
|
|
1767
1767
|
},
|
|
1768
1768
|
set "~standard"(value) {
|
|
1769
|
-
own$
|
|
1769
|
+
own$13(this, "~standard", value);
|
|
1770
1770
|
}
|
|
1771
1771
|
});
|
|
1772
1772
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
@@ -6535,7 +6535,7 @@ const parse$10 = /* @__PURE__ */ _parse(ZodRealError);
|
|
|
6535
6535
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
6536
6536
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
6537
6537
|
const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
6538
|
-
const encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
6538
|
+
const encode$1 = /* @__PURE__ */ _encode(ZodRealError);
|
|
6539
6539
|
const decode$1 = /* @__PURE__ */ _decode(ZodRealError);
|
|
6540
6540
|
const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
6541
6541
|
const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
@@ -6660,7 +6660,7 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
6660
6660
|
});
|
|
6661
6661
|
},
|
|
6662
6662
|
set "~standard"(value) {
|
|
6663
|
-
own$
|
|
6663
|
+
own$13(this, "~standard", value);
|
|
6664
6664
|
},
|
|
6665
6665
|
parse: function _parse(data, params) {
|
|
6666
6666
|
return parse$10(this, data, params, { callee: _parse });
|
|
@@ -6678,7 +6678,7 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
6678
6678
|
return this?.safeParseAsync;
|
|
6679
6679
|
},
|
|
6680
6680
|
set spa(value) {
|
|
6681
|
-
own$
|
|
6681
|
+
own$13(this, "spa", value);
|
|
6682
6682
|
},
|
|
6683
6683
|
validate(data, params) {
|
|
6684
6684
|
return validate(this, data, params);
|
|
@@ -6687,7 +6687,7 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
6687
6687
|
return validateAsync$1(this, data, params);
|
|
6688
6688
|
},
|
|
6689
6689
|
encode: function _encode(data, params) {
|
|
6690
|
-
return encode(this, data, params, { callee: _encode });
|
|
6690
|
+
return encode$1(this, data, params, { callee: _encode });
|
|
6691
6691
|
},
|
|
6692
6692
|
decode: function _decode(data, params) {
|
|
6693
6693
|
return decode$1(this, data, params, { callee: _decode });
|
|
@@ -26436,7 +26436,7 @@ const singleTag = /* @__PURE__ */ new Set([
|
|
|
26436
26436
|
* @param node Node to be rendered.
|
|
26437
26437
|
* @param options Changes serialization behavior
|
|
26438
26438
|
*/
|
|
26439
|
-
function render$
|
|
26439
|
+
function render$2(node, options = {}) {
|
|
26440
26440
|
const nodes = "length" in node ? node : [node];
|
|
26441
26441
|
let output = "";
|
|
26442
26442
|
for (let i = 0; i < nodes.length; i++) output += renderNode(nodes[i], options);
|
|
@@ -26444,7 +26444,7 @@ function render$1(node, options = {}) {
|
|
|
26444
26444
|
}
|
|
26445
26445
|
function renderNode(node, options) {
|
|
26446
26446
|
switch (node.type) {
|
|
26447
|
-
case Root: return render$
|
|
26447
|
+
case Root: return render$2(node.children, options);
|
|
26448
26448
|
case Doctype:
|
|
26449
26449
|
case Directive: return renderDirective(node);
|
|
26450
26450
|
case Comment$1: return renderComment(node);
|
|
@@ -26488,7 +26488,7 @@ function renderTag(elem, opts) {
|
|
|
26488
26488
|
tag += "/>";
|
|
26489
26489
|
} else {
|
|
26490
26490
|
tag += ">";
|
|
26491
|
-
if (elem.children.length > 0) tag += render$
|
|
26491
|
+
if (elem.children.length > 0) tag += render$2(elem.children, opts);
|
|
26492
26492
|
if (opts.xmlMode || !singleTag.has(elem.name)) tag += `</${elem.name}>`;
|
|
26493
26493
|
}
|
|
26494
26494
|
return tag;
|
|
@@ -26518,7 +26518,7 @@ function renderComment(elem) {
|
|
|
26518
26518
|
* @returns `node`'s outer HTML.
|
|
26519
26519
|
*/
|
|
26520
26520
|
function getOuterHTML(node, options) {
|
|
26521
|
-
return render$
|
|
26521
|
+
return render$2(node, options);
|
|
26522
26522
|
}
|
|
26523
26523
|
/**
|
|
26524
26524
|
* @category Stringify
|
|
@@ -27391,7 +27391,7 @@ var static_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
27391
27391
|
* @param options - Options for rendering.
|
|
27392
27392
|
* @returns The rendered document.
|
|
27393
27393
|
*/
|
|
27394
|
-
function render(that, dom, options) {
|
|
27394
|
+
function render$1(that, dom, options) {
|
|
27395
27395
|
if (!that) return "";
|
|
27396
27396
|
return that(dom !== null && dom !== void 0 ? dom : that._root.children, null, void 0, options).toString();
|
|
27397
27397
|
}
|
|
@@ -27411,7 +27411,7 @@ function html$7(dom, options) {
|
|
|
27411
27411
|
...this === null || this === void 0 ? void 0 : this._options,
|
|
27412
27412
|
...flattenOptions(options)
|
|
27413
27413
|
};
|
|
27414
|
-
return render(this, toRender, opts);
|
|
27414
|
+
return render$1(this, toRender, opts);
|
|
27415
27415
|
}
|
|
27416
27416
|
/**
|
|
27417
27417
|
* Render the document as XML.
|
|
@@ -27425,7 +27425,7 @@ function xml$1(dom) {
|
|
|
27425
27425
|
...this._options,
|
|
27426
27426
|
xmlMode: true
|
|
27427
27427
|
};
|
|
27428
|
-
return render(this, dom, options);
|
|
27428
|
+
return render$1(this, dom, options);
|
|
27429
27429
|
}
|
|
27430
27430
|
/**
|
|
27431
27431
|
* Render the document as text.
|
|
@@ -32809,7 +32809,7 @@ function parse$5(styles) {
|
|
|
32809
32809
|
//#endregion
|
|
32810
32810
|
//#region node_modules/.pnpm/cheerio@1.2.0/node_modules/cheerio/dist/esm/api/forms.js
|
|
32811
32811
|
var forms_exports = /* @__PURE__ */ __exportAll$1({
|
|
32812
|
-
serialize: () => serialize$
|
|
32812
|
+
serialize: () => serialize$3,
|
|
32813
32813
|
serializeArray: () => serializeArray
|
|
32814
32814
|
});
|
|
32815
32815
|
const submittableSelector = "input,select,textarea,keygen";
|
|
@@ -32829,7 +32829,7 @@ const rCRLF = /\r?\n/g;
|
|
|
32829
32829
|
* @returns The serialized form.
|
|
32830
32830
|
* @see {@link https://api.jquery.com/serialize/}
|
|
32831
32831
|
*/
|
|
32832
|
-
function serialize$
|
|
32832
|
+
function serialize$3() {
|
|
32833
32833
|
return this.serializeArray().map((data) => `${encodeURIComponent(data.name)}=${encodeURIComponent(data.value)}`).join("&").replace(r20, "+");
|
|
32834
32834
|
}
|
|
32835
32835
|
/**
|
|
@@ -40110,7 +40110,7 @@ function renderWithParse5(dom) {
|
|
|
40110
40110
|
* @returns The loaded document.
|
|
40111
40111
|
* @see {@link https://cheerio.js.org/docs/basics/loading#load} for additional usage information.
|
|
40112
40112
|
*/
|
|
40113
|
-
const load = getLoad(getParse((content, options, isDocument, context) => options._useHtmlParser2 ? parseDocument(content, options) : parseWithParse5(content, options, isDocument, context)), (dom, options) => options._useHtmlParser2 ? render$
|
|
40113
|
+
const load = getLoad(getParse((content, options, isDocument, context) => options._useHtmlParser2 ? parseDocument(content, options) : parseWithParse5(content, options, isDocument, context)), (dom, options) => options._useHtmlParser2 ? render$2(dom, options) : renderWithParse5(dom));
|
|
40114
40114
|
//#endregion
|
|
40115
40115
|
//#region node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js
|
|
40116
40116
|
var require_safer = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
@@ -73551,7 +73551,7 @@ const svg = merge([
|
|
|
73551
73551
|
* @property {Handlers} [handlers]
|
|
73552
73552
|
* Handlers to use.
|
|
73553
73553
|
*/
|
|
73554
|
-
const own$
|
|
73554
|
+
const own$12 = {}.hasOwnProperty;
|
|
73555
73555
|
/**
|
|
73556
73556
|
* Handle values based on a field.
|
|
73557
73557
|
*
|
|
@@ -73598,9 +73598,9 @@ function zwitch(key, options) {
|
|
|
73598
73598
|
/** @type {Handler|undefined} */
|
|
73599
73599
|
let fn = one.invalid;
|
|
73600
73600
|
const handlers = one.handlers;
|
|
73601
|
-
if (value && own$
|
|
73601
|
+
if (value && own$12.call(value, key)) {
|
|
73602
73602
|
const id = String(value[key]);
|
|
73603
|
-
fn = own$
|
|
73603
|
+
fn = own$12.call(handlers, id) ? handlers[id] : one.unknown;
|
|
73604
73604
|
}
|
|
73605
73605
|
if (fn) return fn.call(this, value, ...parameters);
|
|
73606
73606
|
}
|
|
@@ -74112,7 +74112,7 @@ const dangerous = [
|
|
|
74112
74112
|
];
|
|
74113
74113
|
//#endregion
|
|
74114
74114
|
//#region node_modules/.pnpm/stringify-entities@4.0.4/node_modules/stringify-entities/lib/util/to-named.js
|
|
74115
|
-
const own$
|
|
74115
|
+
const own$11 = {}.hasOwnProperty;
|
|
74116
74116
|
/**
|
|
74117
74117
|
* `characterEntitiesHtml4` but inverted.
|
|
74118
74118
|
*
|
|
@@ -74121,7 +74121,7 @@ const own$10 = {}.hasOwnProperty;
|
|
|
74121
74121
|
const characters = {};
|
|
74122
74122
|
/** @type {string} */
|
|
74123
74123
|
let key;
|
|
74124
|
-
for (key in characterEntitiesHtml4) if (own$
|
|
74124
|
+
for (key in characterEntitiesHtml4) if (own$11.call(characterEntitiesHtml4, key)) characters[characterEntitiesHtml4[key]] = key;
|
|
74125
74125
|
const notAlphanumericRegex = /[^\dA-Za-z]/;
|
|
74126
74126
|
/**
|
|
74127
74127
|
* Configurable ways to encode characters as named references.
|
|
@@ -74134,7 +74134,7 @@ const notAlphanumericRegex = /[^\dA-Za-z]/;
|
|
|
74134
74134
|
*/
|
|
74135
74135
|
function toNamed(code, next, omit, attribute) {
|
|
74136
74136
|
const character = String.fromCharCode(code);
|
|
74137
|
-
if (own$
|
|
74137
|
+
if (own$11.call(characters, character)) {
|
|
74138
74138
|
const name = characters[character];
|
|
74139
74139
|
const value = "&" + name;
|
|
74140
74140
|
if (omit && characterEntitiesLegacy.includes(name) && !dangerous.includes(name) && (!attribute || next && next !== 61 && notAlphanumericRegex.test(String.fromCharCode(next)))) return value;
|
|
@@ -74443,7 +74443,7 @@ function siblings(increment) {
|
|
|
74443
74443
|
* Whether to omit a tag.
|
|
74444
74444
|
*
|
|
74445
74445
|
*/
|
|
74446
|
-
const own$
|
|
74446
|
+
const own$10 = {}.hasOwnProperty;
|
|
74447
74447
|
/**
|
|
74448
74448
|
* Factory to check if a given node can have a tag omitted.
|
|
74449
74449
|
*
|
|
@@ -74461,7 +74461,7 @@ function omission(handlers) {
|
|
|
74461
74461
|
* @type {OmitHandle}
|
|
74462
74462
|
*/
|
|
74463
74463
|
function omit(node, index, parent) {
|
|
74464
|
-
return own$
|
|
74464
|
+
return own$10.call(handlers, node.tagName) && handlers[node.tagName](node, index, parent);
|
|
74465
74465
|
}
|
|
74466
74466
|
}
|
|
74467
74467
|
//#endregion
|
|
@@ -75792,7 +75792,7 @@ const webNamespaces = {
|
|
|
75792
75792
|
* @property {boolean | undefined} verbose
|
|
75793
75793
|
* Add extra positional info.
|
|
75794
75794
|
*/
|
|
75795
|
-
const own$
|
|
75795
|
+
const own$9 = {}.hasOwnProperty;
|
|
75796
75796
|
/** @type {unknown} */
|
|
75797
75797
|
const proto = Object.prototype;
|
|
75798
75798
|
/**
|
|
@@ -75917,7 +75917,7 @@ function element$3(state, node) {
|
|
|
75917
75917
|
while (++index < node.attrs.length) {
|
|
75918
75918
|
const attribute = node.attrs[index];
|
|
75919
75919
|
const name = (attribute.prefix ? attribute.prefix + ":" : "") + attribute.name;
|
|
75920
|
-
if (!own$
|
|
75920
|
+
if (!own$9.call(proto, name)) properties[name] = attribute.value;
|
|
75921
75921
|
}
|
|
75922
75922
|
const result = (state.schema.space === "svg" ? s : h)(node.tagName, properties, all$6(state, node.childNodes));
|
|
75923
75923
|
patch$3(state, node, result);
|
|
@@ -75980,7 +75980,7 @@ function createLocation(state, node, location) {
|
|
|
75980
75980
|
/** @type {string} */
|
|
75981
75981
|
let key;
|
|
75982
75982
|
if (location.attrs) {
|
|
75983
|
-
for (key in location.attrs) if (own$
|
|
75983
|
+
for (key in location.attrs) if (own$9.call(location.attrs, key)) properties[find(state.schema, key).property] = position$2(location.attrs[key]);
|
|
75984
75984
|
}
|
|
75985
75985
|
location.startTag;
|
|
75986
75986
|
const opening = position$2(location.startTag);
|
|
@@ -77627,7 +77627,7 @@ const serializer = (strict, json, $, _) => {
|
|
|
77627
77627
|
* like JSON stringify would behave. Symbol and Function will be discarded.
|
|
77628
77628
|
* @returns {Record[]}
|
|
77629
77629
|
*/
|
|
77630
|
-
const serialize$
|
|
77630
|
+
const serialize$2 = (value, { json, lossy } = {}) => {
|
|
77631
77631
|
const _ = [];
|
|
77632
77632
|
return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
|
|
77633
77633
|
};
|
|
@@ -77646,7 +77646,7 @@ const serialize$1 = (value, { json, lossy } = {}) => {
|
|
|
77646
77646
|
*/
|
|
77647
77647
|
var esm_default = typeof structuredClone === "function" ?
|
|
77648
77648
|
/* c8 ignore start */
|
|
77649
|
-
(any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize$
|
|
77649
|
+
(any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize$2(any, options)) : structuredClone(any) : (any, options) => deserialize(serialize$2(any, options));
|
|
77650
77650
|
//#endregion
|
|
77651
77651
|
//#region node_modules/.pnpm/hast-util-to-parse5@8.0.1/node_modules/hast-util-to-parse5/lib/index.js
|
|
77652
77652
|
/**
|
|
@@ -77680,7 +77680,7 @@ var esm_default = typeof structuredClone === "function" ?
|
|
|
77680
77680
|
*/
|
|
77681
77681
|
/** @type {Options} */
|
|
77682
77682
|
const emptyOptions$5 = {};
|
|
77683
|
-
const own$
|
|
77683
|
+
const own$8 = {}.hasOwnProperty;
|
|
77684
77684
|
const one$2 = zwitch("type", { handlers: {
|
|
77685
77685
|
root: root$4,
|
|
77686
77686
|
element: element$2,
|
|
@@ -77806,7 +77806,7 @@ function element$2(node, schema) {
|
|
|
77806
77806
|
/** @type {string} */
|
|
77807
77807
|
let prop;
|
|
77808
77808
|
if (node.properties) {
|
|
77809
|
-
for (prop in node.properties) if (prop !== "children" && own$
|
|
77809
|
+
for (prop in node.properties) if (prop !== "children" && own$8.call(node.properties, prop)) {
|
|
77810
77810
|
const result = createProperty(currentSchema, prop, node.properties[prop]);
|
|
77811
77811
|
if (result) attrs.push(result);
|
|
77812
77812
|
}
|
|
@@ -80419,7 +80419,7 @@ const prefix = "language-";
|
|
|
80419
80419
|
* @returns {Code}
|
|
80420
80420
|
* mdast node.
|
|
80421
80421
|
*/
|
|
80422
|
-
function code$
|
|
80422
|
+
function code$4(state, node) {
|
|
80423
80423
|
const children = node.children;
|
|
80424
80424
|
let index = -1;
|
|
80425
80425
|
/** @type {Array<number | string> | undefined} */
|
|
@@ -80974,7 +80974,7 @@ function input(state, node) {
|
|
|
80974
80974
|
* @typedef {import('hast').Element} Element
|
|
80975
80975
|
* @typedef {import('hast').Nodes} Nodes
|
|
80976
80976
|
*/
|
|
80977
|
-
const own$
|
|
80977
|
+
const own$7 = {}.hasOwnProperty;
|
|
80978
80978
|
/**
|
|
80979
80979
|
* Check if `node` is an element and has a `name` property.
|
|
80980
80980
|
*
|
|
@@ -80990,7 +80990,7 @@ const own$6 = {}.hasOwnProperty;
|
|
|
80990
80990
|
* Note: see <https://github.com/DefinitelyTyped/DefinitelyTyped/blob/27c9274/types/hast/index.d.ts#L37C29-L37C98>.
|
|
80991
80991
|
*/
|
|
80992
80992
|
function hasProperty(node, name) {
|
|
80993
|
-
const value = node.type === "element" && own$
|
|
80993
|
+
const value = node.type === "element" && own$7.call(node.properties, name) && node.properties[name];
|
|
80994
80994
|
return value !== null && value !== void 0 && value !== false;
|
|
80995
80995
|
}
|
|
80996
80996
|
//#endregion
|
|
@@ -81080,7 +81080,7 @@ const meta = convertElement("meta");
|
|
|
81080
81080
|
* @returns {boolean}
|
|
81081
81081
|
* Whether `value` is phrasing content.
|
|
81082
81082
|
*/
|
|
81083
|
-
function phrasing$
|
|
81083
|
+
function phrasing$3(value) {
|
|
81084
81084
|
return Boolean(value.type === "text" || basic(value) || embedded(value) || isBodyOkLink(value) || meta(value) && hasProperty(value, "itemProp"));
|
|
81085
81085
|
}
|
|
81086
81086
|
//#endregion
|
|
@@ -81148,7 +81148,7 @@ function spreadout(node) {
|
|
|
81148
81148
|
while (++index < node.children.length) {
|
|
81149
81149
|
const child = node.children[index];
|
|
81150
81150
|
if (child.type === "element") {
|
|
81151
|
-
if (phrasing$
|
|
81151
|
+
if (phrasing$3(child)) continue;
|
|
81152
81152
|
if (child.tagName === "p" || seenFlow || spreadout(child)) return true;
|
|
81153
81153
|
seenFlow = true;
|
|
81154
81154
|
}
|
|
@@ -81352,7 +81352,7 @@ function node(value) {
|
|
|
81352
81352
|
* @returns
|
|
81353
81353
|
* Whether `value` is phrasing content.
|
|
81354
81354
|
*/
|
|
81355
|
-
const phrasing$
|
|
81355
|
+
const phrasing$2 = convert([
|
|
81356
81356
|
"break",
|
|
81357
81357
|
"delete",
|
|
81358
81358
|
"emphasis",
|
|
@@ -81398,7 +81398,7 @@ function wrapNeeded(nodes) {
|
|
|
81398
81398
|
let index = -1;
|
|
81399
81399
|
while (++index < nodes.length) {
|
|
81400
81400
|
const node = nodes[index];
|
|
81401
|
-
if (!phrasing(node) || "children" in node && wrapNeeded(node.children)) return true;
|
|
81401
|
+
if (!phrasing$1(node) || "children" in node && wrapNeeded(node.children)) return true;
|
|
81402
81402
|
}
|
|
81403
81403
|
return false;
|
|
81404
81404
|
}
|
|
@@ -81484,7 +81484,7 @@ function runs(nodes, onphrasing, onnonphrasing) {
|
|
|
81484
81484
|
let index = -1;
|
|
81485
81485
|
while (++index < flattened.length) {
|
|
81486
81486
|
const node = flattened[index];
|
|
81487
|
-
if (phrasing(node)) queue.push(node);
|
|
81487
|
+
if (phrasing$1(node)) queue.push(node);
|
|
81488
81488
|
else {
|
|
81489
81489
|
if (queue.length > 0) {
|
|
81490
81490
|
result.push(...onphrasing(queue));
|
|
@@ -81529,14 +81529,14 @@ function flatten(nodes) {
|
|
|
81529
81529
|
* Whether `node` is phrasing content (includes nodes with `hName` fields
|
|
81530
81530
|
* set to phrasing hast element names).
|
|
81531
81531
|
*/
|
|
81532
|
-
function phrasing(node) {
|
|
81532
|
+
function phrasing$1(node) {
|
|
81533
81533
|
const tagName = node.data && node.data.hName;
|
|
81534
|
-
return tagName ? phrasing$
|
|
81534
|
+
return tagName ? phrasing$3({
|
|
81535
81535
|
type: "element",
|
|
81536
81536
|
tagName,
|
|
81537
81537
|
properties: {},
|
|
81538
81538
|
children: []
|
|
81539
|
-
}) : phrasing$
|
|
81539
|
+
}) : phrasing$2(node);
|
|
81540
81540
|
}
|
|
81541
81541
|
/**
|
|
81542
81542
|
* @template {Parents} ParentType
|
|
@@ -82192,12 +82192,12 @@ const handlers$1 = {
|
|
|
82192
82192
|
input,
|
|
82193
82193
|
kbd: inlineCode$2,
|
|
82194
82194
|
li,
|
|
82195
|
-
listing: code$
|
|
82195
|
+
listing: code$4,
|
|
82196
82196
|
mark: em,
|
|
82197
82197
|
ol: list$4,
|
|
82198
82198
|
p,
|
|
82199
|
-
plaintext: code$
|
|
82200
|
-
pre: code$
|
|
82199
|
+
plaintext: code$4,
|
|
82200
|
+
pre: code$4,
|
|
82201
82201
|
q,
|
|
82202
82202
|
s: del,
|
|
82203
82203
|
samp: inlineCode$2,
|
|
@@ -82216,7 +82216,7 @@ const handlers$1 = {
|
|
|
82216
82216
|
var: inlineCode$2,
|
|
82217
82217
|
video: media,
|
|
82218
82218
|
wbr,
|
|
82219
|
-
xmp: code$
|
|
82219
|
+
xmp: code$4
|
|
82220
82220
|
};
|
|
82221
82221
|
/**
|
|
82222
82222
|
* @param {State} state
|
|
@@ -82402,7 +82402,7 @@ function ignore$1() {}
|
|
|
82402
82402
|
* @returns {Array<MdastFlowContent>}
|
|
82403
82403
|
* mdast flow children.
|
|
82404
82404
|
*/
|
|
82405
|
-
const own$
|
|
82405
|
+
const own$6 = {}.hasOwnProperty;
|
|
82406
82406
|
/**
|
|
82407
82407
|
* Create a state.
|
|
82408
82408
|
*
|
|
@@ -82475,8 +82475,8 @@ function all(parent) {
|
|
|
82475
82475
|
function one(node, parent) {
|
|
82476
82476
|
if (node.type === "element") {
|
|
82477
82477
|
if (node.properties && node.properties.dataMdast === "ignore") return;
|
|
82478
|
-
if (own$
|
|
82479
|
-
} else if (own$
|
|
82478
|
+
if (own$6.call(this.handlers, node.tagName)) return this.handlers[node.tagName](this, node, parent) || void 0;
|
|
82479
|
+
} else if (own$6.call(this.nodeHandlers, node.type)) return this.nodeHandlers[node.type](this, node, parent) || void 0;
|
|
82480
82480
|
if ("value" in node && typeof node.value === "string") {
|
|
82481
82481
|
/** @type {MdastRootContent} */
|
|
82482
82482
|
const result = {
|
|
@@ -83637,17 +83637,20 @@ function mapAll(line, index, blank) {
|
|
|
83637
83637
|
return (blank ? "" : " ") + line;
|
|
83638
83638
|
}
|
|
83639
83639
|
//#endregion
|
|
83640
|
-
//#region node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.
|
|
83640
|
+
//#region node_modules/.pnpm/mdast-util-gfm-strikethrough@2.0.1_supports-color@7.2.0/node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
83641
83641
|
/**
|
|
83642
|
-
* @
|
|
83643
|
-
*
|
|
83644
|
-
*
|
|
83645
|
-
*
|
|
83646
|
-
*
|
|
83647
|
-
*
|
|
83648
|
-
* @
|
|
83649
|
-
*
|
|
83650
|
-
*
|
|
83642
|
+
* @import {Delete} from 'mdast'
|
|
83643
|
+
* @import {
|
|
83644
|
+
* CompileContext,
|
|
83645
|
+
* Extension as FromMarkdownExtension,
|
|
83646
|
+
* Handle as FromMarkdownHandle
|
|
83647
|
+
* } from 'mdast-util-from-markdown'
|
|
83648
|
+
* @import {
|
|
83649
|
+
* Attention,
|
|
83650
|
+
* ConstructName,
|
|
83651
|
+
* Handle as ToMarkdownHandle,
|
|
83652
|
+
* Options as ToMarkdownExtension
|
|
83653
|
+
* } from 'mdast-util-to-markdown'
|
|
83651
83654
|
*/
|
|
83652
83655
|
/**
|
|
83653
83656
|
* List of constructs that occur in phrasing (paragraphs, headings), but cannot
|
|
@@ -83667,6 +83670,7 @@ const constructsWithoutStrikethrough = [
|
|
|
83667
83670
|
"titleQuote",
|
|
83668
83671
|
"titleApostrophe"
|
|
83669
83672
|
];
|
|
83673
|
+
handleDelete.attention = attentionDelete;
|
|
83670
83674
|
handleDelete.peek = peekDelete;
|
|
83671
83675
|
/**
|
|
83672
83676
|
* Create an extension for `mdast-util-from-markdown` to enable GFM
|
|
@@ -83691,25 +83695,30 @@ function gfmStrikethroughFromMarkdown() {
|
|
|
83691
83695
|
*/
|
|
83692
83696
|
function gfmStrikethroughToMarkdown() {
|
|
83693
83697
|
return {
|
|
83698
|
+
handlers: { delete: handleDelete },
|
|
83694
83699
|
unsafe: [{
|
|
83695
83700
|
character: "~",
|
|
83696
83701
|
inConstruct: "phrasing",
|
|
83697
83702
|
notInConstruct: constructsWithoutStrikethrough
|
|
83698
|
-
}]
|
|
83699
|
-
handlers: { delete: handleDelete }
|
|
83703
|
+
}]
|
|
83700
83704
|
};
|
|
83701
83705
|
}
|
|
83702
83706
|
/**
|
|
83707
|
+
* Enter strikethrough.
|
|
83708
|
+
*
|
|
83703
83709
|
* @this {CompileContext}
|
|
83704
83710
|
* @type {FromMarkdownHandle}
|
|
83705
83711
|
*/
|
|
83706
83712
|
function enterStrikethrough(token) {
|
|
83707
83713
|
this.enter({
|
|
83708
83714
|
type: "delete",
|
|
83709
|
-
children: []
|
|
83715
|
+
children: [],
|
|
83716
|
+
position: void 0
|
|
83710
83717
|
}, token);
|
|
83711
83718
|
}
|
|
83712
83719
|
/**
|
|
83720
|
+
* Exit strikethrough.
|
|
83721
|
+
*
|
|
83713
83722
|
* @this {CompileContext}
|
|
83714
83723
|
* @type {FromMarkdownHandle}
|
|
83715
83724
|
*/
|
|
@@ -83717,23 +83726,43 @@ function exitStrikethrough(token) {
|
|
|
83717
83726
|
this.exit(token);
|
|
83718
83727
|
}
|
|
83719
83728
|
/**
|
|
83729
|
+
* Serialize a delete node.
|
|
83730
|
+
*
|
|
83720
83731
|
* @type {ToMarkdownHandle}
|
|
83721
83732
|
* @param {Delete} node
|
|
83733
|
+
* Node to serialize.
|
|
83722
83734
|
*/
|
|
83723
83735
|
function handleDelete(node, _, state, info) {
|
|
83724
83736
|
const tracker = state.createTracker(info);
|
|
83737
|
+
const sequence = state.stack.includes("strikethrough") ? "~" : "~~";
|
|
83725
83738
|
const exit = state.enter("strikethrough");
|
|
83726
|
-
let value = tracker.move(
|
|
83739
|
+
let value = tracker.move(sequence);
|
|
83727
83740
|
value += state.containerPhrasing(node, {
|
|
83728
83741
|
...tracker.current(),
|
|
83729
83742
|
before: value,
|
|
83730
83743
|
after: "~"
|
|
83731
83744
|
});
|
|
83732
|
-
value += tracker.move(
|
|
83745
|
+
value += tracker.move(sequence);
|
|
83733
83746
|
exit();
|
|
83734
83747
|
return value;
|
|
83735
83748
|
}
|
|
83736
|
-
/**
|
|
83749
|
+
/**
|
|
83750
|
+
* Serialize a delete node as attention.
|
|
83751
|
+
*
|
|
83752
|
+
* @type {Attention}
|
|
83753
|
+
*/
|
|
83754
|
+
function attentionDelete() {
|
|
83755
|
+
return {
|
|
83756
|
+
construct: "strikethrough",
|
|
83757
|
+
markers: ["~"],
|
|
83758
|
+
sizes: [2, 1]
|
|
83759
|
+
};
|
|
83760
|
+
}
|
|
83761
|
+
/**
|
|
83762
|
+
* Peek the first character of a delete node.
|
|
83763
|
+
*
|
|
83764
|
+
* @type {ToMarkdownHandle}
|
|
83765
|
+
*/
|
|
83737
83766
|
function peekDelete() {
|
|
83738
83767
|
return "~";
|
|
83739
83768
|
}
|
|
@@ -83926,7 +83955,7 @@ function markdownTable(table, options) {
|
|
|
83926
83955
|
let columnIndex = -1;
|
|
83927
83956
|
if (table[rowIndex].length > mostCellsPerRow) mostCellsPerRow = table[rowIndex].length;
|
|
83928
83957
|
while (++columnIndex < table[rowIndex].length) {
|
|
83929
|
-
const cell = serialize(table[rowIndex][columnIndex]);
|
|
83958
|
+
const cell = serialize$1(table[rowIndex][columnIndex]);
|
|
83930
83959
|
if (settings.alignDelimiters !== false) {
|
|
83931
83960
|
const size = stringLength(cell);
|
|
83932
83961
|
sizes[columnIndex] = size;
|
|
@@ -84013,7 +84042,7 @@ function markdownTable(table, options) {
|
|
|
84013
84042
|
* @returns {string}
|
|
84014
84043
|
* Result.
|
|
84015
84044
|
*/
|
|
84016
|
-
function serialize(value) {
|
|
84045
|
+
function serialize$1(value) {
|
|
84017
84046
|
return value === null || value === void 0 ? "" : String(value);
|
|
84018
84047
|
}
|
|
84019
84048
|
/**
|
|
@@ -84027,22 +84056,27 @@ function toAlignment(value) {
|
|
|
84027
84056
|
return code === 67 || code === 99 ? 99 : code === 76 || code === 108 ? 108 : code === 82 || code === 114 ? 114 : 0;
|
|
84028
84057
|
}
|
|
84029
84058
|
//#endregion
|
|
84030
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84059
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/configure.js
|
|
84031
84060
|
/**
|
|
84032
84061
|
* @import {Options, State} from './types.js'
|
|
84033
84062
|
*/
|
|
84034
|
-
const own$
|
|
84063
|
+
const own$5 = {}.hasOwnProperty;
|
|
84035
84064
|
/**
|
|
84065
|
+
* Configure a base state w/ an extension.
|
|
84066
|
+
*
|
|
84036
84067
|
* @param {State} base
|
|
84068
|
+
* Base state to configure.
|
|
84037
84069
|
* @param {Options} extension
|
|
84070
|
+
* Extension to apply.
|
|
84038
84071
|
* @returns {State}
|
|
84072
|
+
* Given `base`.
|
|
84039
84073
|
*/
|
|
84040
84074
|
function configure$1(base, extension) {
|
|
84041
84075
|
let index = -1;
|
|
84042
84076
|
/** @type {keyof Options} */
|
|
84043
84077
|
let key;
|
|
84044
84078
|
if (extension.extensions) while (++index < extension.extensions.length) configure$1(base, extension.extensions[index]);
|
|
84045
|
-
for (key in extension) if (own$
|
|
84079
|
+
for (key in extension) if (own$5.call(extension, key)) switch (key) {
|
|
84046
84080
|
case "extensions": break;
|
|
84047
84081
|
/* c8 ignore next 4 */
|
|
84048
84082
|
case "unsafe":
|
|
@@ -84059,33 +84093,54 @@ function configure$1(base, extension) {
|
|
|
84059
84093
|
return base;
|
|
84060
84094
|
}
|
|
84061
84095
|
/**
|
|
84096
|
+
* Merge arrays from the extension into the base state.
|
|
84097
|
+
*
|
|
84062
84098
|
* @template T
|
|
84099
|
+
* Kind.
|
|
84063
84100
|
* @param {Array<T>} left
|
|
84101
|
+
* List to merge into.
|
|
84064
84102
|
* @param {Array<T> | null | undefined} right
|
|
84103
|
+
* List to merge from.
|
|
84104
|
+
* @returns {undefined}
|
|
84105
|
+
* Nothing.
|
|
84065
84106
|
*/
|
|
84066
84107
|
function list$3(left, right) {
|
|
84067
84108
|
if (right) left.push(...right);
|
|
84068
84109
|
}
|
|
84069
84110
|
/**
|
|
84111
|
+
* Merge objects from the extension into the base state.
|
|
84112
|
+
*
|
|
84070
84113
|
* @template T
|
|
84114
|
+
* Kind.
|
|
84071
84115
|
* @param {Record<string, T>} left
|
|
84116
|
+
* Object to merge into.
|
|
84072
84117
|
* @param {Record<string, T> | null | undefined} right
|
|
84118
|
+
* Object to merge from.
|
|
84119
|
+
* @returns {undefined}
|
|
84120
|
+
* Nothing.
|
|
84073
84121
|
*/
|
|
84074
84122
|
function map$2(left, right) {
|
|
84075
84123
|
if (right) Object.assign(left, right);
|
|
84076
84124
|
}
|
|
84077
84125
|
//#endregion
|
|
84078
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84126
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
|
|
84079
84127
|
/**
|
|
84080
84128
|
* @import {Blockquote, Parents} from 'mdast'
|
|
84081
84129
|
* @import {Info, Map, State} from 'mdast-util-to-markdown'
|
|
84082
84130
|
*/
|
|
84083
84131
|
/**
|
|
84132
|
+
* Serialize a blockquote node.
|
|
84133
|
+
*
|
|
84084
84134
|
* @param {Blockquote} node
|
|
84135
|
+
* Node to serialize.
|
|
84085
84136
|
* @param {Parents | undefined} _
|
|
84137
|
+
* Parent node.
|
|
84086
84138
|
* @param {State} state
|
|
84139
|
+
* Info passed around.
|
|
84087
84140
|
* @param {Info} info
|
|
84141
|
+
* Info on surrounding context.
|
|
84088
84142
|
* @returns {string}
|
|
84143
|
+
* Serialized markdown.
|
|
84089
84144
|
*/
|
|
84090
84145
|
function blockquote$1(node, _, state, info) {
|
|
84091
84146
|
const exit = state.enter("blockquote");
|
|
@@ -84096,28 +84151,43 @@ function blockquote$1(node, _, state, info) {
|
|
|
84096
84151
|
exit();
|
|
84097
84152
|
return value;
|
|
84098
84153
|
}
|
|
84099
|
-
/**
|
|
84154
|
+
/**
|
|
84155
|
+
* Indent lines w/ blockquote markers.
|
|
84156
|
+
*
|
|
84157
|
+
* @type {Map}
|
|
84158
|
+
*/
|
|
84100
84159
|
function map$1(line, _, blank) {
|
|
84101
84160
|
return ">" + (blank ? "" : " ") + line;
|
|
84102
84161
|
}
|
|
84103
84162
|
//#endregion
|
|
84104
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84163
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
|
|
84105
84164
|
/**
|
|
84106
84165
|
* @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'
|
|
84107
84166
|
*/
|
|
84108
84167
|
/**
|
|
84168
|
+
* Check if a pattern is in scope based on the current stack of constructs.
|
|
84169
|
+
*
|
|
84109
84170
|
* @param {Array<ConstructName>} stack
|
|
84171
|
+
* Current stack of constructs.
|
|
84110
84172
|
* @param {Unsafe} pattern
|
|
84173
|
+
* Pattern to check.
|
|
84111
84174
|
* @returns {boolean}
|
|
84175
|
+
* Whether the pattern is in scope.
|
|
84112
84176
|
*/
|
|
84113
84177
|
function patternInScope(stack, pattern) {
|
|
84114
84178
|
return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
|
|
84115
84179
|
}
|
|
84116
84180
|
/**
|
|
84181
|
+
* Check if any of the constructs in the list are present in the stack.
|
|
84182
|
+
*
|
|
84117
84183
|
* @param {Array<ConstructName>} stack
|
|
84184
|
+
* Current stack of constructs.
|
|
84118
84185
|
* @param {Unsafe['inConstruct']} list
|
|
84186
|
+
* List of constructs to check for in the stack.
|
|
84119
84187
|
* @param {boolean} none
|
|
84188
|
+
* Value to return if the list is empty or not provided.
|
|
84120
84189
|
* @returns {boolean}
|
|
84190
|
+
* Whether any of the constructs in the list are present in the stack.
|
|
84121
84191
|
*/
|
|
84122
84192
|
function listInScope(stack, list, none) {
|
|
84123
84193
|
if (typeof list === "string") list = [list];
|
|
@@ -84127,21 +84197,31 @@ function listInScope(stack, list, none) {
|
|
|
84127
84197
|
return false;
|
|
84128
84198
|
}
|
|
84129
84199
|
//#endregion
|
|
84130
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84200
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/break.js
|
|
84131
84201
|
/**
|
|
84132
84202
|
* @import {Break, Parents} from 'mdast'
|
|
84133
84203
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84134
84204
|
*/
|
|
84135
84205
|
/**
|
|
84206
|
+
* Serialize a break node.
|
|
84207
|
+
*
|
|
84136
84208
|
* @param {Break} _
|
|
84209
|
+
* Node to serialize.
|
|
84137
84210
|
* @param {Parents | undefined} _1
|
|
84211
|
+
* Parent node.
|
|
84138
84212
|
* @param {State} state
|
|
84213
|
+
* Info passed around.
|
|
84139
84214
|
* @param {Info} info
|
|
84215
|
+
* Info on surrounding context.
|
|
84140
84216
|
* @returns {string}
|
|
84217
|
+
* Serialized markdown.
|
|
84141
84218
|
*/
|
|
84142
84219
|
function hardBreak$1(_, _1, state, info) {
|
|
84143
84220
|
let index = -1;
|
|
84144
|
-
while (++index < state.unsafe.length)
|
|
84221
|
+
while (++index < state.unsafe.length) {
|
|
84222
|
+
const pattern = state.unsafe[index];
|
|
84223
|
+
if (pattern.character === "\n" && !pattern.before && !pattern.after && patternInScope(state.stack, pattern)) return /[\t ]/.test(info.before) ? "" : " ";
|
|
84224
|
+
}
|
|
84145
84225
|
return "\\\n";
|
|
84146
84226
|
}
|
|
84147
84227
|
//#endregion
|
|
@@ -84173,27 +84253,36 @@ function longestStreak(value, substring) {
|
|
|
84173
84253
|
return max;
|
|
84174
84254
|
}
|
|
84175
84255
|
//#endregion
|
|
84176
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84256
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
|
|
84177
84257
|
/**
|
|
84178
84258
|
* @import {State} from 'mdast-util-to-markdown'
|
|
84179
84259
|
* @import {Code} from 'mdast'
|
|
84180
84260
|
*/
|
|
84181
84261
|
/**
|
|
84262
|
+
* Checks if a code block can be formatted as an indented code block.
|
|
84263
|
+
*
|
|
84182
84264
|
* @param {Code} node
|
|
84265
|
+
* Node to check.
|
|
84183
84266
|
* @param {State} state
|
|
84267
|
+
* Info passed around.
|
|
84184
84268
|
* @returns {boolean}
|
|
84269
|
+
* Whether the code can be formatted as an indented code block.
|
|
84185
84270
|
*/
|
|
84186
84271
|
function formatCodeAsIndented(node, state) {
|
|
84187
|
-
return Boolean(state.options.fences === false && node.value && !node.lang && /[
|
|
84272
|
+
return Boolean(state.options.fences === false && node.value && !node.lang && /[^\n\r ]/.test(node.value) && !/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(node.value));
|
|
84188
84273
|
}
|
|
84189
84274
|
//#endregion
|
|
84190
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84275
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-fence.js
|
|
84191
84276
|
/**
|
|
84192
84277
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
84193
84278
|
*/
|
|
84194
84279
|
/**
|
|
84280
|
+
* Checks the preferred fence option.
|
|
84281
|
+
*
|
|
84195
84282
|
* @param {State} state
|
|
84283
|
+
* Info passed around.
|
|
84196
84284
|
* @returns {Exclude<Options['fence'], null | undefined>}
|
|
84285
|
+
* Preferred fence marker.
|
|
84197
84286
|
*/
|
|
84198
84287
|
function checkFence(state) {
|
|
84199
84288
|
const marker = state.options.fence || "`";
|
|
@@ -84201,22 +84290,28 @@ function checkFence(state) {
|
|
|
84201
84290
|
return marker;
|
|
84202
84291
|
}
|
|
84203
84292
|
//#endregion
|
|
84204
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84293
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/code.js
|
|
84205
84294
|
/**
|
|
84206
84295
|
* @import {Info, Map, State} from 'mdast-util-to-markdown'
|
|
84207
84296
|
* @import {Code, Parents} from 'mdast'
|
|
84208
84297
|
*/
|
|
84209
84298
|
/**
|
|
84299
|
+
* Serialize a code node.
|
|
84300
|
+
*
|
|
84210
84301
|
* @param {Code} node
|
|
84302
|
+
* Node to serialize.
|
|
84211
84303
|
* @param {Parents | undefined} _
|
|
84304
|
+
* Parent node.
|
|
84212
84305
|
* @param {State} state
|
|
84306
|
+
* Info passed around.
|
|
84213
84307
|
* @param {Info} info
|
|
84308
|
+
* Info on surrounding context.
|
|
84214
84309
|
* @returns {string}
|
|
84310
|
+
* Serialized markdown.
|
|
84215
84311
|
*/
|
|
84216
|
-
function code$
|
|
84312
|
+
function code$3(node, _, state, info) {
|
|
84217
84313
|
const marker = checkFence(state);
|
|
84218
84314
|
const raw = node.value || "";
|
|
84219
|
-
const suffix = marker === "`" ? "GraveAccent" : "Tilde";
|
|
84220
84315
|
if (formatCodeAsIndented(node, state)) {
|
|
84221
84316
|
const exit = state.enter("codeIndented");
|
|
84222
84317
|
const value = state.indentLines(raw, map);
|
|
@@ -84226,6 +84321,7 @@ function code$2(node, _, state, info) {
|
|
|
84226
84321
|
const tracker = state.createTracker(info);
|
|
84227
84322
|
const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3));
|
|
84228
84323
|
const exit = state.enter("codeFenced");
|
|
84324
|
+
const suffix = marker === "`" ? "GraveAccent" : "Tilde";
|
|
84229
84325
|
let value = tracker.move(sequence);
|
|
84230
84326
|
if (node.lang) {
|
|
84231
84327
|
const subexit = state.enter(`codeFencedLang${suffix}`);
|
|
@@ -84254,18 +84350,26 @@ function code$2(node, _, state, info) {
|
|
|
84254
84350
|
exit();
|
|
84255
84351
|
return value;
|
|
84256
84352
|
}
|
|
84257
|
-
/**
|
|
84353
|
+
/**
|
|
84354
|
+
* Indent lines w/ code indent.
|
|
84355
|
+
*
|
|
84356
|
+
* @type {Map}
|
|
84357
|
+
*/
|
|
84258
84358
|
function map(line, _, blank) {
|
|
84259
84359
|
return (blank ? "" : " ") + line;
|
|
84260
84360
|
}
|
|
84261
84361
|
//#endregion
|
|
84262
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84362
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-quote.js
|
|
84263
84363
|
/**
|
|
84264
84364
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
84265
84365
|
*/
|
|
84266
84366
|
/**
|
|
84367
|
+
* Checks the preferred quote option.
|
|
84368
|
+
*
|
|
84267
84369
|
* @param {State} state
|
|
84370
|
+
* Info passed around.
|
|
84268
84371
|
* @returns {Exclude<Options['quote'], null | undefined>}
|
|
84372
|
+
* Preferred quote.
|
|
84269
84373
|
*/
|
|
84270
84374
|
function checkQuote(state) {
|
|
84271
84375
|
const marker = state.options.quote || "\"";
|
|
@@ -84273,17 +84377,24 @@ function checkQuote(state) {
|
|
|
84273
84377
|
return marker;
|
|
84274
84378
|
}
|
|
84275
84379
|
//#endregion
|
|
84276
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84380
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/definition.js
|
|
84277
84381
|
/**
|
|
84278
84382
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84279
84383
|
* @import {Definition, Parents} from 'mdast'
|
|
84280
84384
|
*/
|
|
84281
84385
|
/**
|
|
84386
|
+
* Serialize a definition node.
|
|
84387
|
+
*
|
|
84282
84388
|
* @param {Definition} node
|
|
84389
|
+
* Node to serialize.
|
|
84283
84390
|
* @param {Parents | undefined} _
|
|
84391
|
+
* Parent node.
|
|
84284
84392
|
* @param {State} state
|
|
84393
|
+
* Info passed around.
|
|
84285
84394
|
* @param {Info} info
|
|
84395
|
+
* Info on surrounding context.
|
|
84286
84396
|
* @returns {string}
|
|
84397
|
+
* Serialized markdown.
|
|
84287
84398
|
*/
|
|
84288
84399
|
function definition$1(node, _, state, info) {
|
|
84289
84400
|
const quote = checkQuote(state);
|
|
@@ -84332,13 +84443,17 @@ function definition$1(node, _, state, info) {
|
|
|
84332
84443
|
return value;
|
|
84333
84444
|
}
|
|
84334
84445
|
//#endregion
|
|
84335
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84446
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
|
|
84336
84447
|
/**
|
|
84337
84448
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
84338
84449
|
*/
|
|
84339
84450
|
/**
|
|
84451
|
+
* Checks the preferred emphasis option.
|
|
84452
|
+
*
|
|
84340
84453
|
* @param {State} state
|
|
84454
|
+
* Info passed around.
|
|
84341
84455
|
* @returns {Exclude<Options['emphasis'], null | undefined>}
|
|
84456
|
+
* Preferred emphasis marker.
|
|
84342
84457
|
*/
|
|
84343
84458
|
function checkEmphasis(state) {
|
|
84344
84459
|
const marker = state.options.emphasis || "*";
|
|
@@ -84346,170 +84461,98 @@ function checkEmphasis(state) {
|
|
|
84346
84461
|
return marker;
|
|
84347
84462
|
}
|
|
84348
84463
|
//#endregion
|
|
84349
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84464
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
|
|
84350
84465
|
/**
|
|
84351
|
-
*
|
|
84352
|
-
*
|
|
84353
|
-
* @param {number} code
|
|
84354
|
-
* Code point to encode.
|
|
84355
|
-
* @returns {string}
|
|
84356
|
-
* Encoded character reference.
|
|
84357
|
-
*/
|
|
84358
|
-
function encodeCharacterReference(code) {
|
|
84359
|
-
return "&#x" + code.toString(16).toUpperCase() + ";";
|
|
84360
|
-
}
|
|
84361
|
-
//#endregion
|
|
84362
|
-
//#region node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js
|
|
84363
|
-
/**
|
|
84364
|
-
* @import {Code} from 'micromark-util-types'
|
|
84365
|
-
*/
|
|
84366
|
-
/**
|
|
84367
|
-
* Classify whether a code represents whitespace, punctuation, or something
|
|
84368
|
-
* else.
|
|
84369
|
-
*
|
|
84370
|
-
* Used for attention (emphasis, strong), whose sequences can open or close
|
|
84371
|
-
* based on the class of surrounding characters.
|
|
84372
|
-
*
|
|
84373
|
-
* > 👉 **Note**: eof (`null`) is seen as whitespace.
|
|
84374
|
-
*
|
|
84375
|
-
* @param {Code} code
|
|
84376
|
-
* Code.
|
|
84377
|
-
* @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
|
|
84378
|
-
* Group.
|
|
84379
|
-
*/
|
|
84380
|
-
function classifyCharacter(code) {
|
|
84381
|
-
if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return 1;
|
|
84382
|
-
if (unicodePunctuation(code)) return 2;
|
|
84383
|
-
}
|
|
84384
|
-
//#endregion
|
|
84385
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-info.js
|
|
84386
|
-
/**
|
|
84387
|
-
* @import {EncodeSides} from '../types.js'
|
|
84466
|
+
* @import {AttentionInfo, Info, State} from 'mdast-util-to-markdown'
|
|
84467
|
+
* @import {Emphasis, Parents} from 'mdast'
|
|
84388
84468
|
*/
|
|
84469
|
+
emphasis$1.attention = attention$2;
|
|
84470
|
+
emphasis$1.peek = peek$1;
|
|
84389
84471
|
/**
|
|
84390
|
-
*
|
|
84391
|
-
* surrounding an attention run.
|
|
84392
|
-
*
|
|
84393
|
-
* Which characters are around an attention run influence whether it works or
|
|
84394
|
-
* not.
|
|
84395
|
-
*
|
|
84396
|
-
* See <https://github.com/orgs/syntax-tree/discussions/60> for more info.
|
|
84397
|
-
* See this markdown in a particular renderer to see what works:
|
|
84472
|
+
* Serialize an emphasis node.
|
|
84398
84473
|
*
|
|
84399
|
-
*
|
|
84400
|
-
* | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |
|
|
84401
|
-
* | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |
|
|
84402
|
-
* | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z |
|
|
84403
|
-
* | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. |
|
|
84404
|
-
* | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z |
|
|
84405
|
-
* | 4 (nothing outside) | *x* | *.* | * * | ** |
|
|
84406
|
-
* ```
|
|
84474
|
+
* Attention is properly handled by `containerPhrasing`.
|
|
84407
84475
|
*
|
|
84408
|
-
* @param {number} outside
|
|
84409
|
-
* Code point on the outer side of the run.
|
|
84410
|
-
* @param {number} inside
|
|
84411
|
-
* Code point on the inner side of the run.
|
|
84412
|
-
* @param {'*' | '_'} marker
|
|
84413
|
-
* Marker of the run.
|
|
84414
|
-
* Underscores are handled more strictly (they form less often) than
|
|
84415
|
-
* asterisks.
|
|
84416
|
-
* @returns {EncodeSides}
|
|
84417
|
-
* Whether to encode characters.
|
|
84418
|
-
*/
|
|
84419
|
-
function encodeInfo(outside, inside, marker) {
|
|
84420
|
-
const outsideKind = classifyCharacter(outside);
|
|
84421
|
-
const insideKind = classifyCharacter(inside);
|
|
84422
|
-
if (outsideKind === void 0) return insideKind === void 0 ? marker === "_" ? {
|
|
84423
|
-
inside: true,
|
|
84424
|
-
outside: true
|
|
84425
|
-
} : {
|
|
84426
|
-
inside: false,
|
|
84427
|
-
outside: false
|
|
84428
|
-
} : insideKind === 1 ? {
|
|
84429
|
-
inside: true,
|
|
84430
|
-
outside: true
|
|
84431
|
-
} : {
|
|
84432
|
-
inside: false,
|
|
84433
|
-
outside: true
|
|
84434
|
-
};
|
|
84435
|
-
if (outsideKind === 1) return insideKind === void 0 ? {
|
|
84436
|
-
inside: false,
|
|
84437
|
-
outside: false
|
|
84438
|
-
} : insideKind === 1 ? {
|
|
84439
|
-
inside: true,
|
|
84440
|
-
outside: true
|
|
84441
|
-
} : {
|
|
84442
|
-
inside: false,
|
|
84443
|
-
outside: false
|
|
84444
|
-
};
|
|
84445
|
-
return insideKind === void 0 ? {
|
|
84446
|
-
inside: false,
|
|
84447
|
-
outside: false
|
|
84448
|
-
} : insideKind === 1 ? {
|
|
84449
|
-
inside: true,
|
|
84450
|
-
outside: false
|
|
84451
|
-
} : {
|
|
84452
|
-
inside: false,
|
|
84453
|
-
outside: false
|
|
84454
|
-
};
|
|
84455
|
-
}
|
|
84456
|
-
//#endregion
|
|
84457
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
|
|
84458
|
-
/**
|
|
84459
|
-
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84460
|
-
* @import {Emphasis, Parents} from 'mdast'
|
|
84461
|
-
*/
|
|
84462
|
-
emphasis$1.peek = emphasisPeek;
|
|
84463
|
-
/**
|
|
84464
84476
|
* @param {Emphasis} node
|
|
84477
|
+
* Node to serialize.
|
|
84465
84478
|
* @param {Parents | undefined} _
|
|
84479
|
+
* Parent node.
|
|
84466
84480
|
* @param {State} state
|
|
84481
|
+
* Info passed around.
|
|
84467
84482
|
* @param {Info} info
|
|
84483
|
+
* Info on surrounding context.
|
|
84468
84484
|
* @returns {string}
|
|
84485
|
+
* Serialized markdown.
|
|
84469
84486
|
*/
|
|
84470
84487
|
function emphasis$1(node, _, state, info) {
|
|
84471
|
-
const
|
|
84472
|
-
const
|
|
84473
|
-
|
|
84474
|
-
|
|
84475
|
-
|
|
84476
|
-
after: marker,
|
|
84477
|
-
before,
|
|
84478
|
-
...tracker.current()
|
|
84479
|
-
}));
|
|
84480
|
-
const betweenHead = between.charCodeAt(0);
|
|
84481
|
-
const open = encodeInfo(info.before.charCodeAt(info.before.length - 1), betweenHead, marker);
|
|
84482
|
-
if (open.inside) between = encodeCharacterReference(betweenHead) + between.slice(1);
|
|
84483
|
-
const betweenTail = between.charCodeAt(between.length - 1);
|
|
84484
|
-
const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
|
|
84485
|
-
if (close.inside) between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
|
|
84486
|
-
const after = tracker.move(marker);
|
|
84488
|
+
const exit = state.enter("phrasing");
|
|
84489
|
+
const value = state.containerPhrasing({
|
|
84490
|
+
type: "root",
|
|
84491
|
+
children: [node]
|
|
84492
|
+
}, info);
|
|
84487
84493
|
exit();
|
|
84488
|
-
|
|
84489
|
-
|
|
84490
|
-
|
|
84494
|
+
return value;
|
|
84495
|
+
}
|
|
84496
|
+
/**
|
|
84497
|
+
* Serialize an emphasis node as attention.
|
|
84498
|
+
*
|
|
84499
|
+
* @param {Emphasis} _
|
|
84500
|
+
* Node to serialize.
|
|
84501
|
+
* @param {State} state
|
|
84502
|
+
* Info passed around.
|
|
84503
|
+
* @returns {AttentionInfo}
|
|
84504
|
+
* Info on how to serialize the node.
|
|
84505
|
+
*/
|
|
84506
|
+
function attention$2(_, state) {
|
|
84507
|
+
return {
|
|
84508
|
+
construct: "emphasis",
|
|
84509
|
+
markers: checkEmphasis(state) === "*" ? ["*", "_"] : ["_", "*"],
|
|
84510
|
+
sizes: [1]
|
|
84491
84511
|
};
|
|
84492
|
-
return before + between + after;
|
|
84493
84512
|
}
|
|
84494
84513
|
/**
|
|
84514
|
+
* Peek at this node.
|
|
84515
|
+
*
|
|
84495
84516
|
* @param {Emphasis} _
|
|
84517
|
+
* Node to serialize.
|
|
84496
84518
|
* @param {Parents | undefined} _1
|
|
84519
|
+
* Parent node.
|
|
84497
84520
|
* @param {State} state
|
|
84521
|
+
* Info passed around.
|
|
84498
84522
|
* @returns {string}
|
|
84523
|
+
* Start of the serialized markdown.
|
|
84499
84524
|
*/
|
|
84500
|
-
function
|
|
84525
|
+
function peek$1(_, _1, state) {
|
|
84501
84526
|
return state.options.emphasis || "*";
|
|
84502
84527
|
}
|
|
84503
84528
|
//#endregion
|
|
84504
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84529
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js
|
|
84530
|
+
/**
|
|
84531
|
+
* Encode a code point as a character reference.
|
|
84532
|
+
*
|
|
84533
|
+
* @param {number} code
|
|
84534
|
+
* Code point to encode.
|
|
84535
|
+
* @returns {string}
|
|
84536
|
+
* Encoded character reference.
|
|
84537
|
+
*/
|
|
84538
|
+
function encodeCharacterReference(code) {
|
|
84539
|
+
return "&#x" + code.toString(16).toUpperCase() + ";";
|
|
84540
|
+
}
|
|
84541
|
+
//#endregion
|
|
84542
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
|
|
84505
84543
|
/**
|
|
84506
84544
|
* @import {State} from 'mdast-util-to-markdown'
|
|
84507
84545
|
* @import {Heading} from 'mdast'
|
|
84508
84546
|
*/
|
|
84509
84547
|
/**
|
|
84548
|
+
* Checks if a heading can be formatted as a setext heading.
|
|
84549
|
+
*
|
|
84510
84550
|
* @param {Heading} node
|
|
84551
|
+
* Node to check.
|
|
84511
84552
|
* @param {State} state
|
|
84553
|
+
* Info passed around.
|
|
84512
84554
|
* @returns {boolean}
|
|
84555
|
+
* Whether the heading can be formatted as a setext heading.
|
|
84513
84556
|
*/
|
|
84514
84557
|
function formatHeadingAsSetext(node, state) {
|
|
84515
84558
|
let literalWithBreak = false;
|
|
@@ -84522,17 +84565,24 @@ function formatHeadingAsSetext(node, state) {
|
|
|
84522
84565
|
return Boolean((!node.depth || node.depth < 3) && toString(node) && (state.options.setext || literalWithBreak));
|
|
84523
84566
|
}
|
|
84524
84567
|
//#endregion
|
|
84525
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84568
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/heading.js
|
|
84526
84569
|
/**
|
|
84527
84570
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84528
84571
|
* @import {Heading, Parents} from 'mdast'
|
|
84529
84572
|
*/
|
|
84530
84573
|
/**
|
|
84574
|
+
* Serialize a heading node.
|
|
84575
|
+
*
|
|
84531
84576
|
* @param {Heading} node
|
|
84577
|
+
* Node to serialize.
|
|
84532
84578
|
* @param {Parents | undefined} _
|
|
84579
|
+
* Parent node.
|
|
84533
84580
|
* @param {State} state
|
|
84581
|
+
* Info passed around.
|
|
84534
84582
|
* @param {Info} info
|
|
84583
|
+
* Info on surrounding context.
|
|
84535
84584
|
* @returns {string}
|
|
84585
|
+
* Serialized markdown.
|
|
84536
84586
|
*/
|
|
84537
84587
|
function heading$1(node, _, state, info) {
|
|
84538
84588
|
const rank = Math.max(Math.min(6, node.depth || 1), 1);
|
|
@@ -84558,7 +84608,8 @@ function heading$1(node, _, state, info) {
|
|
|
84558
84608
|
after: "\n",
|
|
84559
84609
|
...tracker.current()
|
|
84560
84610
|
});
|
|
84561
|
-
|
|
84611
|
+
const head = value.charCodeAt(0);
|
|
84612
|
+
if (head === 9 || head === 32) value = encodeCharacterReference(head) + value.slice(1);
|
|
84562
84613
|
value = value ? sequence + " " + value : sequence;
|
|
84563
84614
|
if (state.options.closeAtx) value += " " + sequence;
|
|
84564
84615
|
subexit();
|
|
@@ -84566,37 +84617,51 @@ function heading$1(node, _, state, info) {
|
|
|
84566
84617
|
return value;
|
|
84567
84618
|
}
|
|
84568
84619
|
//#endregion
|
|
84569
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84620
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/html.js
|
|
84570
84621
|
/**
|
|
84571
84622
|
* @import {Html} from 'mdast'
|
|
84572
84623
|
*/
|
|
84573
84624
|
html$1.peek = htmlPeek;
|
|
84574
84625
|
/**
|
|
84626
|
+
* Serialize an HTML node.
|
|
84627
|
+
*
|
|
84575
84628
|
* @param {Html} node
|
|
84629
|
+
* Node to serialize.
|
|
84576
84630
|
* @returns {string}
|
|
84631
|
+
* Serialized markdown.
|
|
84577
84632
|
*/
|
|
84578
84633
|
function html$1(node) {
|
|
84579
84634
|
return node.value || "";
|
|
84580
84635
|
}
|
|
84581
84636
|
/**
|
|
84637
|
+
* Peek at this node.
|
|
84638
|
+
*
|
|
84582
84639
|
* @returns {string}
|
|
84640
|
+
* Start of the serialized markdown.
|
|
84583
84641
|
*/
|
|
84584
84642
|
function htmlPeek() {
|
|
84585
84643
|
return "<";
|
|
84586
84644
|
}
|
|
84587
84645
|
//#endregion
|
|
84588
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84646
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/image.js
|
|
84589
84647
|
/**
|
|
84590
84648
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84591
84649
|
* @import {Image, Parents} from 'mdast'
|
|
84592
84650
|
*/
|
|
84593
84651
|
image$1.peek = imagePeek;
|
|
84594
84652
|
/**
|
|
84653
|
+
* Serialize an image node.
|
|
84654
|
+
*
|
|
84595
84655
|
* @param {Image} node
|
|
84656
|
+
* Node to serialize.
|
|
84596
84657
|
* @param {Parents | undefined} _
|
|
84658
|
+
* Parent node.
|
|
84597
84659
|
* @param {State} state
|
|
84660
|
+
* Info passed around.
|
|
84598
84661
|
* @param {Info} info
|
|
84662
|
+
* Info on surrounding context.
|
|
84599
84663
|
* @returns {string}
|
|
84664
|
+
* Serialized markdown.
|
|
84600
84665
|
*/
|
|
84601
84666
|
function image$1(node, _, state, info) {
|
|
84602
84667
|
const quote = checkQuote(state);
|
|
@@ -84646,24 +84711,34 @@ function image$1(node, _, state, info) {
|
|
|
84646
84711
|
return value;
|
|
84647
84712
|
}
|
|
84648
84713
|
/**
|
|
84714
|
+
* Peek at this node.
|
|
84715
|
+
*
|
|
84649
84716
|
* @returns {string}
|
|
84717
|
+
* Start of the serialized markdown.
|
|
84650
84718
|
*/
|
|
84651
84719
|
function imagePeek() {
|
|
84652
84720
|
return "!";
|
|
84653
84721
|
}
|
|
84654
84722
|
//#endregion
|
|
84655
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84723
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
|
|
84656
84724
|
/**
|
|
84657
84725
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84658
84726
|
* @import {ImageReference, Parents} from 'mdast'
|
|
84659
84727
|
*/
|
|
84660
84728
|
imageReference$1.peek = imageReferencePeek;
|
|
84661
84729
|
/**
|
|
84730
|
+
* Serialize an image reference node.
|
|
84731
|
+
*
|
|
84662
84732
|
* @param {ImageReference} node
|
|
84733
|
+
* Node to serialize.
|
|
84663
84734
|
* @param {Parents | undefined} _
|
|
84735
|
+
* Parent node.
|
|
84664
84736
|
* @param {State} state
|
|
84737
|
+
* Info passed around.
|
|
84665
84738
|
* @param {Info} info
|
|
84739
|
+
* Info on surrounding context.
|
|
84666
84740
|
* @returns {string}
|
|
84741
|
+
* Serialized markdown.
|
|
84667
84742
|
*/
|
|
84668
84743
|
function imageReference$1(node, _, state, info) {
|
|
84669
84744
|
const type = node.referenceType;
|
|
@@ -84679,7 +84754,9 @@ function imageReference$1(node, _, state, info) {
|
|
|
84679
84754
|
value += tracker.move(alt + "][");
|
|
84680
84755
|
subexit();
|
|
84681
84756
|
const stack = state.stack;
|
|
84682
|
-
state.stack =
|
|
84757
|
+
state.stack = stack.filter(function(d) {
|
|
84758
|
+
return d !== "phrasing";
|
|
84759
|
+
});
|
|
84683
84760
|
subexit = state.enter("reference");
|
|
84684
84761
|
const reference = state.safe(state.associationId(node), {
|
|
84685
84762
|
before: value,
|
|
@@ -84695,36 +84772,45 @@ function imageReference$1(node, _, state, info) {
|
|
|
84695
84772
|
return value;
|
|
84696
84773
|
}
|
|
84697
84774
|
/**
|
|
84775
|
+
* Peek at this node.
|
|
84776
|
+
*
|
|
84698
84777
|
* @returns {string}
|
|
84778
|
+
* Start of the serialized markdown.
|
|
84699
84779
|
*/
|
|
84700
84780
|
function imageReferencePeek() {
|
|
84701
84781
|
return "!";
|
|
84702
84782
|
}
|
|
84703
84783
|
//#endregion
|
|
84704
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84784
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
|
|
84705
84785
|
/**
|
|
84706
84786
|
* @import {State} from 'mdast-util-to-markdown'
|
|
84707
84787
|
* @import {InlineCode, Parents} from 'mdast'
|
|
84708
84788
|
*/
|
|
84709
84789
|
inlineCode$1.peek = inlineCodePeek;
|
|
84710
84790
|
/**
|
|
84791
|
+
* Serialize an inline code node.
|
|
84792
|
+
*
|
|
84711
84793
|
* @param {InlineCode} node
|
|
84794
|
+
* Node to serialize.
|
|
84712
84795
|
* @param {Parents | undefined} _
|
|
84796
|
+
* Parent node.
|
|
84713
84797
|
* @param {State} state
|
|
84798
|
+
* Info passed around.
|
|
84714
84799
|
* @returns {string}
|
|
84800
|
+
* Serialized markdown.
|
|
84715
84801
|
*/
|
|
84716
84802
|
function inlineCode$1(node, _, state) {
|
|
84717
84803
|
let value = node.value || "";
|
|
84718
84804
|
let sequence = "`";
|
|
84719
84805
|
let index = -1;
|
|
84720
84806
|
while (new RegExp("(^|[^`])" + sequence + "([^`]|$)").test(value)) sequence += "`";
|
|
84721
|
-
if (/[
|
|
84807
|
+
if (/[^\n\r ]/.test(value) && (/^[\n\r ]/.test(value) && /[\n\r ]$/.test(value) || /^`|`$/.test(value))) value = " " + value + " ";
|
|
84722
84808
|
while (++index < state.unsafe.length) {
|
|
84723
84809
|
const pattern = state.unsafe[index];
|
|
84724
84810
|
const expression = state.compilePattern(pattern);
|
|
84811
|
+
if (!pattern.atBreak) continue;
|
|
84725
84812
|
/** @type {RegExpExecArray | null} */
|
|
84726
84813
|
let match;
|
|
84727
|
-
if (!pattern.atBreak) continue;
|
|
84728
84814
|
while (match = expression.exec(value)) {
|
|
84729
84815
|
let position = match.index;
|
|
84730
84816
|
if (value.charCodeAt(position) === 10 && value.charCodeAt(position - 1) === 13) position--;
|
|
@@ -84734,28 +84820,36 @@ function inlineCode$1(node, _, state) {
|
|
|
84734
84820
|
return sequence + value + sequence;
|
|
84735
84821
|
}
|
|
84736
84822
|
/**
|
|
84823
|
+
* Peek at this node.
|
|
84824
|
+
*
|
|
84737
84825
|
* @returns {string}
|
|
84826
|
+
* Start of the serialized markdown.
|
|
84738
84827
|
*/
|
|
84739
84828
|
function inlineCodePeek() {
|
|
84740
84829
|
return "`";
|
|
84741
84830
|
}
|
|
84742
84831
|
//#endregion
|
|
84743
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84832
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
|
|
84744
84833
|
/**
|
|
84745
84834
|
* @import {State} from 'mdast-util-to-markdown'
|
|
84746
84835
|
* @import {Link} from 'mdast'
|
|
84747
84836
|
*/
|
|
84748
84837
|
/**
|
|
84838
|
+
* Checks if a link can be formatted as an autolink.
|
|
84839
|
+
*
|
|
84749
84840
|
* @param {Link} node
|
|
84841
|
+
* Node to check.
|
|
84750
84842
|
* @param {State} state
|
|
84843
|
+
* Info passed around.
|
|
84751
84844
|
* @returns {boolean}
|
|
84845
|
+
* Whether the link can be formatted as an autolink.
|
|
84752
84846
|
*/
|
|
84753
84847
|
function formatLinkAsAutolink(node, state) {
|
|
84754
84848
|
const raw = toString(node);
|
|
84755
|
-
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
|
|
84849
|
+
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));
|
|
84756
84850
|
}
|
|
84757
84851
|
//#endregion
|
|
84758
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84852
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/link.js
|
|
84759
84853
|
/**
|
|
84760
84854
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84761
84855
|
* @import {Link, Parents} from 'mdast'
|
|
@@ -84763,24 +84857,29 @@ function formatLinkAsAutolink(node, state) {
|
|
|
84763
84857
|
*/
|
|
84764
84858
|
link$1.peek = linkPeek;
|
|
84765
84859
|
/**
|
|
84860
|
+
* Serialize a link node.
|
|
84861
|
+
*
|
|
84766
84862
|
* @param {Link} node
|
|
84863
|
+
* Node to serialize.
|
|
84767
84864
|
* @param {Parents | undefined} _
|
|
84865
|
+
* Parent node.
|
|
84768
84866
|
* @param {State} state
|
|
84867
|
+
* Info passed around.
|
|
84769
84868
|
* @param {Info} info
|
|
84869
|
+
* Info on surrounding context.
|
|
84770
84870
|
* @returns {string}
|
|
84871
|
+
* Serialized markdown.
|
|
84771
84872
|
*/
|
|
84772
84873
|
function link$1(node, _, state, info) {
|
|
84773
84874
|
const quote = checkQuote(state);
|
|
84774
84875
|
const suffix = quote === "\"" ? "Quote" : "Apostrophe";
|
|
84775
84876
|
const tracker = state.createTracker(info);
|
|
84776
|
-
/** @type {Exit} */
|
|
84777
|
-
let exit;
|
|
84778
|
-
/** @type {Exit} */
|
|
84779
|
-
let subexit;
|
|
84780
84877
|
if (formatLinkAsAutolink(node, state)) {
|
|
84781
84878
|
const stack = state.stack;
|
|
84782
|
-
state.stack =
|
|
84783
|
-
|
|
84879
|
+
state.stack = stack.filter(function(d) {
|
|
84880
|
+
return d !== "phrasing";
|
|
84881
|
+
});
|
|
84882
|
+
const exit = state.enter("autolink");
|
|
84784
84883
|
let value = tracker.move("<");
|
|
84785
84884
|
value += tracker.move(state.containerPhrasing(node, {
|
|
84786
84885
|
before: value,
|
|
@@ -84792,8 +84891,8 @@ function link$1(node, _, state, info) {
|
|
|
84792
84891
|
state.stack = stack;
|
|
84793
84892
|
return value;
|
|
84794
84893
|
}
|
|
84795
|
-
exit = state.enter("link");
|
|
84796
|
-
subexit = state.enter("label");
|
|
84894
|
+
const exit = state.enter("link");
|
|
84895
|
+
let subexit = state.enter("label");
|
|
84797
84896
|
let value = tracker.move("[");
|
|
84798
84897
|
value += tracker.move(state.containerPhrasing(node, {
|
|
84799
84898
|
before: value,
|
|
@@ -84836,27 +84935,40 @@ function link$1(node, _, state, info) {
|
|
|
84836
84935
|
return value;
|
|
84837
84936
|
}
|
|
84838
84937
|
/**
|
|
84938
|
+
* Peek at this node.
|
|
84939
|
+
*
|
|
84839
84940
|
* @param {Link} node
|
|
84941
|
+
* Node to peek at.
|
|
84840
84942
|
* @param {Parents | undefined} _
|
|
84943
|
+
* Parent node.
|
|
84841
84944
|
* @param {State} state
|
|
84945
|
+
* Info passed around.
|
|
84842
84946
|
* @returns {string}
|
|
84947
|
+
* Start of the serialized markdown.
|
|
84843
84948
|
*/
|
|
84844
84949
|
function linkPeek(node, _, state) {
|
|
84845
84950
|
return formatLinkAsAutolink(node, state) ? "<" : "[";
|
|
84846
84951
|
}
|
|
84847
84952
|
//#endregion
|
|
84848
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
84953
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
|
|
84849
84954
|
/**
|
|
84850
84955
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84851
84956
|
* @import {LinkReference, Parents} from 'mdast'
|
|
84852
84957
|
*/
|
|
84853
84958
|
linkReference$1.peek = linkReferencePeek;
|
|
84854
84959
|
/**
|
|
84960
|
+
* Serialize a link reference node.
|
|
84961
|
+
*
|
|
84855
84962
|
* @param {LinkReference} node
|
|
84963
|
+
* Node to serialize.
|
|
84856
84964
|
* @param {Parents | undefined} _
|
|
84965
|
+
* Parent node.
|
|
84857
84966
|
* @param {State} state
|
|
84967
|
+
* Info passed around.
|
|
84858
84968
|
* @param {Info} info
|
|
84969
|
+
* Info on surrounding context.
|
|
84859
84970
|
* @returns {string}
|
|
84971
|
+
* Serialized markdown.
|
|
84860
84972
|
*/
|
|
84861
84973
|
function linkReference$1(node, _, state, info) {
|
|
84862
84974
|
const type = node.referenceType;
|
|
@@ -84872,7 +84984,9 @@ function linkReference$1(node, _, state, info) {
|
|
|
84872
84984
|
value += tracker.move(text + "][");
|
|
84873
84985
|
subexit();
|
|
84874
84986
|
const stack = state.stack;
|
|
84875
|
-
state.stack =
|
|
84987
|
+
state.stack = stack.filter(function(d) {
|
|
84988
|
+
return d !== "phrasing";
|
|
84989
|
+
});
|
|
84876
84990
|
subexit = state.enter("reference");
|
|
84877
84991
|
const reference = state.safe(state.associationId(node), {
|
|
84878
84992
|
before: value,
|
|
@@ -84888,19 +85002,26 @@ function linkReference$1(node, _, state, info) {
|
|
|
84888
85002
|
return value;
|
|
84889
85003
|
}
|
|
84890
85004
|
/**
|
|
85005
|
+
* Peek at this node.
|
|
85006
|
+
*
|
|
84891
85007
|
* @returns {string}
|
|
85008
|
+
* Start of the serialized markdown.
|
|
84892
85009
|
*/
|
|
84893
85010
|
function linkReferencePeek() {
|
|
84894
85011
|
return "[";
|
|
84895
85012
|
}
|
|
84896
85013
|
//#endregion
|
|
84897
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85014
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
|
|
84898
85015
|
/**
|
|
84899
85016
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
84900
85017
|
*/
|
|
84901
85018
|
/**
|
|
85019
|
+
* Checks the preferred list bullet option.
|
|
85020
|
+
*
|
|
84902
85021
|
* @param {State} state
|
|
85022
|
+
* Info passed around.
|
|
84903
85023
|
* @returns {Exclude<Options['bullet'], null | undefined>}
|
|
85024
|
+
* Preferred list bullet.
|
|
84904
85025
|
*/
|
|
84905
85026
|
function checkBullet(state) {
|
|
84906
85027
|
const marker = state.options.bullet || "*";
|
|
@@ -84908,13 +85029,17 @@ function checkBullet(state) {
|
|
|
84908
85029
|
return marker;
|
|
84909
85030
|
}
|
|
84910
85031
|
//#endregion
|
|
84911
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85032
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
|
|
84912
85033
|
/**
|
|
84913
85034
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
84914
85035
|
*/
|
|
84915
85036
|
/**
|
|
85037
|
+
* Checks the preferred alternate list bullet option.
|
|
85038
|
+
*
|
|
84916
85039
|
* @param {State} state
|
|
85040
|
+
* Info passed around.
|
|
84917
85041
|
* @returns {Exclude<Options['bullet'], null | undefined>}
|
|
85042
|
+
* Preferred alternate list bullet.
|
|
84918
85043
|
*/
|
|
84919
85044
|
function checkBulletOther(state) {
|
|
84920
85045
|
const bullet = checkBullet(state);
|
|
@@ -84925,13 +85050,17 @@ function checkBulletOther(state) {
|
|
|
84925
85050
|
return bulletOther;
|
|
84926
85051
|
}
|
|
84927
85052
|
//#endregion
|
|
84928
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85053
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
|
|
84929
85054
|
/**
|
|
84930
85055
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
84931
85056
|
*/
|
|
84932
85057
|
/**
|
|
85058
|
+
* Checks the preferred ordered list bullet option.
|
|
85059
|
+
*
|
|
84933
85060
|
* @param {State} state
|
|
85061
|
+
* Info passed around.
|
|
84934
85062
|
* @returns {Exclude<Options['bulletOrdered'], null | undefined>}
|
|
85063
|
+
* Preferred ordered list bullet.
|
|
84935
85064
|
*/
|
|
84936
85065
|
function checkBulletOrdered(state) {
|
|
84937
85066
|
const marker = state.options.bulletOrdered || ".";
|
|
@@ -84939,13 +85068,17 @@ function checkBulletOrdered(state) {
|
|
|
84939
85068
|
return marker;
|
|
84940
85069
|
}
|
|
84941
85070
|
//#endregion
|
|
84942
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85071
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-rule.js
|
|
84943
85072
|
/**
|
|
84944
85073
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
84945
85074
|
*/
|
|
84946
85075
|
/**
|
|
85076
|
+
* Checks the preferred rule option.
|
|
85077
|
+
*
|
|
84947
85078
|
* @param {State} state
|
|
85079
|
+
* Info passed around.
|
|
84948
85080
|
* @returns {Exclude<Options['rule'], null | undefined>}
|
|
85081
|
+
* Preferred rule marker.
|
|
84949
85082
|
*/
|
|
84950
85083
|
function checkRule(state) {
|
|
84951
85084
|
const marker = state.options.rule || "*";
|
|
@@ -84953,17 +85086,24 @@ function checkRule(state) {
|
|
|
84953
85086
|
return marker;
|
|
84954
85087
|
}
|
|
84955
85088
|
//#endregion
|
|
84956
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85089
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/list.js
|
|
84957
85090
|
/**
|
|
84958
85091
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
84959
85092
|
* @import {List, Parents} from 'mdast'
|
|
84960
85093
|
*/
|
|
84961
85094
|
/**
|
|
85095
|
+
* Serialize a list node.
|
|
85096
|
+
*
|
|
84962
85097
|
* @param {List} node
|
|
85098
|
+
* Node to serialize.
|
|
84963
85099
|
* @param {Parents | undefined} parent
|
|
85100
|
+
* Parent node.
|
|
84964
85101
|
* @param {State} state
|
|
85102
|
+
* Info passed around.
|
|
84965
85103
|
* @param {Info} info
|
|
85104
|
+
* Info on surrounding context.
|
|
84966
85105
|
* @returns {string}
|
|
85106
|
+
* Serialized markdown.
|
|
84967
85107
|
*/
|
|
84968
85108
|
function list$2(node, parent, state, info) {
|
|
84969
85109
|
const exit = state.enter("list");
|
|
@@ -84996,13 +85136,17 @@ function list$2(node, parent, state, info) {
|
|
|
84996
85136
|
return value;
|
|
84997
85137
|
}
|
|
84998
85138
|
//#endregion
|
|
84999
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85139
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
|
|
85000
85140
|
/**
|
|
85001
85141
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
85002
85142
|
*/
|
|
85003
85143
|
/**
|
|
85144
|
+
* Checks the preferred list item indent option.
|
|
85145
|
+
*
|
|
85004
85146
|
* @param {State} state
|
|
85147
|
+
* Info passed around.
|
|
85005
85148
|
* @returns {Exclude<Options['listItemIndent'], null | undefined>}
|
|
85149
|
+
* Preferred list item indent.
|
|
85006
85150
|
*/
|
|
85007
85151
|
function checkListItemIndent(state) {
|
|
85008
85152
|
const style = state.options.listItemIndent || "one";
|
|
@@ -85010,17 +85154,24 @@ function checkListItemIndent(state) {
|
|
|
85010
85154
|
return style;
|
|
85011
85155
|
}
|
|
85012
85156
|
//#endregion
|
|
85013
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85157
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/list-item.js
|
|
85014
85158
|
/**
|
|
85015
85159
|
* @import {Info, Map, State} from 'mdast-util-to-markdown'
|
|
85016
85160
|
* @import {ListItem, Parents} from 'mdast'
|
|
85017
85161
|
*/
|
|
85018
85162
|
/**
|
|
85163
|
+
* Serialize a list item node.
|
|
85164
|
+
*
|
|
85019
85165
|
* @param {ListItem} node
|
|
85166
|
+
* Node to serialize.
|
|
85020
85167
|
* @param {Parents | undefined} parent
|
|
85168
|
+
* Parent node.
|
|
85021
85169
|
* @param {State} state
|
|
85170
|
+
* Info passed around.
|
|
85022
85171
|
* @param {Info} info
|
|
85172
|
+
* Info on surrounding context.
|
|
85023
85173
|
* @returns {string}
|
|
85174
|
+
* Serialized markdown.
|
|
85024
85175
|
*/
|
|
85025
85176
|
function listItem$1(node, parent, state, info) {
|
|
85026
85177
|
const listItemIndent = checkListItemIndent(state);
|
|
@@ -85035,24 +85186,35 @@ function listItem$1(node, parent, state, info) {
|
|
|
85035
85186
|
const value = state.indentLines(state.containerFlow(node, tracker.current()), map);
|
|
85036
85187
|
exit();
|
|
85037
85188
|
return value;
|
|
85038
|
-
/**
|
|
85189
|
+
/**
|
|
85190
|
+
* Indent lines of the list item.
|
|
85191
|
+
*
|
|
85192
|
+
* @type {Map}
|
|
85193
|
+
*/
|
|
85039
85194
|
function map(line, index, blank) {
|
|
85040
85195
|
if (index) return (blank ? "" : " ".repeat(size)) + line;
|
|
85041
85196
|
return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line;
|
|
85042
85197
|
}
|
|
85043
85198
|
}
|
|
85044
85199
|
//#endregion
|
|
85045
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85200
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
|
|
85046
85201
|
/**
|
|
85047
85202
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
85048
85203
|
* @import {Paragraph, Parents} from 'mdast'
|
|
85049
85204
|
*/
|
|
85050
85205
|
/**
|
|
85206
|
+
* Serialize a paragraph node.
|
|
85207
|
+
*
|
|
85051
85208
|
* @param {Paragraph} node
|
|
85209
|
+
* Node to serialize.
|
|
85052
85210
|
* @param {Parents | undefined} _
|
|
85211
|
+
* Parent node.
|
|
85053
85212
|
* @param {State} state
|
|
85213
|
+
* Info passed around.
|
|
85054
85214
|
* @param {Info} info
|
|
85215
|
+
* Info on surrounding context.
|
|
85055
85216
|
* @returns {string}
|
|
85217
|
+
* Serialized markdown.
|
|
85056
85218
|
*/
|
|
85057
85219
|
function paragraph$1(node, _, state, info) {
|
|
85058
85220
|
const exit = state.enter("paragraph");
|
|
@@ -85063,31 +85225,46 @@ function paragraph$1(node, _, state, info) {
|
|
|
85063
85225
|
return value;
|
|
85064
85226
|
}
|
|
85065
85227
|
//#endregion
|
|
85066
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85228
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/root.js
|
|
85067
85229
|
/**
|
|
85068
85230
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
85069
85231
|
* @import {Parents, Root} from 'mdast'
|
|
85070
85232
|
*/
|
|
85071
85233
|
/**
|
|
85234
|
+
* Serialize a root node.
|
|
85235
|
+
*
|
|
85072
85236
|
* @param {Root} node
|
|
85237
|
+
* Node to serialize.
|
|
85073
85238
|
* @param {Parents | undefined} _
|
|
85239
|
+
* Parent node.
|
|
85074
85240
|
* @param {State} state
|
|
85241
|
+
* Info passed around.
|
|
85075
85242
|
* @param {Info} info
|
|
85243
|
+
* Info on surrounding context.
|
|
85076
85244
|
* @returns {string}
|
|
85245
|
+
* Serialized markdown.
|
|
85077
85246
|
*/
|
|
85078
85247
|
function root$1(node, _, state, info) {
|
|
85079
|
-
|
|
85080
|
-
return phrasing$
|
|
85081
|
-
})
|
|
85248
|
+
if (!node.children.some(function(d) {
|
|
85249
|
+
return phrasing$2(d);
|
|
85250
|
+
})) return state.containerFlow(node, info);
|
|
85251
|
+
const exit = state.enter("phrasing");
|
|
85252
|
+
const value = state.containerPhrasing(node, info);
|
|
85253
|
+
exit();
|
|
85254
|
+
return value;
|
|
85082
85255
|
}
|
|
85083
85256
|
//#endregion
|
|
85084
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85257
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-strong.js
|
|
85085
85258
|
/**
|
|
85086
85259
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
85087
85260
|
*/
|
|
85088
85261
|
/**
|
|
85262
|
+
* Checks the preferred strong option.
|
|
85263
|
+
*
|
|
85089
85264
|
* @param {State} state
|
|
85265
|
+
* Info passed around.
|
|
85090
85266
|
* @returns {Exclude<Options['strong'], null | undefined>}
|
|
85267
|
+
* Preferred strong marker.
|
|
85091
85268
|
*/
|
|
85092
85269
|
function checkStrong(state) {
|
|
85093
85270
|
const marker = state.options.strong || "*";
|
|
@@ -85095,76 +85272,105 @@ function checkStrong(state) {
|
|
|
85095
85272
|
return marker;
|
|
85096
85273
|
}
|
|
85097
85274
|
//#endregion
|
|
85098
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85275
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/strong.js
|
|
85099
85276
|
/**
|
|
85100
|
-
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
85277
|
+
* @import {AttentionInfo, Info, State} from 'mdast-util-to-markdown'
|
|
85101
85278
|
* @import {Parents, Strong} from 'mdast'
|
|
85102
85279
|
*/
|
|
85103
|
-
strong$1.
|
|
85280
|
+
strong$1.attention = attention$1;
|
|
85281
|
+
strong$1.peek = peek;
|
|
85104
85282
|
/**
|
|
85283
|
+
* Serialize a strong node.
|
|
85284
|
+
*
|
|
85285
|
+
* Attention is properly handled by `containerPhrasing`.
|
|
85286
|
+
*
|
|
85105
85287
|
* @param {Strong} node
|
|
85288
|
+
* Node to serialize.
|
|
85106
85289
|
* @param {Parents | undefined} _
|
|
85290
|
+
* Parent node.
|
|
85107
85291
|
* @param {State} state
|
|
85292
|
+
* Info passed around.
|
|
85108
85293
|
* @param {Info} info
|
|
85294
|
+
* Info on surrounding context.
|
|
85109
85295
|
* @returns {string}
|
|
85296
|
+
* Serialized markdown.
|
|
85110
85297
|
*/
|
|
85111
85298
|
function strong$1(node, _, state, info) {
|
|
85112
|
-
const
|
|
85113
|
-
const
|
|
85114
|
-
|
|
85115
|
-
|
|
85116
|
-
|
|
85117
|
-
after: marker,
|
|
85118
|
-
before,
|
|
85119
|
-
...tracker.current()
|
|
85120
|
-
}));
|
|
85121
|
-
const betweenHead = between.charCodeAt(0);
|
|
85122
|
-
const open = encodeInfo(info.before.charCodeAt(info.before.length - 1), betweenHead, marker);
|
|
85123
|
-
if (open.inside) between = encodeCharacterReference(betweenHead) + between.slice(1);
|
|
85124
|
-
const betweenTail = between.charCodeAt(between.length - 1);
|
|
85125
|
-
const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
|
|
85126
|
-
if (close.inside) between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
|
|
85127
|
-
const after = tracker.move(marker + marker);
|
|
85299
|
+
const exit = state.enter("phrasing");
|
|
85300
|
+
const value = state.containerPhrasing({
|
|
85301
|
+
type: "root",
|
|
85302
|
+
children: [node]
|
|
85303
|
+
}, info);
|
|
85128
85304
|
exit();
|
|
85129
|
-
|
|
85130
|
-
|
|
85131
|
-
|
|
85305
|
+
return value;
|
|
85306
|
+
}
|
|
85307
|
+
/**
|
|
85308
|
+
* Serialize a strong node as attention.
|
|
85309
|
+
*
|
|
85310
|
+
* @param {Strong} _
|
|
85311
|
+
* Node to serialize.
|
|
85312
|
+
* @param {State} state
|
|
85313
|
+
* Info passed around.
|
|
85314
|
+
* @returns {AttentionInfo}
|
|
85315
|
+
* Info on how to serialize the node.
|
|
85316
|
+
*/
|
|
85317
|
+
function attention$1(_, state) {
|
|
85318
|
+
return {
|
|
85319
|
+
construct: "strong",
|
|
85320
|
+
markers: checkStrong(state) === "*" ? ["*", "_"] : ["_", "*"],
|
|
85321
|
+
sizes: [2]
|
|
85132
85322
|
};
|
|
85133
|
-
return before + between + after;
|
|
85134
85323
|
}
|
|
85135
85324
|
/**
|
|
85325
|
+
* Peek at this node.
|
|
85326
|
+
*
|
|
85136
85327
|
* @param {Strong} _
|
|
85328
|
+
* Node to serialize.
|
|
85137
85329
|
* @param {Parents | undefined} _1
|
|
85330
|
+
* Parent node.
|
|
85138
85331
|
* @param {State} state
|
|
85332
|
+
* Info passed around.
|
|
85139
85333
|
* @returns {string}
|
|
85334
|
+
* Start of the serialized markdown.
|
|
85140
85335
|
*/
|
|
85141
|
-
function
|
|
85336
|
+
function peek(_, _1, state) {
|
|
85142
85337
|
return state.options.strong || "*";
|
|
85143
85338
|
}
|
|
85144
85339
|
//#endregion
|
|
85145
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85340
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/text.js
|
|
85146
85341
|
/**
|
|
85147
85342
|
* @import {Info, State} from 'mdast-util-to-markdown'
|
|
85148
85343
|
* @import {Parents, Text} from 'mdast'
|
|
85149
85344
|
*/
|
|
85150
85345
|
/**
|
|
85346
|
+
* Serialize a text node.
|
|
85347
|
+
*
|
|
85151
85348
|
* @param {Text} node
|
|
85349
|
+
* Node to serialize.
|
|
85152
85350
|
* @param {Parents | undefined} _
|
|
85351
|
+
* Parent node.
|
|
85153
85352
|
* @param {State} state
|
|
85353
|
+
* Info passed around.
|
|
85154
85354
|
* @param {Info} info
|
|
85355
|
+
* Info on surrounding context.
|
|
85155
85356
|
* @returns {string}
|
|
85357
|
+
* Serialized markdown.
|
|
85156
85358
|
*/
|
|
85157
85359
|
function text$4(node, _, state, info) {
|
|
85158
85360
|
return state.safe(node.value, info);
|
|
85159
85361
|
}
|
|
85160
85362
|
//#endregion
|
|
85161
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85363
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
|
|
85162
85364
|
/**
|
|
85163
85365
|
* @import {Options, State} from 'mdast-util-to-markdown'
|
|
85164
85366
|
*/
|
|
85165
85367
|
/**
|
|
85368
|
+
* Checks the preferred rule repetition option.
|
|
85369
|
+
*
|
|
85166
85370
|
* @param {State} state
|
|
85371
|
+
* Info passed around.
|
|
85167
85372
|
* @returns {Exclude<Options['ruleRepetition'], null | undefined>}
|
|
85373
|
+
* Preferred rule repetition.
|
|
85168
85374
|
*/
|
|
85169
85375
|
function checkRuleRepetition(state) {
|
|
85170
85376
|
const repetition = state.options.ruleRepetition || 3;
|
|
@@ -85172,30 +85378,36 @@ function checkRuleRepetition(state) {
|
|
|
85172
85378
|
return repetition;
|
|
85173
85379
|
}
|
|
85174
85380
|
//#endregion
|
|
85175
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85381
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
|
|
85176
85382
|
/**
|
|
85177
85383
|
* @import {State} from 'mdast-util-to-markdown'
|
|
85178
85384
|
* @import {Parents, ThematicBreak} from 'mdast'
|
|
85179
85385
|
*/
|
|
85180
85386
|
/**
|
|
85387
|
+
* Serialize a thematic break node.
|
|
85388
|
+
*
|
|
85181
85389
|
* @param {ThematicBreak} _
|
|
85390
|
+
* Node to serialize.
|
|
85182
85391
|
* @param {Parents | undefined} _1
|
|
85392
|
+
* Parent node.
|
|
85183
85393
|
* @param {State} state
|
|
85394
|
+
* Info passed around.
|
|
85184
85395
|
* @returns {string}
|
|
85396
|
+
* Serialized markdown.
|
|
85185
85397
|
*/
|
|
85186
85398
|
function thematicBreak$2(_, _1, state) {
|
|
85187
85399
|
const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
|
|
85188
85400
|
return state.options.ruleSpaces ? value.slice(0, -1) : value;
|
|
85189
85401
|
}
|
|
85190
85402
|
//#endregion
|
|
85191
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85403
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/handle/index.js
|
|
85192
85404
|
/**
|
|
85193
85405
|
* Default (CommonMark) handlers.
|
|
85194
85406
|
*/
|
|
85195
85407
|
const handle = {
|
|
85196
85408
|
blockquote: blockquote$1,
|
|
85197
85409
|
break: hardBreak$1,
|
|
85198
|
-
code: code$
|
|
85410
|
+
code: code$3,
|
|
85199
85411
|
definition: definition$1,
|
|
85200
85412
|
emphasis: emphasis$1,
|
|
85201
85413
|
hardBreak: hardBreak$1,
|
|
@@ -85215,22 +85427,181 @@ const handle = {
|
|
|
85215
85427
|
thematicBreak: thematicBreak$2
|
|
85216
85428
|
};
|
|
85217
85429
|
//#endregion
|
|
85218
|
-
//#region node_modules/.pnpm/
|
|
85430
|
+
//#region node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js
|
|
85431
|
+
/**
|
|
85432
|
+
* List of lowercase HTML “block” tag names.
|
|
85433
|
+
*
|
|
85434
|
+
* The list, when parsing HTML (flow), results in more relaxed rules (condition
|
|
85435
|
+
* 6).
|
|
85436
|
+
* Because they are known blocks, the HTML-like syntax doesn’t have to be
|
|
85437
|
+
* strictly parsed.
|
|
85438
|
+
* For tag names not in this list, a more strict algorithm (condition 7) is used
|
|
85439
|
+
* to detect whether the HTML-like syntax is seen as HTML (flow) or not.
|
|
85440
|
+
*
|
|
85441
|
+
* This is copied from:
|
|
85442
|
+
* <https://spec.commonmark.org/0.30/#html-blocks>.
|
|
85443
|
+
*
|
|
85444
|
+
* > 👉 **Note**: `search` was added in `CommonMark@0.31`.
|
|
85445
|
+
*/
|
|
85446
|
+
const htmlBlockNames = [
|
|
85447
|
+
"address",
|
|
85448
|
+
"article",
|
|
85449
|
+
"aside",
|
|
85450
|
+
"base",
|
|
85451
|
+
"basefont",
|
|
85452
|
+
"blockquote",
|
|
85453
|
+
"body",
|
|
85454
|
+
"caption",
|
|
85455
|
+
"center",
|
|
85456
|
+
"col",
|
|
85457
|
+
"colgroup",
|
|
85458
|
+
"dd",
|
|
85459
|
+
"details",
|
|
85460
|
+
"dialog",
|
|
85461
|
+
"dir",
|
|
85462
|
+
"div",
|
|
85463
|
+
"dl",
|
|
85464
|
+
"dt",
|
|
85465
|
+
"fieldset",
|
|
85466
|
+
"figcaption",
|
|
85467
|
+
"figure",
|
|
85468
|
+
"footer",
|
|
85469
|
+
"form",
|
|
85470
|
+
"frame",
|
|
85471
|
+
"frameset",
|
|
85472
|
+
"h1",
|
|
85473
|
+
"h2",
|
|
85474
|
+
"h3",
|
|
85475
|
+
"h4",
|
|
85476
|
+
"h5",
|
|
85477
|
+
"h6",
|
|
85478
|
+
"head",
|
|
85479
|
+
"header",
|
|
85480
|
+
"hr",
|
|
85481
|
+
"html",
|
|
85482
|
+
"iframe",
|
|
85483
|
+
"legend",
|
|
85484
|
+
"li",
|
|
85485
|
+
"link",
|
|
85486
|
+
"main",
|
|
85487
|
+
"menu",
|
|
85488
|
+
"menuitem",
|
|
85489
|
+
"nav",
|
|
85490
|
+
"noframes",
|
|
85491
|
+
"ol",
|
|
85492
|
+
"optgroup",
|
|
85493
|
+
"option",
|
|
85494
|
+
"p",
|
|
85495
|
+
"param",
|
|
85496
|
+
"search",
|
|
85497
|
+
"section",
|
|
85498
|
+
"summary",
|
|
85499
|
+
"table",
|
|
85500
|
+
"tbody",
|
|
85501
|
+
"td",
|
|
85502
|
+
"tfoot",
|
|
85503
|
+
"th",
|
|
85504
|
+
"thead",
|
|
85505
|
+
"title",
|
|
85506
|
+
"tr",
|
|
85507
|
+
"track",
|
|
85508
|
+
"ul"
|
|
85509
|
+
];
|
|
85510
|
+
/**
|
|
85511
|
+
* List of lowercase HTML “raw” tag names.
|
|
85512
|
+
*
|
|
85513
|
+
* The list, when parsing HTML (flow), results in HTML that can include lines
|
|
85514
|
+
* without exiting, until a closing tag also in this list is found (condition
|
|
85515
|
+
* 1).
|
|
85516
|
+
*
|
|
85517
|
+
* This module is copied from:
|
|
85518
|
+
* <https://spec.commonmark.org/0.30/#html-blocks>.
|
|
85519
|
+
*
|
|
85520
|
+
* > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.
|
|
85521
|
+
*/
|
|
85522
|
+
const htmlRawNames = [
|
|
85523
|
+
"pre",
|
|
85524
|
+
"script",
|
|
85525
|
+
"style",
|
|
85526
|
+
"textarea"
|
|
85527
|
+
];
|
|
85528
|
+
//#endregion
|
|
85529
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/html-kind.js
|
|
85530
|
+
/**
|
|
85531
|
+
* @typedef {1 | 2 | 3 | 4 | 5 | 6 | 7} Kind
|
|
85532
|
+
* Kind of HTML (flow) element.
|
|
85533
|
+
*/
|
|
85534
|
+
/**
|
|
85535
|
+
* Infer the kind of HTML that `value` is.
|
|
85536
|
+
*
|
|
85537
|
+
* This works on valid trees as produced by `micromark`.
|
|
85538
|
+
* Kinds:
|
|
85539
|
+
*
|
|
85540
|
+
* 1. raw
|
|
85541
|
+
* 2. comment
|
|
85542
|
+
* 3. instruction
|
|
85543
|
+
* 4. declaration
|
|
85544
|
+
* 5. cdata
|
|
85545
|
+
* 6. block
|
|
85546
|
+
* 7. other
|
|
85547
|
+
*
|
|
85548
|
+
* See: <https://spec.commonmark.org/0.31.2/#html-blocks>.
|
|
85549
|
+
*
|
|
85550
|
+
* @param {string} value
|
|
85551
|
+
* HTML.
|
|
85552
|
+
* @returns {Kind | undefined}
|
|
85553
|
+
* Kind; `undefined` if unknown.
|
|
85554
|
+
*/
|
|
85555
|
+
function htmlKind(value) {
|
|
85556
|
+
if (value.charCodeAt(0) !== 60) return;
|
|
85557
|
+
const next = value.charCodeAt(1);
|
|
85558
|
+
if (next === 33) {
|
|
85559
|
+
const code = value.charCodeAt(2);
|
|
85560
|
+
if (code === 45) return 2;
|
|
85561
|
+
if (code === 91) return 5;
|
|
85562
|
+
if (asciiAlpha(code)) return 4;
|
|
85563
|
+
return;
|
|
85564
|
+
}
|
|
85565
|
+
if (next === 63) return 3;
|
|
85566
|
+
const closing = next === 47;
|
|
85567
|
+
const start = closing ? 2 : 1;
|
|
85568
|
+
let end = start;
|
|
85569
|
+
let code = value.charCodeAt(end);
|
|
85570
|
+
if (!asciiAlpha(code)) return;
|
|
85571
|
+
while (code === 45 || asciiAlphanumeric(code)) code = value.charCodeAt(++end);
|
|
85572
|
+
const name = value.slice(start, end).toLowerCase();
|
|
85573
|
+
if (!closing && code !== 47 && htmlRawNames.includes(name)) return 1;
|
|
85574
|
+
return htmlBlockNames.includes(name) ? 6 : 7;
|
|
85575
|
+
}
|
|
85576
|
+
//#endregion
|
|
85577
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/join.js
|
|
85219
85578
|
/**
|
|
85220
85579
|
* @import {Join} from 'mdast-util-to-markdown'
|
|
85221
85580
|
*/
|
|
85222
85581
|
/** @type {Array<Join>} */
|
|
85223
85582
|
const join$1 = [joinDefaults];
|
|
85224
|
-
/**
|
|
85583
|
+
/**
|
|
85584
|
+
* Default join function.
|
|
85585
|
+
*
|
|
85586
|
+
* @type {Join}
|
|
85587
|
+
*/
|
|
85225
85588
|
function joinDefaults(left, right, parent, state) {
|
|
85226
85589
|
if (right.type === "code" && formatCodeAsIndented(right, state) && (left.type === "list" || left.type === right.type && formatCodeAsIndented(left, state))) return false;
|
|
85227
85590
|
if ("spread" in parent && typeof parent.spread === "boolean") {
|
|
85228
85591
|
if (left.type === "paragraph" && (left.type === right.type || right.type === "definition" || right.type === "heading" && formatHeadingAsSetext(right, state))) return;
|
|
85592
|
+
if (left.type === "html") {
|
|
85593
|
+
const kind = htmlKind(left.value);
|
|
85594
|
+
if (kind === void 0 || kind === 6 || kind === 7) return 1;
|
|
85595
|
+
}
|
|
85596
|
+
if (left.type === "paragraph" && right.type === "html") {
|
|
85597
|
+
const kind = htmlKind(right.value);
|
|
85598
|
+
if (kind === void 0 || kind === 7) return 1;
|
|
85599
|
+
}
|
|
85229
85600
|
return parent.spread ? 1 : 0;
|
|
85230
85601
|
}
|
|
85231
85602
|
}
|
|
85232
85603
|
//#endregion
|
|
85233
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
85604
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/unsafe.js
|
|
85234
85605
|
/**
|
|
85235
85606
|
* @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'
|
|
85236
85607
|
*/
|
|
@@ -85288,6 +85659,26 @@ const unsafe = [
|
|
|
85288
85659
|
"headingAtx"
|
|
85289
85660
|
]
|
|
85290
85661
|
},
|
|
85662
|
+
{
|
|
85663
|
+
character: "\r",
|
|
85664
|
+
before: "[\\r\\n]",
|
|
85665
|
+
inConstruct: "phrasing"
|
|
85666
|
+
},
|
|
85667
|
+
{
|
|
85668
|
+
character: "\r",
|
|
85669
|
+
after: "\\r",
|
|
85670
|
+
inConstruct: "phrasing"
|
|
85671
|
+
},
|
|
85672
|
+
{
|
|
85673
|
+
character: "\n",
|
|
85674
|
+
before: "\\n",
|
|
85675
|
+
inConstruct: "phrasing"
|
|
85676
|
+
},
|
|
85677
|
+
{
|
|
85678
|
+
character: "\n",
|
|
85679
|
+
after: "[\\r\\n]",
|
|
85680
|
+
inConstruct: "phrasing"
|
|
85681
|
+
},
|
|
85291
85682
|
{
|
|
85292
85683
|
character: " ",
|
|
85293
85684
|
after: "[\\r\\n]",
|
|
@@ -85449,8 +85840,25 @@ const unsafe = [
|
|
|
85449
85840
|
{
|
|
85450
85841
|
atBreak: true,
|
|
85451
85842
|
character: "~"
|
|
85843
|
+
},
|
|
85844
|
+
{
|
|
85845
|
+
character: "<",
|
|
85846
|
+
inConstruct: "autolink"
|
|
85847
|
+
},
|
|
85848
|
+
{
|
|
85849
|
+
character: ">",
|
|
85850
|
+
inConstruct: "autolink"
|
|
85851
|
+
},
|
|
85852
|
+
{
|
|
85853
|
+
character: "",
|
|
85854
|
+
inConstruct: "autolink"
|
|
85452
85855
|
}
|
|
85453
85856
|
];
|
|
85857
|
+
let code$2 = -1;
|
|
85858
|
+
while (++code$2 < 33) unsafe.push({
|
|
85859
|
+
character: String.fromCharCode(code$2),
|
|
85860
|
+
inConstruct: "autolink"
|
|
85861
|
+
});
|
|
85454
85862
|
//#endregion
|
|
85455
85863
|
//#region node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.js
|
|
85456
85864
|
/**
|
|
@@ -87587,7 +87995,7 @@ const characterEntities = {
|
|
|
87587
87995
|
};
|
|
87588
87996
|
//#endregion
|
|
87589
87997
|
//#region node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.js
|
|
87590
|
-
const own$
|
|
87998
|
+
const own$4 = {}.hasOwnProperty;
|
|
87591
87999
|
/**
|
|
87592
88000
|
* Decode a single character reference (without the `&` or `;`).
|
|
87593
88001
|
* You probably only need this when you’re building parsers yourself that follow
|
|
@@ -87600,7 +88008,7 @@ const own$3 = {}.hasOwnProperty;
|
|
|
87600
88008
|
* Decoded reference.
|
|
87601
88009
|
*/
|
|
87602
88010
|
function decodeNamedCharacterReference(value) {
|
|
87603
|
-
return own$
|
|
88011
|
+
return own$4.call(characterEntities, value) ? characterEntities[value] : false;
|
|
87604
88012
|
}
|
|
87605
88013
|
//#endregion
|
|
87606
88014
|
//#region node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
@@ -87661,7 +88069,7 @@ function decode($0, $1, $2) {
|
|
|
87661
88069
|
return decodeNamedCharacterReference($2) || $0;
|
|
87662
88070
|
}
|
|
87663
88071
|
//#endregion
|
|
87664
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
88072
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/association.js
|
|
87665
88073
|
/**
|
|
87666
88074
|
* @import {AssociationId} from '../types.js'
|
|
87667
88075
|
*/
|
|
@@ -87690,49 +88098,484 @@ function association(node) {
|
|
|
87690
88098
|
return decodeString(node.identifier);
|
|
87691
88099
|
}
|
|
87692
88100
|
//#endregion
|
|
87693
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
88101
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js
|
|
87694
88102
|
/**
|
|
87695
88103
|
* @import {CompilePattern} from '../types.js'
|
|
87696
88104
|
*/
|
|
87697
88105
|
/**
|
|
88106
|
+
* Compiles a pattern object into a regular expression.
|
|
88107
|
+
*
|
|
87698
88108
|
* @type {CompilePattern}
|
|
87699
88109
|
*/
|
|
87700
88110
|
function compilePattern(pattern) {
|
|
87701
88111
|
if (!pattern._compiled) {
|
|
87702
88112
|
const before = (pattern.atBreak ? "[\\r\\n][\\t ]*" : "") + (pattern.before ? "(?:" + pattern.before + ")" : "");
|
|
87703
|
-
pattern._compiled = new RegExp((before ? "(" + before + ")" : "") + (/[
|
|
88113
|
+
pattern._compiled = new RegExp((before ? "(" + before + ")" : "") + (/[$()*+\-.?[\\\]^{|}]/.test(pattern.character) ? "\\" : "") + pattern.character + (pattern.after ? "(?:" + pattern.after + ")" : ""), "g");
|
|
87704
88114
|
}
|
|
87705
88115
|
return pattern._compiled;
|
|
87706
88116
|
}
|
|
87707
88117
|
//#endregion
|
|
87708
|
-
//#region node_modules/.pnpm/
|
|
88118
|
+
//#region node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.js
|
|
88119
|
+
/**
|
|
88120
|
+
* @import {Code} from 'micromark-util-types'
|
|
88121
|
+
*/
|
|
88122
|
+
/**
|
|
88123
|
+
* Classify whether a code represents whitespace, punctuation, or something
|
|
88124
|
+
* else.
|
|
88125
|
+
*
|
|
88126
|
+
* Used for attention (emphasis, strong), whose sequences can open or close
|
|
88127
|
+
* based on the class of surrounding characters.
|
|
88128
|
+
*
|
|
88129
|
+
* > 👉 **Note**: eof (`null`) is seen as whitespace.
|
|
88130
|
+
*
|
|
88131
|
+
* @param {Code} code
|
|
88132
|
+
* Code.
|
|
88133
|
+
* @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
|
|
88134
|
+
* Group.
|
|
88135
|
+
*/
|
|
88136
|
+
function classifyCharacter(code) {
|
|
88137
|
+
if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return 1;
|
|
88138
|
+
if (unicodePunctuation(code)) return 2;
|
|
88139
|
+
}
|
|
88140
|
+
//#endregion
|
|
88141
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/character.js
|
|
88142
|
+
/**
|
|
88143
|
+
* Get the first character of a value.
|
|
88144
|
+
*
|
|
88145
|
+
* Is aware of astral characters (such as emoji).
|
|
88146
|
+
*
|
|
88147
|
+
* @param {string} value
|
|
88148
|
+
* Value.
|
|
88149
|
+
* @returns {string}
|
|
88150
|
+
* First character; empty if `value` is empty.
|
|
88151
|
+
*/
|
|
88152
|
+
function firstCharacter(value) {
|
|
88153
|
+
const code = value.codePointAt(0);
|
|
88154
|
+
return code === void 0 ? "" : String.fromCodePoint(code);
|
|
88155
|
+
}
|
|
88156
|
+
/**
|
|
88157
|
+
* Get the last character of a value.
|
|
88158
|
+
*
|
|
88159
|
+
* Is aware of astral characters (such as emoji).
|
|
88160
|
+
*
|
|
88161
|
+
* @param {string} value
|
|
88162
|
+
* Value.
|
|
88163
|
+
* @returns {string}
|
|
88164
|
+
* Last character; empty if `value` is empty.
|
|
88165
|
+
*/
|
|
88166
|
+
function lastCharacter(value) {
|
|
88167
|
+
const code = value.codePointAt(value.length - 2);
|
|
88168
|
+
return code !== void 0 && code > 65535 ? value.slice(-2) : value.slice(-1);
|
|
88169
|
+
}
|
|
88170
|
+
//#endregion
|
|
88171
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/encode-info.js
|
|
88172
|
+
/**
|
|
88173
|
+
* @import {EncodeSides} from '../types.js'
|
|
88174
|
+
*/
|
|
88175
|
+
/**
|
|
88176
|
+
* Check whether to encode (as a character reference) the characters
|
|
88177
|
+
* surrounding an attention run.
|
|
88178
|
+
*
|
|
88179
|
+
* Which characters are around an attention run influence whether it works or
|
|
88180
|
+
* not.
|
|
88181
|
+
*
|
|
88182
|
+
* See <https://github.com/orgs/syntax-tree/discussions/60> for more info.
|
|
88183
|
+
* See this markdown in a particular renderer to see what works:
|
|
88184
|
+
*
|
|
88185
|
+
* ```markdown
|
|
88186
|
+
* | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |
|
|
88187
|
+
* | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |
|
|
88188
|
+
* | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z |
|
|
88189
|
+
* | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. |
|
|
88190
|
+
* | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z |
|
|
88191
|
+
* | 4 (nothing outside) | *x* | *.* | * * | ** |
|
|
88192
|
+
* ```
|
|
88193
|
+
*
|
|
88194
|
+
* @param {number} outside
|
|
88195
|
+
* Code point on the outer side of the run.
|
|
88196
|
+
* @param {number} inside
|
|
88197
|
+
* Code point on the inner side of the run.
|
|
88198
|
+
* @param {string} marker
|
|
88199
|
+
* Marker of the run.
|
|
88200
|
+
* Underscores are handled more strictly (they form less often) than
|
|
88201
|
+
* asterisks.
|
|
88202
|
+
* @returns {EncodeSides}
|
|
88203
|
+
* Whether to encode characters.
|
|
88204
|
+
*/
|
|
88205
|
+
function encodeInfo(outside, inside, marker) {
|
|
88206
|
+
const outsideKind = classifyCharacter(outside);
|
|
88207
|
+
const insideKind = classifyCharacter(inside);
|
|
88208
|
+
if (outsideKind === void 0) return insideKind === void 0 ? marker === "_" ? {
|
|
88209
|
+
inside: true,
|
|
88210
|
+
outside: true
|
|
88211
|
+
} : {
|
|
88212
|
+
inside: false,
|
|
88213
|
+
outside: false
|
|
88214
|
+
} : insideKind === 1 ? {
|
|
88215
|
+
inside: true,
|
|
88216
|
+
outside: true
|
|
88217
|
+
} : {
|
|
88218
|
+
inside: false,
|
|
88219
|
+
outside: true
|
|
88220
|
+
};
|
|
88221
|
+
if (outsideKind === 1) return insideKind === void 0 ? {
|
|
88222
|
+
inside: false,
|
|
88223
|
+
outside: false
|
|
88224
|
+
} : insideKind === 1 ? {
|
|
88225
|
+
inside: true,
|
|
88226
|
+
outside: true
|
|
88227
|
+
} : {
|
|
88228
|
+
inside: false,
|
|
88229
|
+
outside: false
|
|
88230
|
+
};
|
|
88231
|
+
return insideKind === void 0 ? {
|
|
88232
|
+
inside: false,
|
|
88233
|
+
outside: false
|
|
88234
|
+
} : insideKind === 1 ? {
|
|
88235
|
+
inside: true,
|
|
88236
|
+
outside: false
|
|
88237
|
+
} : {
|
|
88238
|
+
inside: false,
|
|
88239
|
+
outside: false
|
|
88240
|
+
};
|
|
88241
|
+
}
|
|
88242
|
+
//#endregion
|
|
88243
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js
|
|
87709
88244
|
/**
|
|
87710
|
-
* @import {Handle, Info, State} from 'mdast-util-to-markdown'
|
|
88245
|
+
* @import {Attention, Handle, Info, State} from 'mdast-util-to-markdown'
|
|
87711
88246
|
* @import {PhrasingParents} from '../types.js'
|
|
87712
88247
|
*/
|
|
87713
88248
|
/**
|
|
87714
|
-
*
|
|
88249
|
+
* Markers for builtin attention (emphasis, strong) to whether they are stricter:
|
|
88250
|
+
* whether they cannot open and close inside words.
|
|
87715
88251
|
*
|
|
87716
|
-
*
|
|
88252
|
+
* Builtin runs pair following CommonMark rules for emphasis and strong:
|
|
88253
|
+
* they are split,
|
|
88254
|
+
* using one or two markers at a time,
|
|
88255
|
+
* with the rule of 3.
|
|
88256
|
+
* Other markers pair like GFM strikethrough:
|
|
88257
|
+
* whole runs pair with a run of the same size.
|
|
88258
|
+
*
|
|
88259
|
+
* @type {Map<string, boolean>}
|
|
88260
|
+
*/
|
|
88261
|
+
const builtins = /* @__PURE__ */ new Map([["*", false], ["_", true]]);
|
|
88262
|
+
/**
|
|
88263
|
+
* @typedef AttentionResult
|
|
88264
|
+
* Attention, of which the sequence is chosen later.
|
|
88265
|
+
* @property {Array<Item>} children
|
|
88266
|
+
* Serialized children.
|
|
88267
|
+
* @property {Array<string>} sequences
|
|
88268
|
+
* Sequences that can be used, in order of preference.
|
|
88269
|
+
*/
|
|
88270
|
+
/**
|
|
88271
|
+
* @typedef Improvement
|
|
88272
|
+
* Improvement of attention sequences.
|
|
88273
|
+
* @property {Map<AttentionResult, string>} chosen
|
|
88274
|
+
* Chosen sequences for each attention.
|
|
88275
|
+
* @property {Array<Token>} tokens
|
|
88276
|
+
* Tokens involved in the improvement.
|
|
88277
|
+
* @property {Mistake | undefined} mistake
|
|
88278
|
+
* Mistake that led to this improvement, if any.
|
|
88279
|
+
*/
|
|
88280
|
+
/**
|
|
88281
|
+
* @typedef {AttentionResult | string} Item
|
|
88282
|
+
* Serialized phrasing.
|
|
88283
|
+
*/
|
|
88284
|
+
/**
|
|
88285
|
+
* @typedef Mistake
|
|
88286
|
+
* Sequence that does not form its attention.
|
|
88287
|
+
* @property {Array<AttentionResult>} attention
|
|
88288
|
+
* Attention to try other sequences for.
|
|
88289
|
+
* @property {number} index
|
|
88290
|
+
* Index of the token.
|
|
88291
|
+
*/
|
|
88292
|
+
/**
|
|
88293
|
+
* @typedef Run
|
|
88294
|
+
* Sequences next to each other with the same marker.
|
|
88295
|
+
* @property {boolean} close
|
|
88296
|
+
* Whether it can close.
|
|
88297
|
+
* @property {number} end
|
|
88298
|
+
* Index after the last marker not used (to open).
|
|
88299
|
+
* @property {Array<Token>} markers
|
|
88300
|
+
* Sequence of each marker.
|
|
88301
|
+
* @property {boolean} open
|
|
88302
|
+
* Whether it can open.
|
|
88303
|
+
* @property {boolean} split
|
|
88304
|
+
* Whether it can be split (built-in attention).
|
|
88305
|
+
* @property {number} start
|
|
88306
|
+
* Index of the first marker not used (to close).
|
|
88307
|
+
* @property {Array<Token>} tokens
|
|
88308
|
+
* Sequences.
|
|
88309
|
+
*/
|
|
88310
|
+
/**
|
|
88311
|
+
* @typedef Token
|
|
88312
|
+
* Rendered phrasing.
|
|
88313
|
+
* @property {AttentionResult | undefined} attention
|
|
88314
|
+
* Attention, if this is one of its sequences.
|
|
88315
|
+
* @property {string} value
|
|
88316
|
+
* Value.
|
|
88317
|
+
*/
|
|
88318
|
+
/**
|
|
88319
|
+
* Get candidates for a mistake:
|
|
88320
|
+
* attention to try other sequences for,
|
|
88321
|
+
* later first.
|
|
88322
|
+
*
|
|
88323
|
+
* @param {Array<Token>} tokens
|
|
88324
|
+
* Tokens.
|
|
88325
|
+
* @param {Array<Token>} involved
|
|
88326
|
+
* Sequences involved in the mistake.
|
|
88327
|
+
* @param {Map<Token, Run>} runOf
|
|
88328
|
+
* Run of each sequence.
|
|
88329
|
+
* @returns {Array<AttentionResult>}
|
|
88330
|
+
* Candidates.
|
|
88331
|
+
*/
|
|
88332
|
+
function candidates(tokens, involved, runOf) {
|
|
88333
|
+
/** @type {Set<AttentionResult | undefined>} */
|
|
88334
|
+
const related = /* @__PURE__ */ new Set();
|
|
88335
|
+
for (const token of tokens) {
|
|
88336
|
+
const siblings = runOf.get(token);
|
|
88337
|
+
if (siblings && token.attention && involved.some((d) => d.attention === token.attention)) for (const sibling of siblings.tokens) related.add(sibling.attention);
|
|
88338
|
+
}
|
|
88339
|
+
/** @type {Array<AttentionResult>} */
|
|
88340
|
+
const ordered = [];
|
|
88341
|
+
for (const token of tokens) if (token.attention && related.delete(token.attention)) ordered.push(token.attention);
|
|
88342
|
+
ordered.reverse();
|
|
88343
|
+
return ordered;
|
|
88344
|
+
}
|
|
88345
|
+
/**
|
|
88346
|
+
* Check whether sequences form their attention, like `micromark`.
|
|
88347
|
+
*
|
|
88348
|
+
* Sequences of `*` and `_` pair like emphasis and strong in CommonMark,
|
|
88349
|
+
* others like strikethrough in GFM.
|
|
88350
|
+
*
|
|
88351
|
+
* @param {Array<Token>} tokens
|
|
88352
|
+
* Tokens.
|
|
88353
|
+
* @param {string} before
|
|
88354
|
+
* Characters before.
|
|
88355
|
+
* @param {string} after
|
|
88356
|
+
* Characters after.
|
|
88357
|
+
* @returns {Mistake | undefined}
|
|
88358
|
+
* First mistake, if any.
|
|
88359
|
+
*/
|
|
88360
|
+
function check(tokens, before, after) {
|
|
88361
|
+
/** @type {Array<Run>} */
|
|
88362
|
+
const runs = [];
|
|
88363
|
+
/** @type {Map<Token, Array<Token>>} */
|
|
88364
|
+
const wrong = /* @__PURE__ */ new Map();
|
|
88365
|
+
/** @type {Map<Token, Run>} */
|
|
88366
|
+
const runOf = /* @__PURE__ */ new Map();
|
|
88367
|
+
let index = 0;
|
|
88368
|
+
while (index < tokens.length) {
|
|
88369
|
+
if (!tokens[index].attention) {
|
|
88370
|
+
index++;
|
|
88371
|
+
continue;
|
|
88372
|
+
}
|
|
88373
|
+
const marker = tokens[index].value.charAt(0);
|
|
88374
|
+
const strict = builtins.get(marker);
|
|
88375
|
+
let end = index + 1;
|
|
88376
|
+
while (end < tokens.length && tokens[end].attention && tokens[end].value.charAt(0) === marker) end++;
|
|
88377
|
+
const head = index ? tokens[index - 1].value : before;
|
|
88378
|
+
const previous = classifyCharacter(head.charCodeAt(head.length - 1));
|
|
88379
|
+
const next = classifyCharacter((end < tokens.length ? tokens[end].value : after).charCodeAt(0));
|
|
88380
|
+
const open = !next || next === 2 && Boolean(previous);
|
|
88381
|
+
const close = !previous || previous === 2 && Boolean(next);
|
|
88382
|
+
/** @type {Run} */
|
|
88383
|
+
const run = {
|
|
88384
|
+
tokens: tokens.slice(index, end),
|
|
88385
|
+
markers: [],
|
|
88386
|
+
start: 0,
|
|
88387
|
+
end: 0,
|
|
88388
|
+
open: strict ? open && (Boolean(previous) || !close) : open,
|
|
88389
|
+
close: strict ? close && (Boolean(next) || !open) : close,
|
|
88390
|
+
split: strict !== void 0
|
|
88391
|
+
};
|
|
88392
|
+
for (const token of run.tokens) {
|
|
88393
|
+
wrong.set(token, [...run.tokens]);
|
|
88394
|
+
runOf.set(token, run);
|
|
88395
|
+
let size = token.value.length;
|
|
88396
|
+
while (size--) run.markers.push(token);
|
|
88397
|
+
}
|
|
88398
|
+
run.end = run.markers.length;
|
|
88399
|
+
runs.push(run);
|
|
88400
|
+
index = end;
|
|
88401
|
+
}
|
|
88402
|
+
pair(runs, wrong);
|
|
88403
|
+
index = -1;
|
|
88404
|
+
while (++index < tokens.length) {
|
|
88405
|
+
const involved = wrong.get(tokens[index]);
|
|
88406
|
+
if (involved) return {
|
|
88407
|
+
attention: candidates(tokens, involved, runOf),
|
|
88408
|
+
index
|
|
88409
|
+
};
|
|
88410
|
+
}
|
|
88411
|
+
}
|
|
88412
|
+
/**
|
|
88413
|
+
* Serialize the children of a parent that contains phrasing children.
|
|
87717
88414
|
*
|
|
87718
88415
|
* @param {PhrasingParents} parent
|
|
87719
|
-
* Parent of
|
|
88416
|
+
* Parent of phrasing nodes.
|
|
87720
88417
|
* @param {State} state
|
|
87721
88418
|
* Info passed around about the current state.
|
|
87722
88419
|
* @param {Info} info
|
|
87723
88420
|
* Info on where we are in the document we are generating.
|
|
87724
88421
|
* @returns {string}
|
|
87725
|
-
* Serialized
|
|
88422
|
+
* Serialized result.
|
|
87726
88423
|
*/
|
|
87727
88424
|
function containerPhrasing(parent, state, info) {
|
|
88425
|
+
return serialize(phrasing(parent, state, info), info.before, info.after);
|
|
88426
|
+
}
|
|
88427
|
+
/**
|
|
88428
|
+
* Encode the first or last character of tokens as a character reference,
|
|
88429
|
+
* if it is text.
|
|
88430
|
+
*
|
|
88431
|
+
* @param {Array<Token>} tokens
|
|
88432
|
+
* Tokens.
|
|
88433
|
+
* @param {boolean} start
|
|
88434
|
+
* Whether to encode the first or last character.
|
|
88435
|
+
* @returns {undefined}
|
|
88436
|
+
* Nothing.
|
|
88437
|
+
*/
|
|
88438
|
+
function encode(tokens, start) {
|
|
88439
|
+
const token = tokens[start ? 0 : tokens.length - 1];
|
|
88440
|
+
if (!token || token.attention) return;
|
|
88441
|
+
const character = start ? firstCharacter(token.value) : lastCharacter(token.value);
|
|
88442
|
+
const reference = encodeCharacterReference(character.codePointAt(0));
|
|
88443
|
+
token.value = start ? reference + token.value.slice(character.length) : token.value.slice(0, token.value.length - character.length) + reference;
|
|
88444
|
+
}
|
|
88445
|
+
/**
|
|
88446
|
+
* Try other sequences for the candidates of a mistake and use the first that
|
|
88447
|
+
* moves the mistake further.
|
|
88448
|
+
*
|
|
88449
|
+
* @param {Array<Item>} items
|
|
88450
|
+
* Items.
|
|
88451
|
+
* @param {Map<AttentionResult, string>} chosen
|
|
88452
|
+
* Sequences to use instead of preferred sequences.
|
|
88453
|
+
* @param {Mistake} mistake
|
|
88454
|
+
* Mistake.
|
|
88455
|
+
* @param {string} before
|
|
88456
|
+
* Characters before.
|
|
88457
|
+
* @param {string} after
|
|
88458
|
+
* Characters after.
|
|
88459
|
+
* @returns {Improvement | undefined}
|
|
88460
|
+
* Result if better.
|
|
88461
|
+
*/
|
|
88462
|
+
function improve(items, chosen, mistake, before, after) {
|
|
88463
|
+
for (const attention of mistake.attention) {
|
|
88464
|
+
const current = chosen.get(attention) || attention.sequences[0];
|
|
88465
|
+
for (const sequence of attention.sequences) {
|
|
88466
|
+
if (sequence === current) continue;
|
|
88467
|
+
const trial = new Map(chosen);
|
|
88468
|
+
trial.set(attention, sequence);
|
|
88469
|
+
const tokens = render(items, trial, before, after);
|
|
88470
|
+
const next = check(tokens, before, after);
|
|
88471
|
+
if (!next || next.index > mistake.index) return {
|
|
88472
|
+
chosen: trial,
|
|
88473
|
+
mistake: next,
|
|
88474
|
+
tokens
|
|
88475
|
+
};
|
|
88476
|
+
}
|
|
88477
|
+
}
|
|
88478
|
+
}
|
|
88479
|
+
/**
|
|
88480
|
+
* Pair runs like `micromark` and mark sequences that do form their attention
|
|
88481
|
+
* as fine.
|
|
88482
|
+
*
|
|
88483
|
+
* Each pair uses markers from the end of an opener and the start of a closer.
|
|
88484
|
+
* It forms the intended attention if those markers are exactly the whole
|
|
88485
|
+
* opening and closing sequence of one attention.
|
|
88486
|
+
* Otherwise attention is mixed up:
|
|
88487
|
+
* either sequences of different attention pair,
|
|
88488
|
+
* part of a sequence is used (such as `**` of strong as `*`),
|
|
88489
|
+
* or several sequences are used together (such as `*` and `*` as `**`).
|
|
88490
|
+
* Then the sequences involved are recorded with each other.
|
|
88491
|
+
*
|
|
88492
|
+
* @param {Array<Run>} runs
|
|
88493
|
+
* Runs.
|
|
88494
|
+
* @param {Map<Token, Array<Token>>} wrong
|
|
88495
|
+
* Sequences that are wrong, with the sequences involved.
|
|
88496
|
+
* @returns {undefined}
|
|
88497
|
+
* Nothing, `wrong` is changed.
|
|
88498
|
+
*/
|
|
88499
|
+
function pair(runs, wrong) {
|
|
88500
|
+
let index = 0;
|
|
88501
|
+
while (index < runs.length) {
|
|
88502
|
+
const closer = runs[index];
|
|
88503
|
+
const marker = closer.tokens[0].value.charAt(0);
|
|
88504
|
+
const closerSize = closer.end - closer.start;
|
|
88505
|
+
let open = closer.close && closerSize ? index : 0;
|
|
88506
|
+
while (open--) {
|
|
88507
|
+
const opener = runs[open];
|
|
88508
|
+
const openerSize = opener.end - opener.start;
|
|
88509
|
+
if (opener.tokens[0].value.charAt(0) === marker && opener.open && openerSize && (closer.split ? !((opener.close || closer.open) && closerSize % 3) || (openerSize + closerSize) % 3 : openerSize === opener.markers.length && openerSize === closerSize)) {
|
|
88510
|
+
const size = closer.split ? openerSize > 1 && closerSize > 1 ? 2 : 1 : closerSize;
|
|
88511
|
+
const opening = opener.markers.slice(opener.end - size, opener.end);
|
|
88512
|
+
const closing = closer.markers.slice(closer.start, closer.start + size);
|
|
88513
|
+
const openToken = opening[0];
|
|
88514
|
+
const closeToken = closing[0];
|
|
88515
|
+
if (openToken === opening[size - 1] && openToken.value.length === size && closeToken === closing[size - 1] && closeToken.value.length === size && openToken.attention === closeToken.attention) {
|
|
88516
|
+
wrong.delete(openToken);
|
|
88517
|
+
wrong.delete(closeToken);
|
|
88518
|
+
} else {
|
|
88519
|
+
const involved = [.../* @__PURE__ */ new Set([...opening, ...closing])];
|
|
88520
|
+
for (const token of involved) {
|
|
88521
|
+
const list = wrong.get(token);
|
|
88522
|
+
if (list) list.push(...involved);
|
|
88523
|
+
}
|
|
88524
|
+
}
|
|
88525
|
+
opener.end -= size;
|
|
88526
|
+
closer.start += size;
|
|
88527
|
+
break;
|
|
88528
|
+
}
|
|
88529
|
+
}
|
|
88530
|
+
if (open === -1 || closer.start === closer.end) index++;
|
|
88531
|
+
}
|
|
88532
|
+
}
|
|
88533
|
+
/**
|
|
88534
|
+
* Get the sequences that can be used for attention, in order of preference.
|
|
88535
|
+
*
|
|
88536
|
+
* @param {string} type
|
|
88537
|
+
* Node type.
|
|
88538
|
+
* @param {Array<string>} markers
|
|
88539
|
+
* Markers.
|
|
88540
|
+
* @param {Array<number>} sizes
|
|
88541
|
+
* Sizes.
|
|
88542
|
+
* @returns {Array<string>}
|
|
88543
|
+
* Sequences.
|
|
88544
|
+
*/
|
|
88545
|
+
function attentionSequences(type, markers, sizes) {
|
|
88546
|
+
if (markers.length === 0) throw new Error("Cannot serialize `" + type + "` as attention without markers, expected one or more markers");
|
|
88547
|
+
if (sizes.length === 0) throw new Error("Cannot serialize `" + type + "` as attention without sizes, expected one or more sizes");
|
|
88548
|
+
for (const size of sizes) if (!Number.isSafeInteger(size) || size < 1) throw new Error("Cannot serialize `" + type + "` as attention with `" + size + "` as size, expected positive integer");
|
|
88549
|
+
/** @type {Array<string>} */
|
|
88550
|
+
const sequences = [];
|
|
88551
|
+
for (const marker of markers) {
|
|
88552
|
+
if (marker.length !== 1) throw new Error("Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected a single ascii character");
|
|
88553
|
+
if (!asciiPunctuation(marker.charCodeAt(0))) throw new Error("Cannot serialize `" + type + "` as attention with `" + marker + "` as marker, expected ascii punctuation");
|
|
88554
|
+
for (const size of sizes) sequences.push(marker.repeat(size));
|
|
88555
|
+
}
|
|
88556
|
+
return sequences;
|
|
88557
|
+
}
|
|
88558
|
+
/**
|
|
88559
|
+
* Serialize the children of a parent that contains phrasing children,
|
|
88560
|
+
* keeping attention separate,
|
|
88561
|
+
* so that its markers can be chosen later.
|
|
88562
|
+
*
|
|
88563
|
+
* @param {PhrasingParents} parent
|
|
88564
|
+
* Parent of phrasing nodes.
|
|
88565
|
+
* @param {State} state
|
|
88566
|
+
* Info passed around about the current state.
|
|
88567
|
+
* @param {Info} info
|
|
88568
|
+
* Info on where we are in the document we are generating.
|
|
88569
|
+
* @returns {Array<Item>}
|
|
88570
|
+
* Items.
|
|
88571
|
+
*/
|
|
88572
|
+
function phrasing(parent, state, info) {
|
|
87728
88573
|
const indexStack = state.indexStack;
|
|
87729
88574
|
const children = parent.children || [];
|
|
87730
|
-
/** @type {Array<
|
|
88575
|
+
/** @type {Array<Item>} */
|
|
87731
88576
|
const results = [];
|
|
87732
88577
|
let index = -1;
|
|
87733
88578
|
let before = info.before;
|
|
87734
|
-
/** @type {string | undefined} */
|
|
87735
|
-
let encodeAfter;
|
|
87736
88579
|
indexStack.push(-1);
|
|
87737
88580
|
let tracker = state.createTracker(info);
|
|
87738
88581
|
while (++index < children.length) {
|
|
@@ -87743,47 +88586,161 @@ function containerPhrasing(parent, state, info) {
|
|
|
87743
88586
|
if (index + 1 < children.length) {
|
|
87744
88587
|
/** @type {Handle} */
|
|
87745
88588
|
let handle = state.handle.handlers[children[index + 1].type];
|
|
87746
|
-
/** @type {Handle} */
|
|
87747
88589
|
if (handle && handle.peek) handle = handle.peek;
|
|
87748
|
-
after = handle ? handle(children[index + 1], parent, state, {
|
|
88590
|
+
after = handle ? firstCharacter(handle(children[index + 1], parent, state, {
|
|
87749
88591
|
before: "",
|
|
87750
88592
|
after: "",
|
|
87751
88593
|
...tracker.current()
|
|
87752
|
-
})
|
|
88594
|
+
})) : "";
|
|
87753
88595
|
} else after = info.after;
|
|
87754
|
-
|
|
87755
|
-
|
|
88596
|
+
const previous = results[results.length - 1];
|
|
88597
|
+
if (typeof previous === "string" && (before === "\r" || before === "\n") && child.type === "html" && htmlKind(child.value) !== 7) {
|
|
88598
|
+
results[results.length - 1] = previous.replace(/(\r?\n|\r)$/, " ");
|
|
87756
88599
|
before = " ";
|
|
87757
88600
|
tracker = state.createTracker(info);
|
|
87758
|
-
tracker.move(results.
|
|
88601
|
+
tracker.move(serialize(results, info.before, info.after));
|
|
88602
|
+
}
|
|
88603
|
+
/** @type {(Handle & {attention?: Attention | undefined}) | undefined} */
|
|
88604
|
+
const handle = state.handle.handlers[child.type];
|
|
88605
|
+
if (handle && handle.attention) {
|
|
88606
|
+
const { construct, markers, sizes } = handle.attention(child, state);
|
|
88607
|
+
const sequences = attentionSequences(child.type, markers, sizes);
|
|
88608
|
+
const sequence = sequences[0];
|
|
88609
|
+
const exit = state.enter(construct);
|
|
88610
|
+
tracker.move(sequence);
|
|
88611
|
+
const inside = phrasing(child, state, {
|
|
88612
|
+
...tracker.current(),
|
|
88613
|
+
before: sequence,
|
|
88614
|
+
after: sequence
|
|
88615
|
+
});
|
|
88616
|
+
tracker.move(serialize(inside, sequence, sequence));
|
|
88617
|
+
tracker.move(sequence);
|
|
88618
|
+
exit();
|
|
88619
|
+
results.push({
|
|
88620
|
+
children: inside,
|
|
88621
|
+
sequences
|
|
88622
|
+
});
|
|
88623
|
+
before = sequence.charAt(sequence.length - 1);
|
|
88624
|
+
} else {
|
|
88625
|
+
const value = state.handle(child, parent, state, {
|
|
88626
|
+
...tracker.current(),
|
|
88627
|
+
after,
|
|
88628
|
+
before
|
|
88629
|
+
});
|
|
88630
|
+
if (!value) continue;
|
|
88631
|
+
tracker.move(value);
|
|
88632
|
+
results.push(value);
|
|
88633
|
+
before = lastCharacter(value);
|
|
87759
88634
|
}
|
|
87760
|
-
let value = state.handle(child, parent, state, {
|
|
87761
|
-
...tracker.current(),
|
|
87762
|
-
after,
|
|
87763
|
-
before
|
|
87764
|
-
});
|
|
87765
|
-
if (encodeAfter && encodeAfter === value.slice(0, 1)) value = encodeCharacterReference(encodeAfter.charCodeAt(0)) + value.slice(1);
|
|
87766
|
-
const encodingInfo = state.attentionEncodeSurroundingInfo;
|
|
87767
|
-
state.attentionEncodeSurroundingInfo = void 0;
|
|
87768
|
-
encodeAfter = void 0;
|
|
87769
|
-
if (encodingInfo) {
|
|
87770
|
-
if (results.length > 0 && encodingInfo.before && before === results[results.length - 1].slice(-1)) results[results.length - 1] = results[results.length - 1].slice(0, -1) + encodeCharacterReference(before.charCodeAt(0));
|
|
87771
|
-
if (encodingInfo.after) encodeAfter = after;
|
|
87772
|
-
}
|
|
87773
|
-
tracker.move(value);
|
|
87774
|
-
results.push(value);
|
|
87775
|
-
before = value.slice(-1);
|
|
87776
88635
|
}
|
|
87777
88636
|
indexStack.pop();
|
|
87778
|
-
return results
|
|
88637
|
+
return results;
|
|
88638
|
+
}
|
|
88639
|
+
/**
|
|
88640
|
+
* Render items with sequences;
|
|
88641
|
+
* encoding characters around attention where needed.
|
|
88642
|
+
*
|
|
88643
|
+
* @param {Array<Item>} items
|
|
88644
|
+
* Serialized phrasing.
|
|
88645
|
+
* @param {Map<AttentionResult, string>} chosen
|
|
88646
|
+
* Sequences to use instead of preferred sequences.
|
|
88647
|
+
* @param {string} before
|
|
88648
|
+
* Characters before.
|
|
88649
|
+
* @param {string} after
|
|
88650
|
+
* Characters after.
|
|
88651
|
+
* @returns {Array<Token>}
|
|
88652
|
+
* Tokens.
|
|
88653
|
+
*/
|
|
88654
|
+
function render(items, chosen, before, after) {
|
|
88655
|
+
/** @type {Array<Token>} */
|
|
88656
|
+
const tokens = [];
|
|
88657
|
+
/** @type {string | undefined} */
|
|
88658
|
+
let encodeAfter;
|
|
88659
|
+
let previous = lastCharacter(before);
|
|
88660
|
+
let index = -1;
|
|
88661
|
+
while (++index < items.length) {
|
|
88662
|
+
const item = items[index];
|
|
88663
|
+
if (typeof item === "string") {
|
|
88664
|
+
/** @type {Token} */
|
|
88665
|
+
const token = {
|
|
88666
|
+
value: item,
|
|
88667
|
+
attention: void 0
|
|
88668
|
+
};
|
|
88669
|
+
if (encodeAfter && encodeAfter === firstCharacter(item)) encode([token], true);
|
|
88670
|
+
encodeAfter = void 0;
|
|
88671
|
+
tokens.push(token);
|
|
88672
|
+
if (token.value) previous = lastCharacter(token.value);
|
|
88673
|
+
continue;
|
|
88674
|
+
}
|
|
88675
|
+
const sequence = chosen.get(item) || item.sequences[0];
|
|
88676
|
+
const marker = sequence.charAt(0);
|
|
88677
|
+
const next = items[index + 1];
|
|
88678
|
+
const outsideBefore = previous;
|
|
88679
|
+
const outsideAfter = firstCharacter(next === void 0 ? after : typeof next === "string" ? next : chosen.get(next) || next.sequences[0]);
|
|
88680
|
+
const inside = render(item.children, chosen, sequence, sequence);
|
|
88681
|
+
const head = inside.length > 0 ? inside[0].value : "";
|
|
88682
|
+
const open = encodeInfo(outsideBefore.charCodeAt(outsideBefore.length - 1), head.charCodeAt(0), marker);
|
|
88683
|
+
if (open.inside) encode(inside, true);
|
|
88684
|
+
const tail = inside.length > 0 ? lastCharacter(inside[inside.length - 1].value) : "";
|
|
88685
|
+
const close = encodeInfo(outsideAfter.charCodeAt(0), tail.charCodeAt(tail.length - 1), marker);
|
|
88686
|
+
if (close.inside) encode(inside, false);
|
|
88687
|
+
if (open.outside && outsideBefore !== "\n" && outsideBefore !== "\r") encode(tokens, false);
|
|
88688
|
+
if (close.outside) encodeAfter = outsideAfter;
|
|
88689
|
+
tokens.push({
|
|
88690
|
+
value: sequence,
|
|
88691
|
+
attention: item
|
|
88692
|
+
}, ...inside, {
|
|
88693
|
+
value: sequence,
|
|
88694
|
+
attention: item
|
|
88695
|
+
});
|
|
88696
|
+
previous = sequence.charAt(sequence.length - 1);
|
|
88697
|
+
}
|
|
88698
|
+
return tokens;
|
|
88699
|
+
}
|
|
88700
|
+
/**
|
|
88701
|
+
* Serialize phrasing with attention.
|
|
88702
|
+
*
|
|
88703
|
+
* Whether attention forms depends on everything around it.
|
|
88704
|
+
* This checks that it does and tries other sequences if not.
|
|
88705
|
+
*
|
|
88706
|
+
* @param {Array<Item>} items
|
|
88707
|
+
* Phrasing items.
|
|
88708
|
+
* @param {string} before
|
|
88709
|
+
* Characters before.
|
|
88710
|
+
* @param {string} after
|
|
88711
|
+
* Characters after.
|
|
88712
|
+
* @returns {string}
|
|
88713
|
+
* Serialized markdown.
|
|
88714
|
+
*/
|
|
88715
|
+
function serialize(items, before, after) {
|
|
88716
|
+
/** @type {Map<AttentionResult, string>} */
|
|
88717
|
+
let chosen = /* @__PURE__ */ new Map();
|
|
88718
|
+
const initial = render(items, chosen, before, after);
|
|
88719
|
+
let tokens = initial;
|
|
88720
|
+
let mistake = check(tokens, before, after);
|
|
88721
|
+
while (mistake) {
|
|
88722
|
+
const next = improve(items, chosen, mistake, before, after);
|
|
88723
|
+
if (!next) {
|
|
88724
|
+
tokens = initial;
|
|
88725
|
+
break;
|
|
88726
|
+
}
|
|
88727
|
+
chosen = next.chosen;
|
|
88728
|
+
tokens = next.tokens;
|
|
88729
|
+
mistake = next.mistake;
|
|
88730
|
+
}
|
|
88731
|
+
let result = "";
|
|
88732
|
+
for (const token of tokens) result += token.value;
|
|
88733
|
+
return result;
|
|
87779
88734
|
}
|
|
87780
88735
|
//#endregion
|
|
87781
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
88736
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/container-flow.js
|
|
87782
88737
|
/**
|
|
87783
88738
|
* @import {State} from 'mdast-util-to-markdown'
|
|
87784
88739
|
* @import {FlowChildren, FlowParents, TrackFields} from '../types.js'
|
|
87785
88740
|
*/
|
|
87786
88741
|
/**
|
|
88742
|
+
* Serialize the children of a parent that contains flow children.
|
|
88743
|
+
*
|
|
87787
88744
|
* @param {FlowParents} parent
|
|
87788
88745
|
* Parent of flow nodes.
|
|
87789
88746
|
* @param {State} state
|
|
@@ -87816,11 +88773,18 @@ function containerFlow(parent, state, info) {
|
|
|
87816
88773
|
return results.join("");
|
|
87817
88774
|
}
|
|
87818
88775
|
/**
|
|
88776
|
+
* Determine the markdown to insert between two flow nodes.
|
|
88777
|
+
*
|
|
87819
88778
|
* @param {FlowChildren} left
|
|
88779
|
+
* Left flow node.
|
|
87820
88780
|
* @param {FlowChildren} right
|
|
88781
|
+
* Right flow node.
|
|
87821
88782
|
* @param {FlowParents} parent
|
|
88783
|
+
* Parent of the flow nodes.
|
|
87822
88784
|
* @param {State} state
|
|
88785
|
+
* Info passed around.
|
|
87823
88786
|
* @returns {string}
|
|
88787
|
+
* Markdown to insert between the two flow nodes.
|
|
87824
88788
|
*/
|
|
87825
88789
|
function between(left, right, parent, state) {
|
|
87826
88790
|
let index = state.join.length;
|
|
@@ -87833,12 +88797,14 @@ function between(left, right, parent, state) {
|
|
|
87833
88797
|
return "\n\n";
|
|
87834
88798
|
}
|
|
87835
88799
|
//#endregion
|
|
87836
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
88800
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js
|
|
87837
88801
|
/**
|
|
87838
88802
|
* @import {IndentLines} from '../types.js'
|
|
87839
88803
|
*/
|
|
87840
88804
|
const eol = /\r?\n|\r/g;
|
|
87841
88805
|
/**
|
|
88806
|
+
* Indents each line.
|
|
88807
|
+
*
|
|
87842
88808
|
* @type {IndentLines}
|
|
87843
88809
|
*/
|
|
87844
88810
|
function indentLines(value, map) {
|
|
@@ -87857,17 +88823,21 @@ function indentLines(value, map) {
|
|
|
87857
88823
|
one(value.slice(start));
|
|
87858
88824
|
return result.join("");
|
|
87859
88825
|
/**
|
|
88826
|
+
* Indents a single line.
|
|
88827
|
+
*
|
|
87860
88828
|
* @param {string} value
|
|
88829
|
+
* Line.
|
|
87861
88830
|
*/
|
|
87862
88831
|
function one(value) {
|
|
87863
88832
|
result.push(map(value, line, !value));
|
|
87864
88833
|
}
|
|
87865
88834
|
}
|
|
87866
88835
|
//#endregion
|
|
87867
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
88836
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/safe.js
|
|
87868
88837
|
/**
|
|
87869
88838
|
* @import {SafeConfig, State} from 'mdast-util-to-markdown'
|
|
87870
88839
|
*/
|
|
88840
|
+
const own$3 = {}.hasOwnProperty;
|
|
87871
88841
|
/**
|
|
87872
88842
|
* Make a string safe for embedding in markdown constructs.
|
|
87873
88843
|
*
|
|
@@ -87878,8 +88848,8 @@ function indentLines(value, map) {
|
|
|
87878
88848
|
*
|
|
87879
88849
|
* To solve this, `mdast-util-to-markdown` tracks:
|
|
87880
88850
|
*
|
|
87881
|
-
* *
|
|
87882
|
-
* *
|
|
88851
|
+
* * characters before and after something;
|
|
88852
|
+
* * what “constructs” we are in.
|
|
87883
88853
|
*
|
|
87884
88854
|
* This information is then used by this function to escape or encode
|
|
87885
88855
|
* special characters.
|
|
@@ -87901,6 +88871,7 @@ function safe(state, input, config) {
|
|
|
87901
88871
|
const result = [];
|
|
87902
88872
|
/** @type {Record<number, {before: boolean, after: boolean}>} */
|
|
87903
88873
|
const infos = {};
|
|
88874
|
+
const percentEncode = state.stack.includes("autolink");
|
|
87904
88875
|
let index = -1;
|
|
87905
88876
|
while (++index < state.unsafe.length) {
|
|
87906
88877
|
const pattern = state.unsafe[index];
|
|
@@ -87912,7 +88883,7 @@ function safe(state, input, config) {
|
|
|
87912
88883
|
const before = "before" in pattern || Boolean(pattern.atBreak);
|
|
87913
88884
|
const after = "after" in pattern;
|
|
87914
88885
|
const position = match.index + (before ? match[1].length : 0);
|
|
87915
|
-
if (
|
|
88886
|
+
if (own$3.call(infos, position)) {
|
|
87916
88887
|
if (infos[position].before && !before) infos[position].before = false;
|
|
87917
88888
|
if (infos[position].after && !after) infos[position].after = false;
|
|
87918
88889
|
} else {
|
|
@@ -87925,36 +88896,63 @@ function safe(state, input, config) {
|
|
|
87925
88896
|
}
|
|
87926
88897
|
}
|
|
87927
88898
|
positions.sort(numerical);
|
|
87928
|
-
|
|
88899
|
+
const offset = config.before ? config.before.length : 0;
|
|
87929
88900
|
const end = value.length - (config.after ? config.after.length : 0);
|
|
88901
|
+
let start = offset;
|
|
87930
88902
|
index = -1;
|
|
87931
88903
|
while (++index < positions.length) {
|
|
87932
88904
|
const position = positions[index];
|
|
87933
88905
|
if (position < start || position >= end) continue;
|
|
88906
|
+
if (value.charAt(position) === "_" && position > 0 && classifyCharacter(value.charCodeAt(position - 1)) === void 0 && !own$3.call(infos, position - 1) && !(position - 1 === offset && /[*_]/.test(value.charAt(offset - 1)))) {
|
|
88907
|
+
let sequenceEnd = position + 1;
|
|
88908
|
+
while (sequenceEnd < end && value.charAt(sequenceEnd) === "_") sequenceEnd++;
|
|
88909
|
+
const skip = sequenceEnd - position - 1;
|
|
88910
|
+
if (positions[index + skip] === sequenceEnd - 1 && sequenceEnd < value.length && classifyCharacter(value.charCodeAt(sequenceEnd)) === void 0 && !own$3.call(infos, sequenceEnd) && !(sequenceEnd === end - 1 && /[*_]/.test(value.charAt(end)))) {
|
|
88911
|
+
index += skip;
|
|
88912
|
+
continue;
|
|
88913
|
+
}
|
|
88914
|
+
}
|
|
87934
88915
|
if (position + 1 < end && positions[index + 1] === position + 1 && infos[position].after && !infos[position + 1].before && !infos[position + 1].after || positions[index - 1] === position - 1 && infos[position].before && !infos[position - 1].before && !infos[position - 1].after) continue;
|
|
87935
|
-
if (start !== position)
|
|
88916
|
+
if (start !== position) {
|
|
88917
|
+
const slice = value.slice(start, position);
|
|
88918
|
+
result.push(percentEncode ? slice : escapeBackslashes(slice, "\\"));
|
|
88919
|
+
}
|
|
87936
88920
|
start = position;
|
|
87937
|
-
if (
|
|
88921
|
+
if (percentEncode) {
|
|
88922
|
+
result.push("%" + value.charCodeAt(position).toString(16).toUpperCase().padStart(2, "0"));
|
|
88923
|
+
start++;
|
|
88924
|
+
} else if (/[!-/:-@[-`{-~]/.test(value.charAt(position)) && (!config.encode || !config.encode.includes(value.charAt(position)))) result.push("\\");
|
|
87938
88925
|
else {
|
|
87939
88926
|
result.push(encodeCharacterReference(value.charCodeAt(position)));
|
|
87940
88927
|
start++;
|
|
87941
88928
|
}
|
|
87942
88929
|
}
|
|
87943
|
-
|
|
88930
|
+
const rest = value.slice(start, end);
|
|
88931
|
+
result.push(percentEncode ? rest : escapeBackslashes(rest, config.after));
|
|
87944
88932
|
return result.join("");
|
|
87945
88933
|
}
|
|
87946
88934
|
/**
|
|
88935
|
+
* Compare two numbers.
|
|
88936
|
+
*
|
|
87947
88937
|
* @param {number} a
|
|
88938
|
+
* Number.
|
|
87948
88939
|
* @param {number} b
|
|
88940
|
+
* Other number.
|
|
87949
88941
|
* @returns {number}
|
|
88942
|
+
* Result.
|
|
87950
88943
|
*/
|
|
87951
88944
|
function numerical(a, b) {
|
|
87952
88945
|
return a - b;
|
|
87953
88946
|
}
|
|
87954
88947
|
/**
|
|
88948
|
+
* Escape backslashes in a string, considering characters that follow.
|
|
88949
|
+
*
|
|
87955
88950
|
* @param {string} value
|
|
88951
|
+
* Value.
|
|
87956
88952
|
* @param {string} after
|
|
88953
|
+
* Characters that follow the value.
|
|
87957
88954
|
* @returns {string}
|
|
88955
|
+
* Escaped string.
|
|
87958
88956
|
*/
|
|
87959
88957
|
function escapeBackslashes(value, after) {
|
|
87960
88958
|
const expression = /\\(?=[!-/:-@[-`{-~])/g;
|
|
@@ -87977,7 +88975,7 @@ function escapeBackslashes(value, after) {
|
|
|
87977
88975
|
return results.join("");
|
|
87978
88976
|
}
|
|
87979
88977
|
//#endregion
|
|
87980
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
88978
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/util/track.js
|
|
87981
88979
|
/**
|
|
87982
88980
|
* @import {CreateTracker, TrackCurrent, TrackMove, TrackShift} from '../types.js'
|
|
87983
88981
|
*/
|
|
@@ -88035,7 +89033,7 @@ function track(config) {
|
|
|
88035
89033
|
}
|
|
88036
89034
|
}
|
|
88037
89035
|
//#endregion
|
|
88038
|
-
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.
|
|
89036
|
+
//#region node_modules/.pnpm/mdast-util-to-markdown@2.1.3/node_modules/mdast-util-to-markdown/lib/index.js
|
|
88039
89037
|
/**
|
|
88040
89038
|
* @import {Info, Join, Options, SafeConfig, State} from 'mdast-util-to-markdown'
|
|
88041
89039
|
* @import {Nodes} from 'mdast'
|
|
@@ -88056,6 +89054,8 @@ function toMarkdown(tree, options) {
|
|
|
88056
89054
|
/** @type {State} */
|
|
88057
89055
|
const state = {
|
|
88058
89056
|
associationId: association,
|
|
89057
|
+
bulletCurrent: void 0,
|
|
89058
|
+
bulletLastUsed: void 0,
|
|
88059
89059
|
containerPhrasing: containerPhrasingBound,
|
|
88060
89060
|
containerFlow: containerFlowBound,
|
|
88061
89061
|
createTracker: track,
|
|
@@ -88078,7 +89078,10 @@ function toMarkdown(tree, options) {
|
|
|
88078
89078
|
unknown,
|
|
88079
89079
|
handlers: state.handlers
|
|
88080
89080
|
});
|
|
88081
|
-
let result = state.handle(tree
|
|
89081
|
+
let result = state.handle(phrasing$2(tree) ? {
|
|
89082
|
+
type: "root",
|
|
89083
|
+
children: [tree]
|
|
89084
|
+
} : tree, void 0, state, {
|
|
88082
89085
|
before: "\n",
|
|
88083
89086
|
after: "\n",
|
|
88084
89087
|
now: {
|
|
@@ -88089,12 +89092,19 @@ function toMarkdown(tree, options) {
|
|
|
88089
89092
|
});
|
|
88090
89093
|
if (result && result.charCodeAt(result.length - 1) !== 10 && result.charCodeAt(result.length - 1) !== 13) result += "\n";
|
|
88091
89094
|
return result;
|
|
88092
|
-
/**
|
|
89095
|
+
/**
|
|
89096
|
+
* Enter a construct.
|
|
89097
|
+
*
|
|
89098
|
+
* @type {Enter}
|
|
89099
|
+
*/
|
|
88093
89100
|
function enter(name) {
|
|
88094
89101
|
state.stack.push(name);
|
|
88095
89102
|
return exit;
|
|
88096
89103
|
/**
|
|
89104
|
+
* Exit a construct.
|
|
89105
|
+
*
|
|
88097
89106
|
* @returns {undefined}
|
|
89107
|
+
* Nothing.
|
|
88098
89108
|
*/
|
|
88099
89109
|
function exit() {
|
|
88100
89110
|
state.stack.pop();
|
|
@@ -88102,20 +89112,36 @@ function toMarkdown(tree, options) {
|
|
|
88102
89112
|
}
|
|
88103
89113
|
}
|
|
88104
89114
|
/**
|
|
89115
|
+
* Handle an invalid value that cannot be processed.
|
|
89116
|
+
*
|
|
88105
89117
|
* @param {unknown} value
|
|
89118
|
+
* Value.
|
|
88106
89119
|
* @returns {never}
|
|
89120
|
+
* Never.
|
|
89121
|
+
* @throws {Error}
|
|
89122
|
+
* Always.
|
|
88107
89123
|
*/
|
|
88108
89124
|
function invalid(value) {
|
|
88109
89125
|
throw new Error("Cannot handle value `" + value + "`, expected node");
|
|
88110
89126
|
}
|
|
88111
89127
|
/**
|
|
89128
|
+
* Handle an unknown node.
|
|
89129
|
+
*
|
|
88112
89130
|
* @param {unknown} value
|
|
89131
|
+
* Value.
|
|
88113
89132
|
* @returns {never}
|
|
89133
|
+
* Never.
|
|
89134
|
+
* @throws {Error}
|
|
89135
|
+
* Always.
|
|
88114
89136
|
*/
|
|
88115
89137
|
function unknown(value) {
|
|
88116
89138
|
throw new Error("Cannot handle unknown node `" + value.type + "`");
|
|
88117
89139
|
}
|
|
88118
|
-
/**
|
|
89140
|
+
/**
|
|
89141
|
+
* Join function for `tightDefinitions` option.
|
|
89142
|
+
*
|
|
89143
|
+
* @type {Join}
|
|
89144
|
+
*/
|
|
88119
89145
|
function joinDefinition(left, right) {
|
|
88120
89146
|
if (left.type === "definition" && left.type === right.type) return 0;
|
|
88121
89147
|
}
|
|
@@ -92645,105 +93671,6 @@ function tokenizeHeadingAtx(effects, ok, nok) {
|
|
|
92645
93671
|
}
|
|
92646
93672
|
}
|
|
92647
93673
|
//#endregion
|
|
92648
|
-
//#region node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.js
|
|
92649
|
-
/**
|
|
92650
|
-
* List of lowercase HTML “block” tag names.
|
|
92651
|
-
*
|
|
92652
|
-
* The list, when parsing HTML (flow), results in more relaxed rules (condition
|
|
92653
|
-
* 6).
|
|
92654
|
-
* Because they are known blocks, the HTML-like syntax doesn’t have to be
|
|
92655
|
-
* strictly parsed.
|
|
92656
|
-
* For tag names not in this list, a more strict algorithm (condition 7) is used
|
|
92657
|
-
* to detect whether the HTML-like syntax is seen as HTML (flow) or not.
|
|
92658
|
-
*
|
|
92659
|
-
* This is copied from:
|
|
92660
|
-
* <https://spec.commonmark.org/0.30/#html-blocks>.
|
|
92661
|
-
*
|
|
92662
|
-
* > 👉 **Note**: `search` was added in `CommonMark@0.31`.
|
|
92663
|
-
*/
|
|
92664
|
-
const htmlBlockNames = [
|
|
92665
|
-
"address",
|
|
92666
|
-
"article",
|
|
92667
|
-
"aside",
|
|
92668
|
-
"base",
|
|
92669
|
-
"basefont",
|
|
92670
|
-
"blockquote",
|
|
92671
|
-
"body",
|
|
92672
|
-
"caption",
|
|
92673
|
-
"center",
|
|
92674
|
-
"col",
|
|
92675
|
-
"colgroup",
|
|
92676
|
-
"dd",
|
|
92677
|
-
"details",
|
|
92678
|
-
"dialog",
|
|
92679
|
-
"dir",
|
|
92680
|
-
"div",
|
|
92681
|
-
"dl",
|
|
92682
|
-
"dt",
|
|
92683
|
-
"fieldset",
|
|
92684
|
-
"figcaption",
|
|
92685
|
-
"figure",
|
|
92686
|
-
"footer",
|
|
92687
|
-
"form",
|
|
92688
|
-
"frame",
|
|
92689
|
-
"frameset",
|
|
92690
|
-
"h1",
|
|
92691
|
-
"h2",
|
|
92692
|
-
"h3",
|
|
92693
|
-
"h4",
|
|
92694
|
-
"h5",
|
|
92695
|
-
"h6",
|
|
92696
|
-
"head",
|
|
92697
|
-
"header",
|
|
92698
|
-
"hr",
|
|
92699
|
-
"html",
|
|
92700
|
-
"iframe",
|
|
92701
|
-
"legend",
|
|
92702
|
-
"li",
|
|
92703
|
-
"link",
|
|
92704
|
-
"main",
|
|
92705
|
-
"menu",
|
|
92706
|
-
"menuitem",
|
|
92707
|
-
"nav",
|
|
92708
|
-
"noframes",
|
|
92709
|
-
"ol",
|
|
92710
|
-
"optgroup",
|
|
92711
|
-
"option",
|
|
92712
|
-
"p",
|
|
92713
|
-
"param",
|
|
92714
|
-
"search",
|
|
92715
|
-
"section",
|
|
92716
|
-
"summary",
|
|
92717
|
-
"table",
|
|
92718
|
-
"tbody",
|
|
92719
|
-
"td",
|
|
92720
|
-
"tfoot",
|
|
92721
|
-
"th",
|
|
92722
|
-
"thead",
|
|
92723
|
-
"title",
|
|
92724
|
-
"tr",
|
|
92725
|
-
"track",
|
|
92726
|
-
"ul"
|
|
92727
|
-
];
|
|
92728
|
-
/**
|
|
92729
|
-
* List of lowercase HTML “raw” tag names.
|
|
92730
|
-
*
|
|
92731
|
-
* The list, when parsing HTML (flow), results in HTML that can include lines
|
|
92732
|
-
* without exiting, until a closing tag also in this list is found (condition
|
|
92733
|
-
* 1).
|
|
92734
|
-
*
|
|
92735
|
-
* This module is copied from:
|
|
92736
|
-
* <https://spec.commonmark.org/0.30/#html-blocks>.
|
|
92737
|
-
*
|
|
92738
|
-
* > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.
|
|
92739
|
-
*/
|
|
92740
|
-
const htmlRawNames = [
|
|
92741
|
-
"pre",
|
|
92742
|
-
"script",
|
|
92743
|
-
"style",
|
|
92744
|
-
"textarea"
|
|
92745
|
-
];
|
|
92746
|
-
//#endregion
|
|
92747
93674
|
//#region node_modules/.pnpm/micromark-core-commonmark@2.0.4/node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
92748
93675
|
/**
|
|
92749
93676
|
* @import {
|
|
@@ -102534,6 +103461,17 @@ const truncateIfNeeded = (text, advice = "Use pagination or filters to reduce re
|
|
|
102534
103461
|
if (text.length <= CHARACTER_LIMIT) return text;
|
|
102535
103462
|
return `${text.slice(0, CHARACTER_LIMIT)}\n\n--- Response truncated (${text.length} chars, limit ${CHARACTER_LIMIT}). ${advice} ---`;
|
|
102536
103463
|
};
|
|
103464
|
+
const INPUT_NAME_OF = {
|
|
103465
|
+
Labels: "label_names",
|
|
103466
|
+
Section: "section_id",
|
|
103467
|
+
"Permission group": "permission_group_id",
|
|
103468
|
+
"User segment": "user_segment_id",
|
|
103469
|
+
Assignee: "assignee_id",
|
|
103470
|
+
Form: "form_id",
|
|
103471
|
+
assignee: "assignee_id",
|
|
103472
|
+
group: "group_id"
|
|
103473
|
+
};
|
|
103474
|
+
const writable = (label) => `**${label}** (${INPUT_NAME_OF[label]})`;
|
|
102537
103475
|
const formatPagination = (meta) => {
|
|
102538
103476
|
const parts = [`Results: ${meta.count}`];
|
|
102539
103477
|
if (meta.has_more) parts.push(`More available (cursor: ${meta.after_cursor})`);
|
|
@@ -102542,7 +103480,7 @@ const formatPagination = (meta) => {
|
|
|
102542
103480
|
const formatTicket = (ticket) => [
|
|
102543
103481
|
`## Ticket #${ticket.id}: ${ticket.subject}`,
|
|
102544
103482
|
`- **Status**: ${ticket.status} | **Priority**: ${ticket.priority ?? "none"} | **Type**: ${ticket.type ?? "none"}`,
|
|
102545
|
-
`- **Requester**: ${ticket.requester_id} |
|
|
103483
|
+
`- **Requester**: ${ticket.requester_id} | ${writable("Assignee")}: ${ticket.assignee_id ?? "unassigned"}`,
|
|
102546
103484
|
`- **Tags**: ${ticket.tags.length > 0 ? ticket.tags.join(", ") : "none"}`,
|
|
102547
103485
|
`- **Created**: ${ticket.created_at} | **Updated**: ${ticket.updated_at}`,
|
|
102548
103486
|
ticket.description ? `\n${ticket.description}` : ""
|
|
@@ -102653,7 +103591,7 @@ const formatComment = (comment, authors) => {
|
|
|
102653
103591
|
const formatRequest = (request) => [
|
|
102654
103592
|
`## Request #${request.id}: ${request.subject}`,
|
|
102655
103593
|
`- **Status**: ${request.status}${request.type ? ` | **Type**: ${request.type}` : ""}${request.priority ? ` | **Priority**: ${request.priority}` : ""}`,
|
|
102656
|
-
request.ticket_form_id ? `-
|
|
103594
|
+
request.ticket_form_id ? `- ${writable("Form")}: ${request.ticket_form_id}` : "",
|
|
102657
103595
|
`- **Can you mark it solved**: ${request.can_be_solved_by_me ? "yes" : "no"}`,
|
|
102658
103596
|
request.via?.channel ? `- **Submitted via**: ${request.via.channel}` : "",
|
|
102659
103597
|
`- **Created**: ${request.created_at} | **Updated**: ${request.updated_at}`,
|
|
@@ -102697,6 +103635,10 @@ const AUDIT_FIELD_LABELS = {
|
|
|
102697
103635
|
submitter_id: "submitter",
|
|
102698
103636
|
group_id: "group"
|
|
102699
103637
|
};
|
|
103638
|
+
const auditLabel = (field) => {
|
|
103639
|
+
const label = AUDIT_FIELD_LABELS[field] ?? field;
|
|
103640
|
+
return label in INPUT_NAME_OF ? writable(label) : `**${label}**`;
|
|
103641
|
+
};
|
|
102700
103642
|
const renderAuditValue = (field, value, names) => {
|
|
102701
103643
|
if (value === null || value === void 0 || value === "") return "";
|
|
102702
103644
|
const entity = AUDIT_ENTITY_FIELDS[field];
|
|
@@ -102716,7 +103658,7 @@ const renderCreateEvent = (event, names) => {
|
|
|
102716
103658
|
return tags.length > 0 ? `- **tags**: ${tags.join(", ")}` : null;
|
|
102717
103659
|
}
|
|
102718
103660
|
const value = renderAuditValue(field, event.value, names);
|
|
102719
|
-
return value === "" ? null : `-
|
|
103661
|
+
return value === "" ? null : `- ${auditLabel(field)}: ${value}`;
|
|
102720
103662
|
};
|
|
102721
103663
|
const renderChangeEvent = (event, names) => {
|
|
102722
103664
|
const field = event.field_name;
|
|
@@ -102725,7 +103667,7 @@ const renderChangeEvent = (event, names) => {
|
|
|
102725
103667
|
const after = renderAuditValue(field, event.value, names);
|
|
102726
103668
|
const before = renderAuditValue(field, event.previous_value, names);
|
|
102727
103669
|
if (before === after) return null;
|
|
102728
|
-
return `-
|
|
103670
|
+
return `- ${auditLabel(field)}: ${before || "(none)"} → ${after || "(none)"}`;
|
|
102729
103671
|
};
|
|
102730
103672
|
const renderAuditEvent = (event, names) => {
|
|
102731
103673
|
switch (event.type) {
|
|
@@ -102763,11 +103705,11 @@ const formatOrganization = (org) => [
|
|
|
102763
103705
|
const formatArticleSummary = (article) => [
|
|
102764
103706
|
`## ${article.title} (${article.id})`,
|
|
102765
103707
|
`- **Locale**: ${article.locale} | **Source locale**: ${article.source_locale}`,
|
|
102766
|
-
`-
|
|
103708
|
+
`- ${writable("Section")}: ${article.section_id} | **Draft**: ${article.draft}`,
|
|
102767
103709
|
article.promoted ? "- **Promoted**: featured in its section — changing this requires Help Center admin (Guide admin) rights; set via update_article `promoted`." : "",
|
|
102768
|
-
`-
|
|
103710
|
+
`- ${writable("Permission group")}: ${article.permission_group_id} | ${writable("User segment")}: ${article.user_segment_id ?? "everyone (no segment)"}`,
|
|
102769
103711
|
typeof article.position === "number" ? `- **Position**: ${article.position}` : "",
|
|
102770
|
-
article.label_names.length > 0 ? `-
|
|
103712
|
+
article.label_names.length > 0 ? `- ${writable("Labels")}: ${article.label_names.join(", ")}` : "",
|
|
102771
103713
|
`- **Created**: ${article.created_at} | **Updated**: ${article.updated_at}`
|
|
102772
103714
|
].filter(Boolean).join("\n");
|
|
102773
103715
|
const formatArticle = (article) => [
|
|
@@ -104072,7 +105014,7 @@ const createHelpCenterTools = (ctx) => {
|
|
|
104072
105014
|
namespace: "help_center",
|
|
104073
105015
|
readOnly: false,
|
|
104074
105016
|
title: "Update Help Center Article",
|
|
104075
|
-
description: "Update article metadata only (draft, promoted, labels, tags, visibility,
|
|
105017
|
+
description: "Update article metadata only (draft, promoted, labels as label_names, content tags as content_tag_ids, visibility as permission_group_id / user_segment_id, section_id, sort position, etc.) and return the updated article. Does NOT update content (title, body) — use update_article_translation for that.",
|
|
104076
105018
|
inputSchema: object({
|
|
104077
105019
|
article_id: number$2().int().describe("Article ID — the numeric id of the article to update. Obtain it from list_articles or search_articles."),
|
|
104078
105020
|
draft: boolean$1().optional().describe("Set true to unpublish the article (revert to draft) or false to publish it."),
|
|
@@ -104253,7 +105195,7 @@ const createHelpCenterTools = (ctx) => {
|
|
|
104253
105195
|
namespace: "help_center",
|
|
104254
105196
|
readOnly: true,
|
|
104255
105197
|
title: "List Article Labels",
|
|
104256
|
-
description: "List all article labels. Labels improve Help Center search ranking and are not visible to end users.",
|
|
105198
|
+
description: "List all article labels. Labels improve Help Center search ranking and are not visible to end users. Attach them to an article through the label_names parameter of create_article or update_article.",
|
|
104257
105199
|
inputSchema: object({}),
|
|
104258
105200
|
annotations: {
|
|
104259
105201
|
readOnlyHint: true,
|
|
@@ -107052,7 +107994,7 @@ const installShutdown = (options) => {
|
|
|
107052
107994
|
//#endregion
|
|
107053
107995
|
//#region src/index.ts
|
|
107054
107996
|
const buildStdioTokenStore = async (config, logger) => {
|
|
107055
|
-
const { createTokenStore } = await import("./token-store-
|
|
107997
|
+
const { createTokenStore } = await import("./token-store-SYK0DN9M.js");
|
|
107056
107998
|
return createTokenStore({
|
|
107057
107999
|
subdomain: config.subdomain,
|
|
107058
108000
|
oauthClientId: config.oauthClientId,
|
|
@@ -107091,7 +108033,7 @@ const main = async () => {
|
|
|
107091
108033
|
return;
|
|
107092
108034
|
}
|
|
107093
108035
|
if (config.dev) logger.warn("dev_mode_ignored_http");
|
|
107094
|
-
const { startHttpTransport } = await import("./http-
|
|
108036
|
+
const { startHttpTransport } = await import("./http-7NVoxfEA.js");
|
|
107095
108037
|
const http = await startHttpTransport(config, logger);
|
|
107096
108038
|
installShutdown({
|
|
107097
108039
|
watchStdin: false,
|