bunki 0.8.0 → 0.9.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/README.md +51 -51
- package/dist/cli/commands/validate.d.ts +5 -0
- package/dist/cli.js +493 -347
- package/dist/index.js +467 -348
- package/dist/parser.d.ts +6 -1
- package/dist/types.d.ts +2 -0
- package/dist/utils/markdown-utils.d.ts +11 -1
- package/package.json +9 -9
package/dist/cli.js
CHANGED
|
@@ -19256,24 +19256,24 @@ var require_lib2 = __commonJS((exports) => {
|
|
|
19256
19256
|
// node_modules/domhandler/lib/node.js
|
|
19257
19257
|
var require_node = __commonJS((exports) => {
|
|
19258
19258
|
var __extends = exports && exports.__extends || function() {
|
|
19259
|
-
var extendStatics = function(
|
|
19260
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
19261
|
-
|
|
19262
|
-
} || function(
|
|
19259
|
+
var extendStatics = function(d2, b2) {
|
|
19260
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
|
|
19261
|
+
d3.__proto__ = b3;
|
|
19262
|
+
} || function(d3, b3) {
|
|
19263
19263
|
for (var p in b3)
|
|
19264
19264
|
if (Object.prototype.hasOwnProperty.call(b3, p))
|
|
19265
|
-
|
|
19265
|
+
d3[p] = b3[p];
|
|
19266
19266
|
};
|
|
19267
|
-
return extendStatics(
|
|
19267
|
+
return extendStatics(d2, b2);
|
|
19268
19268
|
};
|
|
19269
|
-
return function(
|
|
19269
|
+
return function(d2, b2) {
|
|
19270
19270
|
if (typeof b2 !== "function" && b2 !== null)
|
|
19271
19271
|
throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
|
|
19272
|
-
extendStatics(
|
|
19272
|
+
extendStatics(d2, b2);
|
|
19273
19273
|
function __() {
|
|
19274
|
-
this.constructor =
|
|
19274
|
+
this.constructor = d2;
|
|
19275
19275
|
}
|
|
19276
|
-
|
|
19276
|
+
d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __);
|
|
19277
19277
|
};
|
|
19278
19278
|
}();
|
|
19279
19279
|
var __assign = exports && exports.__assign || function() {
|
|
@@ -21378,7 +21378,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21378
21378
|
}
|
|
21379
21379
|
}
|
|
21380
21380
|
function parseDescriptors() {
|
|
21381
|
-
var pError = false, w2,
|
|
21381
|
+
var pError = false, w2, d2, h, i, candidate = {}, desc, lastChar, value, intVal, floatVal;
|
|
21382
21382
|
for (i = 0;i < descriptors.length; i++) {
|
|
21383
21383
|
desc = descriptors[i];
|
|
21384
21384
|
lastChar = desc[desc.length - 1];
|
|
@@ -21386,7 +21386,7 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21386
21386
|
intVal = parseInt(value, 10);
|
|
21387
21387
|
floatVal = parseFloat(value);
|
|
21388
21388
|
if (regexNonNegativeInteger.test(value) && lastChar === "w") {
|
|
21389
|
-
if (w2 ||
|
|
21389
|
+
if (w2 || d2) {
|
|
21390
21390
|
pError = true;
|
|
21391
21391
|
}
|
|
21392
21392
|
if (intVal === 0) {
|
|
@@ -21395,22 +21395,22 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21395
21395
|
w2 = intVal;
|
|
21396
21396
|
}
|
|
21397
21397
|
} else if (regexFloatingPoint.test(value) && lastChar === "x") {
|
|
21398
|
-
if (w2 ||
|
|
21398
|
+
if (w2 || d2 || h) {
|
|
21399
21399
|
pError = true;
|
|
21400
21400
|
}
|
|
21401
21401
|
if (floatVal < 0) {
|
|
21402
21402
|
pError = true;
|
|
21403
21403
|
} else {
|
|
21404
|
-
|
|
21404
|
+
d2 = floatVal;
|
|
21405
21405
|
}
|
|
21406
21406
|
} else if (regexNonNegativeInteger.test(value) && lastChar === "h") {
|
|
21407
|
-
if (
|
|
21407
|
+
if (h || d2) {
|
|
21408
21408
|
pError = true;
|
|
21409
21409
|
}
|
|
21410
21410
|
if (intVal === 0) {
|
|
21411
21411
|
pError = true;
|
|
21412
21412
|
} else {
|
|
21413
|
-
|
|
21413
|
+
h = intVal;
|
|
21414
21414
|
}
|
|
21415
21415
|
} else {
|
|
21416
21416
|
pError = true;
|
|
@@ -21421,11 +21421,11 @@ var require_parse_srcset = __commonJS((exports, module) => {
|
|
|
21421
21421
|
if (w2) {
|
|
21422
21422
|
candidate.w = w2;
|
|
21423
21423
|
}
|
|
21424
|
-
if (
|
|
21425
|
-
candidate.d =
|
|
21424
|
+
if (d2) {
|
|
21425
|
+
candidate.d = d2;
|
|
21426
21426
|
}
|
|
21427
|
-
if (
|
|
21428
|
-
candidate.h =
|
|
21427
|
+
if (h) {
|
|
21428
|
+
candidate.h = h;
|
|
21429
21429
|
}
|
|
21430
21430
|
candidates.push(candidate);
|
|
21431
21431
|
} else if (console && console.log) {
|
|
@@ -31416,88 +31416,95 @@ function L() {
|
|
|
31416
31416
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
31417
31417
|
}
|
|
31418
31418
|
var T = L();
|
|
31419
|
-
function
|
|
31419
|
+
function Z(u) {
|
|
31420
31420
|
T = u;
|
|
31421
31421
|
}
|
|
31422
|
-
var
|
|
31423
|
-
function
|
|
31422
|
+
var C = { exec: () => null };
|
|
31423
|
+
function k(u, e = "") {
|
|
31424
31424
|
let t = typeof u == "string" ? u : u.source, n = { replace: (r, i) => {
|
|
31425
31425
|
let s = typeof i == "string" ? i : i.source;
|
|
31426
31426
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
31427
31427
|
}, getRegex: () => new RegExp(t, e) };
|
|
31428
31428
|
return n;
|
|
31429
31429
|
}
|
|
31430
|
-
var
|
|
31431
|
-
|
|
31432
|
-
|
|
31433
|
-
|
|
31434
|
-
|
|
31435
|
-
|
|
31436
|
-
|
|
31437
|
-
var
|
|
31438
|
-
var
|
|
31439
|
-
var
|
|
31440
|
-
var
|
|
31441
|
-
var
|
|
31442
|
-
var
|
|
31443
|
-
var
|
|
31444
|
-
var
|
|
31430
|
+
var me = (() => {
|
|
31431
|
+
try {
|
|
31432
|
+
return !!new RegExp("(?<=1)(?<!1)");
|
|
31433
|
+
} catch {
|
|
31434
|
+
return false;
|
|
31435
|
+
}
|
|
31436
|
+
})();
|
|
31437
|
+
var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u) => new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}#`), htmlBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}<(?:[a-z].*>|!--)`, "i") };
|
|
31438
|
+
var xe = /^(?:[ \t]*(?:\n|$))+/;
|
|
31439
|
+
var be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
31440
|
+
var Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
31441
|
+
var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
31442
|
+
var Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
31443
|
+
var N = /(?:[*+-]|\d{1,9}[.)])/;
|
|
31444
|
+
var re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
31445
|
+
var se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
|
|
31446
|
+
var Oe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
|
|
31447
|
+
var Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
31448
|
+
var we = /^[^\n]+/;
|
|
31449
|
+
var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
31450
|
+
var ye = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
31451
|
+
var Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex();
|
|
31445
31452
|
var v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
31446
|
-
var
|
|
31447
|
-
var
|
|
31448
|
-
var
|
|
31449
|
-
var
|
|
31450
|
-
var
|
|
31451
|
-
var
|
|
31452
|
-
var
|
|
31453
|
-
var
|
|
31454
|
-
]`).replace("lheading",
|
|
31455
|
-
var
|
|
31456
|
-
var
|
|
31457
|
-
var
|
|
31458
|
-
var
|
|
31453
|
+
var j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
31454
|
+
var Se = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", j).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
31455
|
+
var ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
|
|
31456
|
+
var $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex();
|
|
31457
|
+
var U = { blockquote: $e, code: be, def: ye, fences: Re, heading: Te, hr: I, html: Se, lheading: se, list: Pe, newline: xe, paragraph: ie, table: C, text: we };
|
|
31458
|
+
var te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
|
|
31459
|
+
var _e = { ...U, lheading: Oe, table: te, paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() };
|
|
31460
|
+
var Le = { ...U, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: C, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
|
|
31461
|
+
]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
31462
|
+
var Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
31463
|
+
var ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
31464
|
+
var oe = /^( {2,}|\\)\n(?!\s*$)/;
|
|
31465
|
+
var Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
31459
31466
|
var D = /[\p{P}\p{S}]/u;
|
|
31460
|
-
var
|
|
31461
|
-
var
|
|
31462
|
-
var
|
|
31463
|
-
var
|
|
31464
|
-
var
|
|
31465
|
-
var
|
|
31466
|
-
var
|
|
31467
|
-
var
|
|
31468
|
-
var
|
|
31469
|
-
var
|
|
31470
|
-
var
|
|
31471
|
-
var
|
|
31472
|
-
var
|
|
31473
|
-
var
|
|
31474
|
-
var
|
|
31475
|
-
var
|
|
31476
|
-
var
|
|
31477
|
-
var
|
|
31467
|
+
var K = /[\s\p{P}\p{S}]/u;
|
|
31468
|
+
var ae = /[^\s\p{P}\p{S}]/u;
|
|
31469
|
+
var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex();
|
|
31470
|
+
var le = /(?!~)[\p{P}\p{S}]/u;
|
|
31471
|
+
var Ie = /(?!~)[\s\p{P}\p{S}]/u;
|
|
31472
|
+
var Ee = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
31473
|
+
var Be = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", me ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
31474
|
+
var ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
31475
|
+
var qe = k(ue, "u").replace(/punct/g, D).getRegex();
|
|
31476
|
+
var ve = k(ue, "u").replace(/punct/g, le).getRegex();
|
|
31477
|
+
var pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
31478
|
+
var De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
|
|
31479
|
+
var He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex();
|
|
31480
|
+
var Ze = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
|
|
31481
|
+
var Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
|
|
31482
|
+
var Ne = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
|
|
31483
|
+
var Qe = k(j).replace("(?:-->|$)", "-->").getRegex();
|
|
31484
|
+
var Fe = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
31478
31485
|
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
|
|
31479
|
-
var
|
|
31480
|
-
var
|
|
31481
|
-
var
|
|
31482
|
-
var
|
|
31483
|
-
var
|
|
31484
|
-
var
|
|
31485
|
-
var
|
|
31486
|
-
var
|
|
31487
|
-
var
|
|
31488
|
-
var
|
|
31489
|
-
var M = { normal:
|
|
31490
|
-
var
|
|
31491
|
-
var
|
|
31486
|
+
var je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
31487
|
+
var ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
|
|
31488
|
+
var he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
|
|
31489
|
+
var Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex();
|
|
31490
|
+
var ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
31491
|
+
var W = { _backpedal: C, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: oe, code: ze, del: C, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ue, tag: Fe, text: Ae, url: C };
|
|
31492
|
+
var Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
|
|
31493
|
+
var G = { ...W, emStrongRDelimAst: He, emStrongLDelim: ve, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() };
|
|
31494
|
+
var We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
31495
|
+
var E = { normal: U, gfm: _e, pedantic: Le };
|
|
31496
|
+
var M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
|
|
31497
|
+
var Xe = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
31498
|
+
var ke = (u) => Xe[u];
|
|
31492
31499
|
function w(u, e) {
|
|
31493
31500
|
if (e) {
|
|
31494
31501
|
if (m.escapeTest.test(u))
|
|
31495
|
-
return u.replace(m.escapeReplace,
|
|
31502
|
+
return u.replace(m.escapeReplace, ke);
|
|
31496
31503
|
} else if (m.escapeTestNoEncode.test(u))
|
|
31497
|
-
return u.replace(m.escapeReplaceNoEncode,
|
|
31504
|
+
return u.replace(m.escapeReplaceNoEncode, ke);
|
|
31498
31505
|
return u;
|
|
31499
31506
|
}
|
|
31500
|
-
function
|
|
31507
|
+
function X(u) {
|
|
31501
31508
|
try {
|
|
31502
31509
|
u = encodeURI(u).replace(m.percentDecode, "%");
|
|
31503
31510
|
} catch {
|
|
@@ -31505,12 +31512,12 @@ function J(u) {
|
|
|
31505
31512
|
}
|
|
31506
31513
|
return u;
|
|
31507
31514
|
}
|
|
31508
|
-
function
|
|
31509
|
-
let t = u.replace(m.findPipe, (i, s,
|
|
31510
|
-
let
|
|
31511
|
-
for (;--l >= 0 &&
|
|
31512
|
-
|
|
31513
|
-
return
|
|
31515
|
+
function J(u, e) {
|
|
31516
|
+
let t = u.replace(m.findPipe, (i, s, a) => {
|
|
31517
|
+
let o = false, l = s;
|
|
31518
|
+
for (;--l >= 0 && a[l] === "\\"; )
|
|
31519
|
+
o = !o;
|
|
31520
|
+
return o ? "|" : " |";
|
|
31514
31521
|
}), n = t.split(m.splitPipe), r = 0;
|
|
31515
31522
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e)
|
|
31516
31523
|
if (n.length > e)
|
|
@@ -31538,7 +31545,7 @@ function z(u, e, t) {
|
|
|
31538
31545
|
}
|
|
31539
31546
|
return u.slice(0, n - r);
|
|
31540
31547
|
}
|
|
31541
|
-
function
|
|
31548
|
+
function de(u, e) {
|
|
31542
31549
|
if (u.indexOf(e[1]) === -1)
|
|
31543
31550
|
return -1;
|
|
31544
31551
|
let t = 0;
|
|
@@ -31551,13 +31558,13 @@ function fe(u, e) {
|
|
|
31551
31558
|
return n;
|
|
31552
31559
|
return t > 0 ? -2 : -1;
|
|
31553
31560
|
}
|
|
31554
|
-
function
|
|
31555
|
-
let i = e.href, s = e.title || null,
|
|
31561
|
+
function ge(u, e, t, n, r) {
|
|
31562
|
+
let i = e.href, s = e.title || null, a = u[1].replace(r.other.outputLinkReplace, "$1");
|
|
31556
31563
|
n.state.inLink = true;
|
|
31557
|
-
let
|
|
31558
|
-
return n.state.inLink = false,
|
|
31564
|
+
let o = { type: u[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
|
|
31565
|
+
return n.state.inLink = false, o;
|
|
31559
31566
|
}
|
|
31560
|
-
function
|
|
31567
|
+
function Je(u, e, t) {
|
|
31561
31568
|
let n = u.match(t.other.indentCodeCompensation);
|
|
31562
31569
|
if (n === null)
|
|
31563
31570
|
return e;
|
|
@@ -31567,8 +31574,8 @@ function Ve(u, e, t) {
|
|
|
31567
31574
|
let s = i.match(t.other.beginningSpace);
|
|
31568
31575
|
if (s === null)
|
|
31569
31576
|
return i;
|
|
31570
|
-
let [
|
|
31571
|
-
return
|
|
31577
|
+
let [a] = s;
|
|
31578
|
+
return a.length >= r.length ? i.slice(r.length) : i;
|
|
31572
31579
|
}).join(`
|
|
31573
31580
|
`);
|
|
31574
31581
|
}
|
|
@@ -31595,7 +31602,7 @@ var y = class {
|
|
|
31595
31602
|
fences(e) {
|
|
31596
31603
|
let t = this.rules.block.fences.exec(e);
|
|
31597
31604
|
if (t) {
|
|
31598
|
-
let n = t[0], r =
|
|
31605
|
+
let n = t[0], r = Je(n, t[3] || "", this.rules);
|
|
31599
31606
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
31600
31607
|
}
|
|
31601
31608
|
}
|
|
@@ -31623,38 +31630,38 @@ var y = class {
|
|
|
31623
31630
|
`).split(`
|
|
31624
31631
|
`), r = "", i = "", s = [];
|
|
31625
31632
|
for (;n.length > 0; ) {
|
|
31626
|
-
let
|
|
31633
|
+
let a = false, o = [], l;
|
|
31627
31634
|
for (l = 0;l < n.length; l++)
|
|
31628
31635
|
if (this.rules.other.blockquoteStart.test(n[l]))
|
|
31629
|
-
|
|
31630
|
-
else if (!
|
|
31631
|
-
|
|
31636
|
+
o.push(n[l]), a = true;
|
|
31637
|
+
else if (!a)
|
|
31638
|
+
o.push(n[l]);
|
|
31632
31639
|
else
|
|
31633
31640
|
break;
|
|
31634
31641
|
n = n.slice(l);
|
|
31635
|
-
let
|
|
31636
|
-
`),
|
|
31642
|
+
let p = o.join(`
|
|
31643
|
+
`), c = p.replace(this.rules.other.blockquoteSetextReplace, `
|
|
31637
31644
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
31638
31645
|
r = r ? `${r}
|
|
31639
|
-
${
|
|
31640
|
-
${
|
|
31646
|
+
${p}` : p, i = i ? `${i}
|
|
31647
|
+
${c}` : c;
|
|
31641
31648
|
let g = this.lexer.state.top;
|
|
31642
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(
|
|
31649
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0)
|
|
31643
31650
|
break;
|
|
31644
|
-
let
|
|
31645
|
-
if (
|
|
31651
|
+
let h = s.at(-1);
|
|
31652
|
+
if (h?.type === "code")
|
|
31646
31653
|
break;
|
|
31647
|
-
if (
|
|
31648
|
-
let R =
|
|
31654
|
+
if (h?.type === "blockquote") {
|
|
31655
|
+
let R = h, f = R.raw + `
|
|
31649
31656
|
` + n.join(`
|
|
31650
31657
|
`), O = this.blockquote(f);
|
|
31651
31658
|
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
31652
31659
|
break;
|
|
31653
|
-
} else if (
|
|
31654
|
-
let R =
|
|
31660
|
+
} else if (h?.type === "list") {
|
|
31661
|
+
let R = h, f = R.raw + `
|
|
31655
31662
|
` + n.join(`
|
|
31656
31663
|
`), O = this.list(f);
|
|
31657
|
-
s[s.length - 1] = O, r = r.substring(0, r.length -
|
|
31664
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - h.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
31658
31665
|
`);
|
|
31659
31666
|
continue;
|
|
31660
31667
|
}
|
|
@@ -31667,54 +31674,71 @@ ${p}` : p;
|
|
|
31667
31674
|
if (t) {
|
|
31668
31675
|
let n = t[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
|
|
31669
31676
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
31670
|
-
let s = this.rules.other.listItemRegex(n),
|
|
31677
|
+
let s = this.rules.other.listItemRegex(n), a = false;
|
|
31671
31678
|
for (;e; ) {
|
|
31672
|
-
let l = false,
|
|
31679
|
+
let l = false, p = "", c = "";
|
|
31673
31680
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e))
|
|
31674
31681
|
break;
|
|
31675
|
-
|
|
31682
|
+
p = t[0], e = e.substring(p.length);
|
|
31676
31683
|
let g = t[2].split(`
|
|
31677
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (
|
|
31684
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h = e.split(`
|
|
31678
31685
|
`, 1)[0], R = !g.trim(), f = 0;
|
|
31679
|
-
if (this.options.pedantic ? (f = 2,
|
|
31680
|
-
`, e = e.substring(
|
|
31681
|
-
let
|
|
31686
|
+
if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (p += h + `
|
|
31687
|
+
`, e = e.substring(h.length + 1), l = true), !l) {
|
|
31688
|
+
let O = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
|
|
31682
31689
|
for (;e; ) {
|
|
31683
|
-
let
|
|
31690
|
+
let H = e.split(`
|
|
31684
31691
|
`, 1)[0], A;
|
|
31685
|
-
if (
|
|
31692
|
+
if (h = H, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), A = h) : A = h.replace(this.rules.other.tabCharGlobal, " "), Y.test(h) || ee.test(h) || fe.test(h) || O.test(h) || V.test(h))
|
|
31686
31693
|
break;
|
|
31687
|
-
if (A.search(this.rules.other.nonSpaceChar) >= f || !
|
|
31688
|
-
|
|
31694
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !h.trim())
|
|
31695
|
+
c += `
|
|
31689
31696
|
` + A.slice(f);
|
|
31690
31697
|
else {
|
|
31691
|
-
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 ||
|
|
31698
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g))
|
|
31692
31699
|
break;
|
|
31693
|
-
|
|
31694
|
-
` +
|
|
31700
|
+
c += `
|
|
31701
|
+
` + h;
|
|
31695
31702
|
}
|
|
31696
|
-
!R && !
|
|
31697
|
-
`, e = e.substring(
|
|
31703
|
+
!R && !h.trim() && (R = true), p += H + `
|
|
31704
|
+
`, e = e.substring(H.length + 1), g = A.slice(f);
|
|
31698
31705
|
}
|
|
31699
31706
|
}
|
|
31700
|
-
i.loose || (
|
|
31701
|
-
let O = null, Y;
|
|
31702
|
-
this.options.gfm && (O = this.rules.other.listIsTask.exec(p), O && (Y = O[0] !== "[ ] ", p = p.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: c, task: !!O, checked: Y, loose: false, text: p, tokens: [] }), i.raw += c;
|
|
31707
|
+
i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
|
|
31703
31708
|
}
|
|
31704
|
-
let
|
|
31705
|
-
if (
|
|
31706
|
-
|
|
31709
|
+
let o = i.items.at(-1);
|
|
31710
|
+
if (o)
|
|
31711
|
+
o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
31707
31712
|
else
|
|
31708
31713
|
return;
|
|
31709
31714
|
i.raw = i.raw.trimEnd();
|
|
31710
|
-
for (let l
|
|
31711
|
-
if (this.lexer.state.top = false,
|
|
31712
|
-
|
|
31713
|
-
|
|
31715
|
+
for (let l of i.items) {
|
|
31716
|
+
if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
|
|
31717
|
+
if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
|
|
31718
|
+
l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
|
|
31719
|
+
for (let c = this.lexer.inlineQueue.length - 1;c >= 0; c--)
|
|
31720
|
+
if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
|
|
31721
|
+
this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
|
|
31722
|
+
break;
|
|
31723
|
+
}
|
|
31724
|
+
}
|
|
31725
|
+
let p = this.rules.other.listTaskCheckbox.exec(l.raw);
|
|
31726
|
+
if (p) {
|
|
31727
|
+
let c = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
31728
|
+
l.checked = c.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = c.raw + l.tokens[0].raw, l.tokens[0].text = c.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(c)) : l.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : l.tokens.unshift(c);
|
|
31729
|
+
}
|
|
31730
|
+
}
|
|
31731
|
+
if (!i.loose) {
|
|
31732
|
+
let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
31733
|
+
i.loose = c;
|
|
31714
31734
|
}
|
|
31735
|
+
}
|
|
31715
31736
|
if (i.loose)
|
|
31716
|
-
for (let l
|
|
31717
|
-
|
|
31737
|
+
for (let l of i.items) {
|
|
31738
|
+
l.loose = true;
|
|
31739
|
+
for (let p of l.tokens)
|
|
31740
|
+
p.type === "text" && (p.type = "paragraph");
|
|
31741
|
+
}
|
|
31718
31742
|
return i;
|
|
31719
31743
|
}
|
|
31720
31744
|
}
|
|
@@ -31734,15 +31758,15 @@ ${p}` : p;
|
|
|
31734
31758
|
let t = this.rules.block.table.exec(e);
|
|
31735
31759
|
if (!t || !this.rules.other.tableDelimiter.test(t[2]))
|
|
31736
31760
|
return;
|
|
31737
|
-
let n =
|
|
31761
|
+
let n = J(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
31738
31762
|
`) : [], s = { type: "table", raw: t[0], header: [], align: [], rows: [] };
|
|
31739
31763
|
if (n.length === r.length) {
|
|
31740
|
-
for (let
|
|
31741
|
-
this.rules.other.tableAlignRight.test(
|
|
31742
|
-
for (let
|
|
31743
|
-
s.header.push({ text: n[
|
|
31744
|
-
for (let
|
|
31745
|
-
s.rows.push(
|
|
31764
|
+
for (let a of r)
|
|
31765
|
+
this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
|
|
31766
|
+
for (let a = 0;a < n.length; a++)
|
|
31767
|
+
s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
|
|
31768
|
+
for (let a of i)
|
|
31769
|
+
s.rows.push(J(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
|
|
31746
31770
|
return s;
|
|
31747
31771
|
}
|
|
31748
31772
|
}
|
|
@@ -31785,12 +31809,12 @@ ${p}` : p;
|
|
|
31785
31809
|
if ((n.length - s.length) % 2 === 0)
|
|
31786
31810
|
return;
|
|
31787
31811
|
} else {
|
|
31788
|
-
let s =
|
|
31812
|
+
let s = de(t[2], "()");
|
|
31789
31813
|
if (s === -2)
|
|
31790
31814
|
return;
|
|
31791
31815
|
if (s > -1) {
|
|
31792
|
-
let
|
|
31793
|
-
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0,
|
|
31816
|
+
let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
31817
|
+
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
|
|
31794
31818
|
}
|
|
31795
31819
|
}
|
|
31796
31820
|
let r = t[2], i = "";
|
|
@@ -31799,7 +31823,7 @@ ${p}` : p;
|
|
|
31799
31823
|
s && (r = s[1], i = s[3]);
|
|
31800
31824
|
} else
|
|
31801
31825
|
i = t[3] ? t[3].slice(1, -1) : "";
|
|
31802
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
31826
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ge(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
31803
31827
|
}
|
|
31804
31828
|
}
|
|
31805
31829
|
reflink(e, t) {
|
|
@@ -31810,7 +31834,7 @@ ${p}` : p;
|
|
|
31810
31834
|
let s = n[0].charAt(0);
|
|
31811
31835
|
return { type: "text", raw: s, text: s };
|
|
31812
31836
|
}
|
|
31813
|
-
return
|
|
31837
|
+
return ge(n, i, n[0], this.lexer, this.rules);
|
|
31814
31838
|
}
|
|
31815
31839
|
}
|
|
31816
31840
|
emStrong(e, t, n = "") {
|
|
@@ -31818,27 +31842,27 @@ ${p}` : p;
|
|
|
31818
31842
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric))
|
|
31819
31843
|
return;
|
|
31820
31844
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
31821
|
-
let s = [...r[0]].length - 1,
|
|
31822
|
-
for (
|
|
31823
|
-
if (
|
|
31845
|
+
let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
31846
|
+
for (c.lastIndex = 0, t = t.slice(-1 * e.length + s);(r = c.exec(t)) != null; ) {
|
|
31847
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a)
|
|
31824
31848
|
continue;
|
|
31825
|
-
if (
|
|
31826
|
-
l +=
|
|
31849
|
+
if (o = [...a].length, r[3] || r[4]) {
|
|
31850
|
+
l += o;
|
|
31827
31851
|
continue;
|
|
31828
|
-
} else if ((r[5] || r[6]) && s % 3 && !((s +
|
|
31829
|
-
|
|
31852
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
|
|
31853
|
+
p += o;
|
|
31830
31854
|
continue;
|
|
31831
31855
|
}
|
|
31832
|
-
if (l -=
|
|
31856
|
+
if (l -= o, l > 0)
|
|
31833
31857
|
continue;
|
|
31834
|
-
|
|
31835
|
-
let g = [...r[0]][0].length,
|
|
31836
|
-
if (Math.min(s,
|
|
31837
|
-
let f =
|
|
31838
|
-
return { type: "em", raw:
|
|
31858
|
+
o = Math.min(o, o + l + p);
|
|
31859
|
+
let g = [...r[0]][0].length, h = e.slice(0, s + r.index + g + o);
|
|
31860
|
+
if (Math.min(s, o) % 2) {
|
|
31861
|
+
let f = h.slice(1, -1);
|
|
31862
|
+
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
31839
31863
|
}
|
|
31840
|
-
let R =
|
|
31841
|
-
return { type: "strong", raw:
|
|
31864
|
+
let R = h.slice(2, -2);
|
|
31865
|
+
return { type: "strong", raw: h, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
31842
31866
|
}
|
|
31843
31867
|
}
|
|
31844
31868
|
}
|
|
@@ -31894,15 +31918,15 @@ var x = class u {
|
|
|
31894
31918
|
tokens;
|
|
31895
31919
|
options;
|
|
31896
31920
|
state;
|
|
31897
|
-
tokenizer;
|
|
31898
31921
|
inlineQueue;
|
|
31922
|
+
tokenizer;
|
|
31899
31923
|
constructor(e) {
|
|
31900
31924
|
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
31901
|
-
let t = { other: m, block:
|
|
31902
|
-
this.options.pedantic ? (t.block =
|
|
31925
|
+
let t = { other: m, block: E.normal, inline: M.normal };
|
|
31926
|
+
this.options.pedantic ? (t.block = E.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = E.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
31903
31927
|
}
|
|
31904
31928
|
static get rules() {
|
|
31905
|
-
return { block:
|
|
31929
|
+
return { block: E, inline: M };
|
|
31906
31930
|
}
|
|
31907
31931
|
static lex(e, t) {
|
|
31908
31932
|
return new u(t).lex(e);
|
|
@@ -31983,9 +32007,9 @@ var x = class u {
|
|
|
31983
32007
|
}
|
|
31984
32008
|
let i = e;
|
|
31985
32009
|
if (this.options.extensions?.startBlock) {
|
|
31986
|
-
let s = 1 / 0,
|
|
32010
|
+
let s = 1 / 0, a = e.slice(1), o;
|
|
31987
32011
|
this.options.extensions.startBlock.forEach((l) => {
|
|
31988
|
-
|
|
32012
|
+
o = l.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
|
|
31989
32013
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
31990
32014
|
}
|
|
31991
32015
|
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
@@ -32029,14 +32053,15 @@ var x = class u {
|
|
|
32029
32053
|
}
|
|
32030
32054
|
for (;(r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; )
|
|
32031
32055
|
n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
32056
|
+
let i;
|
|
32032
32057
|
for (;(r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; )
|
|
32033
|
-
n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
32058
|
+
i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
32034
32059
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
32035
|
-
let
|
|
32060
|
+
let s = false, a = "";
|
|
32036
32061
|
for (;e; ) {
|
|
32037
|
-
|
|
32062
|
+
s || (a = ""), s = false;
|
|
32038
32063
|
let o;
|
|
32039
|
-
if (this.options.extensions?.inline?.some((
|
|
32064
|
+
if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false))
|
|
32040
32065
|
continue;
|
|
32041
32066
|
if (o = this.tokenizer.escape(e)) {
|
|
32042
32067
|
e = e.substring(o.raw.length), t.push(o);
|
|
@@ -32052,11 +32077,11 @@ var x = class u {
|
|
|
32052
32077
|
}
|
|
32053
32078
|
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
32054
32079
|
e = e.substring(o.raw.length);
|
|
32055
|
-
let
|
|
32056
|
-
o.type === "text" &&
|
|
32080
|
+
let p = t.at(-1);
|
|
32081
|
+
o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
|
|
32057
32082
|
continue;
|
|
32058
32083
|
}
|
|
32059
|
-
if (o = this.tokenizer.emStrong(e, n,
|
|
32084
|
+
if (o = this.tokenizer.emStrong(e, n, a)) {
|
|
32060
32085
|
e = e.substring(o.raw.length), t.push(o);
|
|
32061
32086
|
continue;
|
|
32062
32087
|
}
|
|
@@ -32080,26 +32105,26 @@ var x = class u {
|
|
|
32080
32105
|
e = e.substring(o.raw.length), t.push(o);
|
|
32081
32106
|
continue;
|
|
32082
32107
|
}
|
|
32083
|
-
let
|
|
32108
|
+
let l = e;
|
|
32084
32109
|
if (this.options.extensions?.startInline) {
|
|
32085
|
-
let
|
|
32086
|
-
this.options.extensions.startInline.forEach((
|
|
32087
|
-
|
|
32088
|
-
}),
|
|
32089
|
-
}
|
|
32090
|
-
if (o = this.tokenizer.inlineText(
|
|
32091
|
-
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (
|
|
32092
|
-
let
|
|
32093
|
-
|
|
32110
|
+
let p = 1 / 0, c = e.slice(1), g;
|
|
32111
|
+
this.options.extensions.startInline.forEach((h) => {
|
|
32112
|
+
g = h.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
|
|
32113
|
+
}), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
|
|
32114
|
+
}
|
|
32115
|
+
if (o = this.tokenizer.inlineText(l)) {
|
|
32116
|
+
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
|
|
32117
|
+
let p = t.at(-1);
|
|
32118
|
+
p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t.push(o);
|
|
32094
32119
|
continue;
|
|
32095
32120
|
}
|
|
32096
32121
|
if (e) {
|
|
32097
|
-
let
|
|
32122
|
+
let p = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
32098
32123
|
if (this.options.silent) {
|
|
32099
|
-
console.error(
|
|
32124
|
+
console.error(p);
|
|
32100
32125
|
break;
|
|
32101
32126
|
} else
|
|
32102
|
-
throw new Error(
|
|
32127
|
+
throw new Error(p);
|
|
32103
32128
|
}
|
|
32104
32129
|
}
|
|
32105
32130
|
return t;
|
|
@@ -32142,9 +32167,9 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
32142
32167
|
}
|
|
32143
32168
|
list(e) {
|
|
32144
32169
|
let { ordered: t, start: n } = e, r = "";
|
|
32145
|
-
for (let
|
|
32146
|
-
let
|
|
32147
|
-
r += this.listitem(
|
|
32170
|
+
for (let a = 0;a < e.items.length; a++) {
|
|
32171
|
+
let o = e.items[a];
|
|
32172
|
+
r += this.listitem(o);
|
|
32148
32173
|
}
|
|
32149
32174
|
let i = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
32150
32175
|
return "<" + i + s + `>
|
|
@@ -32152,16 +32177,11 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
32152
32177
|
`;
|
|
32153
32178
|
}
|
|
32154
32179
|
listitem(e) {
|
|
32155
|
-
|
|
32156
|
-
if (e.task) {
|
|
32157
|
-
let n = this.checkbox({ checked: !!e.checked });
|
|
32158
|
-
e.loose ? e.tokens[0]?.type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + w(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = true)) : e.tokens.unshift({ type: "text", raw: n + " ", text: n + " ", escaped: true }) : t += n + " ";
|
|
32159
|
-
}
|
|
32160
|
-
return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
|
|
32180
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
32161
32181
|
`;
|
|
32162
32182
|
}
|
|
32163
32183
|
checkbox({ checked: e }) {
|
|
32164
|
-
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
|
|
32184
|
+
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
32165
32185
|
}
|
|
32166
32186
|
paragraph({ tokens: e }) {
|
|
32167
32187
|
return `<p>${this.parser.parseInline(e)}</p>
|
|
@@ -32176,8 +32196,8 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
32176
32196
|
for (let i = 0;i < e.rows.length; i++) {
|
|
32177
32197
|
let s = e.rows[i];
|
|
32178
32198
|
n = "";
|
|
32179
|
-
for (let
|
|
32180
|
-
n += this.tablecell(s[
|
|
32199
|
+
for (let a = 0;a < s.length; a++)
|
|
32200
|
+
n += this.tablecell(s[a]);
|
|
32181
32201
|
r += this.tablerow({ text: n });
|
|
32182
32202
|
}
|
|
32183
32203
|
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
@@ -32212,7 +32232,7 @@ ${e}</tr>
|
|
|
32212
32232
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
32213
32233
|
}
|
|
32214
32234
|
link({ href: e, title: t, tokens: n }) {
|
|
32215
|
-
let r = this.parser.parseInline(n), i =
|
|
32235
|
+
let r = this.parser.parseInline(n), i = X(e);
|
|
32216
32236
|
if (i === null)
|
|
32217
32237
|
return r;
|
|
32218
32238
|
e = i;
|
|
@@ -32221,7 +32241,7 @@ ${e}</tr>
|
|
|
32221
32241
|
}
|
|
32222
32242
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
32223
32243
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
32224
|
-
let i =
|
|
32244
|
+
let i = X(e);
|
|
32225
32245
|
if (i === null)
|
|
32226
32246
|
return w(n);
|
|
32227
32247
|
e = i;
|
|
@@ -32260,6 +32280,9 @@ var $ = class {
|
|
|
32260
32280
|
br() {
|
|
32261
32281
|
return "";
|
|
32262
32282
|
}
|
|
32283
|
+
checkbox({ raw: e }) {
|
|
32284
|
+
return e;
|
|
32285
|
+
}
|
|
32263
32286
|
};
|
|
32264
32287
|
var b = class u2 {
|
|
32265
32288
|
options;
|
|
@@ -32274,85 +32297,85 @@ var b = class u2 {
|
|
|
32274
32297
|
static parseInline(e, t) {
|
|
32275
32298
|
return new u2(t).parseInline(e);
|
|
32276
32299
|
}
|
|
32277
|
-
parse(e
|
|
32278
|
-
let
|
|
32279
|
-
for (let
|
|
32280
|
-
let
|
|
32281
|
-
if (this.options.extensions?.renderers?.[
|
|
32282
|
-
let
|
|
32283
|
-
if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(
|
|
32284
|
-
|
|
32300
|
+
parse(e) {
|
|
32301
|
+
let t = "";
|
|
32302
|
+
for (let n = 0;n < e.length; n++) {
|
|
32303
|
+
let r = e[n];
|
|
32304
|
+
if (this.options.extensions?.renderers?.[r.type]) {
|
|
32305
|
+
let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
32306
|
+
if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
|
|
32307
|
+
t += a || "";
|
|
32285
32308
|
continue;
|
|
32286
32309
|
}
|
|
32287
32310
|
}
|
|
32288
|
-
let
|
|
32289
|
-
switch (
|
|
32311
|
+
let i = r;
|
|
32312
|
+
switch (i.type) {
|
|
32290
32313
|
case "space": {
|
|
32291
|
-
|
|
32292
|
-
|
|
32314
|
+
t += this.renderer.space(i);
|
|
32315
|
+
break;
|
|
32293
32316
|
}
|
|
32294
32317
|
case "hr": {
|
|
32295
|
-
|
|
32296
|
-
|
|
32318
|
+
t += this.renderer.hr(i);
|
|
32319
|
+
break;
|
|
32297
32320
|
}
|
|
32298
32321
|
case "heading": {
|
|
32299
|
-
|
|
32300
|
-
|
|
32322
|
+
t += this.renderer.heading(i);
|
|
32323
|
+
break;
|
|
32301
32324
|
}
|
|
32302
32325
|
case "code": {
|
|
32303
|
-
|
|
32304
|
-
|
|
32326
|
+
t += this.renderer.code(i);
|
|
32327
|
+
break;
|
|
32305
32328
|
}
|
|
32306
32329
|
case "table": {
|
|
32307
|
-
|
|
32308
|
-
|
|
32330
|
+
t += this.renderer.table(i);
|
|
32331
|
+
break;
|
|
32309
32332
|
}
|
|
32310
32333
|
case "blockquote": {
|
|
32311
|
-
|
|
32312
|
-
|
|
32334
|
+
t += this.renderer.blockquote(i);
|
|
32335
|
+
break;
|
|
32313
32336
|
}
|
|
32314
32337
|
case "list": {
|
|
32315
|
-
|
|
32316
|
-
|
|
32338
|
+
t += this.renderer.list(i);
|
|
32339
|
+
break;
|
|
32340
|
+
}
|
|
32341
|
+
case "checkbox": {
|
|
32342
|
+
t += this.renderer.checkbox(i);
|
|
32343
|
+
break;
|
|
32317
32344
|
}
|
|
32318
32345
|
case "html": {
|
|
32319
|
-
|
|
32320
|
-
|
|
32346
|
+
t += this.renderer.html(i);
|
|
32347
|
+
break;
|
|
32321
32348
|
}
|
|
32322
32349
|
case "def": {
|
|
32323
|
-
|
|
32324
|
-
|
|
32350
|
+
t += this.renderer.def(i);
|
|
32351
|
+
break;
|
|
32325
32352
|
}
|
|
32326
32353
|
case "paragraph": {
|
|
32327
|
-
|
|
32328
|
-
|
|
32354
|
+
t += this.renderer.paragraph(i);
|
|
32355
|
+
break;
|
|
32329
32356
|
}
|
|
32330
32357
|
case "text": {
|
|
32331
|
-
|
|
32332
|
-
|
|
32333
|
-
o = e[++r], a += `
|
|
32334
|
-
` + this.renderer.text(o);
|
|
32335
|
-
t ? n += this.renderer.paragraph({ type: "paragraph", raw: a, text: a, tokens: [{ type: "text", raw: a, text: a, escaped: true }] }) : n += a;
|
|
32336
|
-
continue;
|
|
32358
|
+
t += this.renderer.text(i);
|
|
32359
|
+
break;
|
|
32337
32360
|
}
|
|
32338
32361
|
default: {
|
|
32339
|
-
let
|
|
32362
|
+
let s = 'Token with "' + i.type + '" type was not found.';
|
|
32340
32363
|
if (this.options.silent)
|
|
32341
|
-
return console.error(
|
|
32342
|
-
throw new Error(
|
|
32364
|
+
return console.error(s), "";
|
|
32365
|
+
throw new Error(s);
|
|
32343
32366
|
}
|
|
32344
32367
|
}
|
|
32345
32368
|
}
|
|
32346
|
-
return
|
|
32369
|
+
return t;
|
|
32347
32370
|
}
|
|
32348
32371
|
parseInline(e, t = this.renderer) {
|
|
32349
32372
|
let n = "";
|
|
32350
32373
|
for (let r = 0;r < e.length; r++) {
|
|
32351
32374
|
let i = e[r];
|
|
32352
32375
|
if (this.options.extensions?.renderers?.[i.type]) {
|
|
32353
|
-
let
|
|
32354
|
-
if (
|
|
32355
|
-
n +=
|
|
32376
|
+
let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
32377
|
+
if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
32378
|
+
n += a || "";
|
|
32356
32379
|
continue;
|
|
32357
32380
|
}
|
|
32358
32381
|
}
|
|
@@ -32374,6 +32397,10 @@ var b = class u2 {
|
|
|
32374
32397
|
n += t.image(s);
|
|
32375
32398
|
break;
|
|
32376
32399
|
}
|
|
32400
|
+
case "checkbox": {
|
|
32401
|
+
n += t.checkbox(s);
|
|
32402
|
+
break;
|
|
32403
|
+
}
|
|
32377
32404
|
case "strong": {
|
|
32378
32405
|
n += t.strong(s);
|
|
32379
32406
|
break;
|
|
@@ -32399,10 +32426,10 @@ var b = class u2 {
|
|
|
32399
32426
|
break;
|
|
32400
32427
|
}
|
|
32401
32428
|
default: {
|
|
32402
|
-
let
|
|
32429
|
+
let a = 'Token with "' + s.type + '" type was not found.';
|
|
32403
32430
|
if (this.options.silent)
|
|
32404
|
-
return console.error(
|
|
32405
|
-
throw new Error(
|
|
32431
|
+
return console.error(a), "";
|
|
32432
|
+
throw new Error(a);
|
|
32406
32433
|
}
|
|
32407
32434
|
}
|
|
32408
32435
|
}
|
|
@@ -32459,8 +32486,8 @@ var B = class {
|
|
|
32459
32486
|
for (let s of i.header)
|
|
32460
32487
|
n = n.concat(this.walkTokens(s.tokens, t));
|
|
32461
32488
|
for (let s of i.rows)
|
|
32462
|
-
for (let
|
|
32463
|
-
n = n.concat(this.walkTokens(
|
|
32489
|
+
for (let a of s)
|
|
32490
|
+
n = n.concat(this.walkTokens(a.tokens, t));
|
|
32464
32491
|
break;
|
|
32465
32492
|
}
|
|
32466
32493
|
case "list": {
|
|
@@ -32471,8 +32498,8 @@ var B = class {
|
|
|
32471
32498
|
default: {
|
|
32472
32499
|
let i = r;
|
|
32473
32500
|
this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
|
|
32474
|
-
let
|
|
32475
|
-
n = n.concat(this.walkTokens(
|
|
32501
|
+
let a = i[s].flat(1 / 0);
|
|
32502
|
+
n = n.concat(this.walkTokens(a, t));
|
|
32476
32503
|
}) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t)));
|
|
32477
32504
|
}
|
|
32478
32505
|
}
|
|
@@ -32487,9 +32514,9 @@ var B = class {
|
|
|
32487
32514
|
throw new Error("extension name required");
|
|
32488
32515
|
if ("renderer" in i) {
|
|
32489
32516
|
let s = t.renderers[i.name];
|
|
32490
|
-
s ? t.renderers[i.name] = function(...
|
|
32491
|
-
let
|
|
32492
|
-
return
|
|
32517
|
+
s ? t.renderers[i.name] = function(...a) {
|
|
32518
|
+
let o = i.renderer.apply(this, a);
|
|
32519
|
+
return o === false && (o = s.apply(this, a)), o;
|
|
32493
32520
|
} : t.renderers[i.name] = i.renderer;
|
|
32494
32521
|
}
|
|
32495
32522
|
if ("tokenizer" in i) {
|
|
@@ -32506,10 +32533,10 @@ var B = class {
|
|
|
32506
32533
|
throw new Error(`renderer '${s}' does not exist`);
|
|
32507
32534
|
if (["options", "parser"].includes(s))
|
|
32508
32535
|
continue;
|
|
32509
|
-
let
|
|
32510
|
-
i[
|
|
32511
|
-
let
|
|
32512
|
-
return
|
|
32536
|
+
let a = s, o = n.renderer[a], l = i[a];
|
|
32537
|
+
i[a] = (...p) => {
|
|
32538
|
+
let c = o.apply(i, p);
|
|
32539
|
+
return c === false && (c = l.apply(i, p)), c || "";
|
|
32513
32540
|
};
|
|
32514
32541
|
}
|
|
32515
32542
|
r.renderer = i;
|
|
@@ -32521,10 +32548,10 @@ var B = class {
|
|
|
32521
32548
|
throw new Error(`tokenizer '${s}' does not exist`);
|
|
32522
32549
|
if (["options", "rules", "lexer"].includes(s))
|
|
32523
32550
|
continue;
|
|
32524
|
-
let
|
|
32525
|
-
i[
|
|
32526
|
-
let
|
|
32527
|
-
return
|
|
32551
|
+
let a = s, o = n.tokenizer[a], l = i[a];
|
|
32552
|
+
i[a] = (...p) => {
|
|
32553
|
+
let c = o.apply(i, p);
|
|
32554
|
+
return c === false && (c = l.apply(i, p)), c;
|
|
32528
32555
|
};
|
|
32529
32556
|
}
|
|
32530
32557
|
r.tokenizer = i;
|
|
@@ -32536,32 +32563,32 @@ var B = class {
|
|
|
32536
32563
|
throw new Error(`hook '${s}' does not exist`);
|
|
32537
32564
|
if (["options", "block"].includes(s))
|
|
32538
32565
|
continue;
|
|
32539
|
-
let
|
|
32540
|
-
S.passThroughHooks.has(s) ? i[
|
|
32566
|
+
let a = s, o = n.hooks[a], l = i[a];
|
|
32567
|
+
S.passThroughHooks.has(s) ? i[a] = (p) => {
|
|
32541
32568
|
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s))
|
|
32542
32569
|
return (async () => {
|
|
32543
|
-
let g = await
|
|
32570
|
+
let g = await o.call(i, p);
|
|
32544
32571
|
return l.call(i, g);
|
|
32545
32572
|
})();
|
|
32546
|
-
let
|
|
32547
|
-
return l.call(i,
|
|
32548
|
-
} : i[
|
|
32573
|
+
let c = o.call(i, p);
|
|
32574
|
+
return l.call(i, c);
|
|
32575
|
+
} : i[a] = (...p) => {
|
|
32549
32576
|
if (this.defaults.async)
|
|
32550
32577
|
return (async () => {
|
|
32551
|
-
let g = await
|
|
32552
|
-
return g === false && (g = await l.apply(i,
|
|
32578
|
+
let g = await o.apply(i, p);
|
|
32579
|
+
return g === false && (g = await l.apply(i, p)), g;
|
|
32553
32580
|
})();
|
|
32554
|
-
let
|
|
32555
|
-
return
|
|
32581
|
+
let c = o.apply(i, p);
|
|
32582
|
+
return c === false && (c = l.apply(i, p)), c;
|
|
32556
32583
|
};
|
|
32557
32584
|
}
|
|
32558
32585
|
r.hooks = i;
|
|
32559
32586
|
}
|
|
32560
32587
|
if (n.walkTokens) {
|
|
32561
32588
|
let i = this.defaults.walkTokens, s = n.walkTokens;
|
|
32562
|
-
r.walkTokens = function(
|
|
32563
|
-
let
|
|
32564
|
-
return
|
|
32589
|
+
r.walkTokens = function(a) {
|
|
32590
|
+
let o = [];
|
|
32591
|
+
return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
|
|
32565
32592
|
};
|
|
32566
32593
|
}
|
|
32567
32594
|
this.defaults = { ...this.defaults, ...r };
|
|
@@ -32578,28 +32605,28 @@ var B = class {
|
|
|
32578
32605
|
}
|
|
32579
32606
|
parseMarkdown(e) {
|
|
32580
32607
|
return (n, r) => {
|
|
32581
|
-
let i = { ...r }, s = { ...this.defaults, ...i },
|
|
32608
|
+
let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
|
|
32582
32609
|
if (this.defaults.async === true && i.async === false)
|
|
32583
|
-
return
|
|
32610
|
+
return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
32584
32611
|
if (typeof n > "u" || n === null)
|
|
32585
|
-
return
|
|
32612
|
+
return a(new Error("marked(): input parameter is undefined or null"));
|
|
32586
32613
|
if (typeof n != "string")
|
|
32587
|
-
return
|
|
32614
|
+
return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
32588
32615
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async)
|
|
32589
32616
|
return (async () => {
|
|
32590
|
-
let
|
|
32591
|
-
s.walkTokens && await Promise.all(this.walkTokens(
|
|
32592
|
-
let
|
|
32593
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
32594
|
-
})().catch(
|
|
32617
|
+
let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
|
|
32618
|
+
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
32619
|
+
let h = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
|
|
32620
|
+
return s.hooks ? await s.hooks.postprocess(h) : h;
|
|
32621
|
+
})().catch(a);
|
|
32595
32622
|
try {
|
|
32596
32623
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
32597
32624
|
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
32598
32625
|
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
32599
|
-
let
|
|
32600
|
-
return s.hooks && (
|
|
32601
|
-
} catch (
|
|
32602
|
-
return o
|
|
32626
|
+
let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
32627
|
+
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
32628
|
+
} catch (o) {
|
|
32629
|
+
return a(o);
|
|
32603
32630
|
}
|
|
32604
32631
|
};
|
|
32605
32632
|
}
|
|
@@ -32617,37 +32644,37 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
32617
32644
|
}
|
|
32618
32645
|
};
|
|
32619
32646
|
var _ = new B;
|
|
32620
|
-
function
|
|
32647
|
+
function d(u3, e) {
|
|
32621
32648
|
return _.parse(u3, e);
|
|
32622
32649
|
}
|
|
32623
|
-
|
|
32624
|
-
return _.setOptions(u3),
|
|
32650
|
+
d.options = d.setOptions = function(u3) {
|
|
32651
|
+
return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
32625
32652
|
};
|
|
32626
|
-
|
|
32627
|
-
|
|
32628
|
-
|
|
32629
|
-
return _.use(...u3),
|
|
32653
|
+
d.getDefaults = L;
|
|
32654
|
+
d.defaults = T;
|
|
32655
|
+
d.use = function(...u3) {
|
|
32656
|
+
return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
32630
32657
|
};
|
|
32631
|
-
|
|
32658
|
+
d.walkTokens = function(u3, e) {
|
|
32632
32659
|
return _.walkTokens(u3, e);
|
|
32633
32660
|
};
|
|
32634
|
-
|
|
32635
|
-
|
|
32636
|
-
|
|
32637
|
-
|
|
32638
|
-
|
|
32639
|
-
|
|
32640
|
-
|
|
32641
|
-
|
|
32642
|
-
|
|
32643
|
-
|
|
32644
|
-
var
|
|
32645
|
-
var
|
|
32646
|
-
var
|
|
32647
|
-
var
|
|
32648
|
-
var
|
|
32649
|
-
var
|
|
32650
|
-
var
|
|
32661
|
+
d.parseInline = _.parseInline;
|
|
32662
|
+
d.Parser = b;
|
|
32663
|
+
d.parser = b.parse;
|
|
32664
|
+
d.Renderer = P;
|
|
32665
|
+
d.TextRenderer = $;
|
|
32666
|
+
d.Lexer = x;
|
|
32667
|
+
d.lexer = x.lex;
|
|
32668
|
+
d.Tokenizer = y;
|
|
32669
|
+
d.Hooks = S;
|
|
32670
|
+
d.parse = d;
|
|
32671
|
+
var Dt = d.options;
|
|
32672
|
+
var Ht = d.setOptions;
|
|
32673
|
+
var Zt = d.use;
|
|
32674
|
+
var Gt = d.walkTokens;
|
|
32675
|
+
var Nt = d.parseInline;
|
|
32676
|
+
var Ft = b.parse;
|
|
32677
|
+
var jt = x.lex;
|
|
32651
32678
|
|
|
32652
32679
|
// node_modules/marked-highlight/src/index.js
|
|
32653
32680
|
function markedHighlight(options2) {
|
|
@@ -32814,8 +32841,8 @@ function extractExcerpt(content, maxLength = 200) {
|
|
|
32814
32841
|
return truncated.substring(0, lastSpace) + "...";
|
|
32815
32842
|
}
|
|
32816
32843
|
function convertMarkdownToHtml(markdownContent) {
|
|
32817
|
-
const html = marked.parse(markdownContent);
|
|
32818
|
-
let sanitized = import_sanitize_html.default(html
|
|
32844
|
+
const html = marked.parse(markdownContent, { async: false });
|
|
32845
|
+
let sanitized = import_sanitize_html.default(html, {
|
|
32819
32846
|
allowedTags: import_sanitize_html.default.defaults.allowedTags.concat([
|
|
32820
32847
|
"img",
|
|
32821
32848
|
"h1",
|
|
@@ -32863,13 +32890,31 @@ async function parseMarkdownFile(filePath) {
|
|
|
32863
32890
|
try {
|
|
32864
32891
|
const fileContent = await readFileAsText(filePath);
|
|
32865
32892
|
if (fileContent === null) {
|
|
32866
|
-
|
|
32867
|
-
|
|
32893
|
+
return {
|
|
32894
|
+
post: null,
|
|
32895
|
+
error: {
|
|
32896
|
+
file: filePath,
|
|
32897
|
+
type: "file_not_found",
|
|
32898
|
+
message: "File not found or couldn't be read"
|
|
32899
|
+
}
|
|
32900
|
+
};
|
|
32868
32901
|
}
|
|
32869
32902
|
const { data, content } = import_gray_matter.default(fileContent);
|
|
32870
32903
|
if (!data.title || !data.date) {
|
|
32871
|
-
|
|
32872
|
-
|
|
32904
|
+
const missingFields = [];
|
|
32905
|
+
if (!data.title)
|
|
32906
|
+
missingFields.push("title");
|
|
32907
|
+
if (!data.date)
|
|
32908
|
+
missingFields.push("date");
|
|
32909
|
+
return {
|
|
32910
|
+
post: null,
|
|
32911
|
+
error: {
|
|
32912
|
+
file: filePath,
|
|
32913
|
+
type: "missing_field",
|
|
32914
|
+
message: `Missing required fields: ${missingFields.join(", ")}`,
|
|
32915
|
+
suggestion: "Add required frontmatter fields (title and date)"
|
|
32916
|
+
}
|
|
32917
|
+
};
|
|
32873
32918
|
}
|
|
32874
32919
|
let slug = data.slug || getBaseFilename(filePath);
|
|
32875
32920
|
const sanitizedHtml = convertMarkdownToHtml(content);
|
|
@@ -32888,24 +32933,98 @@ async function parseMarkdownFile(filePath) {
|
|
|
32888
32933
|
excerpt: data.excerpt || extractExcerpt(content),
|
|
32889
32934
|
html: sanitizedHtml
|
|
32890
32935
|
};
|
|
32891
|
-
return post;
|
|
32936
|
+
return { post, error: null };
|
|
32892
32937
|
} catch (error) {
|
|
32893
|
-
|
|
32894
|
-
|
|
32938
|
+
const isYamlError = error?.name === "YAMLException" || error?.message?.includes("YAML") || error?.message?.includes("mapping pair");
|
|
32939
|
+
let suggestion;
|
|
32940
|
+
if (isYamlError) {
|
|
32941
|
+
if (error?.message?.includes("mapping pair") || error?.message?.includes("colon")) {
|
|
32942
|
+
suggestion = 'Quote titles/descriptions containing colons (e.g., title: "My Post: A Guide")';
|
|
32943
|
+
} else if (error?.message?.includes("multiline key")) {
|
|
32944
|
+
suggestion = "Remove nested quotes or use single quotes inside double quotes";
|
|
32945
|
+
}
|
|
32946
|
+
}
|
|
32947
|
+
return {
|
|
32948
|
+
post: null,
|
|
32949
|
+
error: {
|
|
32950
|
+
file: filePath,
|
|
32951
|
+
type: isYamlError ? "yaml" : "unknown",
|
|
32952
|
+
message: error?.message || String(error),
|
|
32953
|
+
suggestion
|
|
32954
|
+
}
|
|
32955
|
+
};
|
|
32895
32956
|
}
|
|
32896
32957
|
}
|
|
32897
32958
|
|
|
32898
32959
|
// src/parser.ts
|
|
32899
|
-
async function parseMarkdownDirectory(contentDir) {
|
|
32960
|
+
async function parseMarkdownDirectory(contentDir, strictMode = false) {
|
|
32900
32961
|
try {
|
|
32901
32962
|
const markdownFiles = await findFilesByPattern("**/*.md", contentDir, true);
|
|
32902
32963
|
console.log(`Found ${markdownFiles.length} markdown files`);
|
|
32903
|
-
const
|
|
32904
|
-
const
|
|
32905
|
-
|
|
32964
|
+
const resultsPromises = markdownFiles.map((filePath) => parseMarkdownFile(filePath));
|
|
32965
|
+
const results = await Promise.all(resultsPromises);
|
|
32966
|
+
const posts = [];
|
|
32967
|
+
const errors = [];
|
|
32968
|
+
for (const result of results) {
|
|
32969
|
+
if (result.post) {
|
|
32970
|
+
posts.push(result.post);
|
|
32971
|
+
} else if (result.error) {
|
|
32972
|
+
errors.push(result.error);
|
|
32973
|
+
}
|
|
32974
|
+
}
|
|
32975
|
+
if (errors.length > 0) {
|
|
32976
|
+
console.error(`
|
|
32977
|
+
\u26A0\uFE0F Found ${errors.length} parsing error(s):
|
|
32978
|
+
`);
|
|
32979
|
+
const yamlErrors = errors.filter((e) => e.type === "yaml");
|
|
32980
|
+
const missingFieldErrors = errors.filter((e) => e.type === "missing_field");
|
|
32981
|
+
const otherErrors = errors.filter((e) => e.type !== "yaml" && e.type !== "missing_field");
|
|
32982
|
+
if (yamlErrors.length > 0) {
|
|
32983
|
+
console.error(` YAML Parsing Errors (${yamlErrors.length}):`);
|
|
32984
|
+
yamlErrors.slice(0, 5).forEach((e) => {
|
|
32985
|
+
console.error(` \u274C ${e.file}`);
|
|
32986
|
+
if (e.suggestion) {
|
|
32987
|
+
console.error(` \uD83D\uDCA1 ${e.suggestion}`);
|
|
32988
|
+
}
|
|
32989
|
+
});
|
|
32990
|
+
if (yamlErrors.length > 5) {
|
|
32991
|
+
console.error(` ... and ${yamlErrors.length - 5} more`);
|
|
32992
|
+
}
|
|
32993
|
+
console.error("");
|
|
32994
|
+
}
|
|
32995
|
+
if (missingFieldErrors.length > 0) {
|
|
32996
|
+
console.error(` Missing Required Fields (${missingFieldErrors.length}):`);
|
|
32997
|
+
missingFieldErrors.slice(0, 5).forEach((e) => {
|
|
32998
|
+
console.error(` \u26A0\uFE0F ${e.file}: ${e.message}`);
|
|
32999
|
+
});
|
|
33000
|
+
if (missingFieldErrors.length > 5) {
|
|
33001
|
+
console.error(` ... and ${missingFieldErrors.length - 5} more`);
|
|
33002
|
+
}
|
|
33003
|
+
console.error("");
|
|
33004
|
+
}
|
|
33005
|
+
if (otherErrors.length > 0) {
|
|
33006
|
+
console.error(` Other Errors (${otherErrors.length}):`);
|
|
33007
|
+
otherErrors.slice(0, 3).forEach((e) => {
|
|
33008
|
+
console.error(` \u274C ${e.file}: ${e.message}`);
|
|
33009
|
+
});
|
|
33010
|
+
if (otherErrors.length > 3) {
|
|
33011
|
+
console.error(` ... and ${otherErrors.length - 3} more`);
|
|
33012
|
+
}
|
|
33013
|
+
console.error("");
|
|
33014
|
+
}
|
|
33015
|
+
console.error(`\uD83D\uDCDD Tip: Fix YAML errors by quoting titles/descriptions with colons`);
|
|
33016
|
+
console.error(` Example: title: "My Post: A Guide" (quotes required for colons)
|
|
33017
|
+
`);
|
|
33018
|
+
if (strictMode) {
|
|
33019
|
+
throw new Error(`Build failed: ${errors.length} parsing error(s) found (strictMode enabled)`);
|
|
33020
|
+
}
|
|
33021
|
+
}
|
|
33022
|
+
const sortedPosts = posts.sort((a, b2) => new Date(b2.date).getTime() - new Date(a.date).getTime());
|
|
33023
|
+
console.log(`Parsed ${sortedPosts.length} posts`);
|
|
33024
|
+
return sortedPosts;
|
|
32906
33025
|
} catch (error) {
|
|
32907
33026
|
console.error(`Error parsing markdown directory:`, error);
|
|
32908
|
-
|
|
33027
|
+
throw error;
|
|
32909
33028
|
}
|
|
32910
33029
|
}
|
|
32911
33030
|
|
|
@@ -33104,7 +33223,7 @@ class SiteGenerator {
|
|
|
33104
33223
|
const pstDate = new Date(date).toLocaleString("en-US", {
|
|
33105
33224
|
timeZone: "America/Los_Angeles"
|
|
33106
33225
|
});
|
|
33107
|
-
const
|
|
33226
|
+
const d2 = new Date(pstDate);
|
|
33108
33227
|
const months = [
|
|
33109
33228
|
"January",
|
|
33110
33229
|
"February",
|
|
@@ -33120,15 +33239,15 @@ class SiteGenerator {
|
|
|
33120
33239
|
"December"
|
|
33121
33240
|
];
|
|
33122
33241
|
if (format === "YYYY") {
|
|
33123
|
-
return
|
|
33242
|
+
return d2.getFullYear();
|
|
33124
33243
|
} else if (format === "MMMM D, YYYY") {
|
|
33125
|
-
return `${months[
|
|
33244
|
+
return `${months[d2.getMonth()]} ${d2.getDate()}, ${d2.getFullYear()}`;
|
|
33126
33245
|
} else if (format === "MMMM D, YYYY h:mm A") {
|
|
33127
|
-
const hours =
|
|
33128
|
-
const ampm =
|
|
33129
|
-
return `${months[
|
|
33246
|
+
const hours = d2.getHours() % 12 || 12;
|
|
33247
|
+
const ampm = d2.getHours() >= 12 ? "PM" : "AM";
|
|
33248
|
+
return `${months[d2.getMonth()]} ${d2.getDate()}, ${d2.getFullYear()} @ ${hours} ${ampm}`;
|
|
33130
33249
|
} else {
|
|
33131
|
-
return
|
|
33250
|
+
return d2.toLocaleDateString("en-US", {
|
|
33132
33251
|
timeZone: "America/Los_Angeles"
|
|
33133
33252
|
});
|
|
33134
33253
|
}
|
|
@@ -33151,8 +33270,8 @@ class SiteGenerator {
|
|
|
33151
33270
|
console.warn("Error loading tag descriptions:", error);
|
|
33152
33271
|
}
|
|
33153
33272
|
}
|
|
33154
|
-
const
|
|
33155
|
-
|
|
33273
|
+
const strictMode = this.options.config.strictMode ?? false;
|
|
33274
|
+
const posts = await parseMarkdownDirectory(this.options.contentDir, strictMode);
|
|
33156
33275
|
const tags = {};
|
|
33157
33276
|
posts.forEach((post) => {
|
|
33158
33277
|
post.tagSlugs = {};
|
|
@@ -34663,6 +34782,32 @@ function registerServeCommand(program2) {
|
|
|
34663
34782
|
});
|
|
34664
34783
|
}
|
|
34665
34784
|
|
|
34785
|
+
// src/cli/commands/validate.ts
|
|
34786
|
+
function registerValidateCommand(program2) {
|
|
34787
|
+
program2.command("validate").description("Validate markdown files for parsing errors").option("-c, --config <path>", "Path to config file", "bunki.config.ts").action(async (options2) => {
|
|
34788
|
+
try {
|
|
34789
|
+
const config = await loadConfig(options2.config);
|
|
34790
|
+
console.log(`\uD83D\uDD0D Validating markdown files...
|
|
34791
|
+
`);
|
|
34792
|
+
const contentDir = "./content";
|
|
34793
|
+
try {
|
|
34794
|
+
await parseMarkdownDirectory(contentDir, true);
|
|
34795
|
+
console.log(`
|
|
34796
|
+
\u2705 All markdown files are valid!`);
|
|
34797
|
+
process.exit(0);
|
|
34798
|
+
} catch (error) {
|
|
34799
|
+
console.error(`
|
|
34800
|
+
\u274C Validation failed
|
|
34801
|
+
`);
|
|
34802
|
+
process.exit(1);
|
|
34803
|
+
}
|
|
34804
|
+
} catch (error) {
|
|
34805
|
+
console.error("Error during validation:", error.message);
|
|
34806
|
+
process.exit(1);
|
|
34807
|
+
}
|
|
34808
|
+
});
|
|
34809
|
+
}
|
|
34810
|
+
|
|
34666
34811
|
// src/cli.ts
|
|
34667
34812
|
var program2 = new Command;
|
|
34668
34813
|
registerInitCommand(program2);
|
|
@@ -34671,7 +34816,8 @@ registerGenerateCommand(program2);
|
|
|
34671
34816
|
registerServeCommand(program2);
|
|
34672
34817
|
registerCssCommand(program2);
|
|
34673
34818
|
registerImagesPushCommand(program2);
|
|
34674
|
-
program2
|
|
34819
|
+
registerValidateCommand(program2);
|
|
34820
|
+
program2.name("bunki").description("An opinionated static site generator built with Bun").version("0.9.1");
|
|
34675
34821
|
var currentFile = import.meta.url.replace("file://", "");
|
|
34676
34822
|
var mainFile = Bun.main;
|
|
34677
34823
|
if (currentFile === mainFile || currentFile.endsWith(mainFile)) {
|