@ijfw/install 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ijfw.js +196 -178
- package/dist/install.js +493 -120
- package/dist/uninstall.js +392 -111
- package/package.json +3 -2
- package/src/install.ps1 +1 -1
- package/templates/pi/AGENTS.md +55 -0
package/dist/ijfw.js
CHANGED
|
@@ -144,13 +144,13 @@ function findShFiles(dir, acc = []) {
|
|
|
144
144
|
for (const e of entries) {
|
|
145
145
|
if (e === "node_modules" || e === ".git") continue;
|
|
146
146
|
const full = join(dir, e);
|
|
147
|
-
let
|
|
147
|
+
let st2;
|
|
148
148
|
try {
|
|
149
|
-
|
|
149
|
+
st2 = statSync(full);
|
|
150
150
|
} catch {
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
|
-
if (
|
|
153
|
+
if (st2.isDirectory()) findShFiles(full, acc);
|
|
154
154
|
else if (e.endsWith(".sh")) acc.push(full);
|
|
155
155
|
}
|
|
156
156
|
return acc;
|
|
@@ -401,13 +401,13 @@ function findPs1Files(dir, acc = []) {
|
|
|
401
401
|
for (const e of entries) {
|
|
402
402
|
if (e === "node_modules" || e === ".git") continue;
|
|
403
403
|
const full = join3(dir, e);
|
|
404
|
-
let
|
|
404
|
+
let st2;
|
|
405
405
|
try {
|
|
406
|
-
|
|
406
|
+
st2 = statSync2(full);
|
|
407
407
|
} catch {
|
|
408
408
|
continue;
|
|
409
409
|
}
|
|
410
|
-
if (
|
|
410
|
+
if (st2.isDirectory()) findPs1Files(full, acc);
|
|
411
411
|
else if (e.endsWith(".ps1")) acc.push(full);
|
|
412
412
|
}
|
|
413
413
|
return acc;
|
|
@@ -484,8 +484,8 @@ function fallbackAnalyzePowerShellText(source, file = "<inline>") {
|
|
|
484
484
|
[/\bStart-Process\b[\s\S]{0,160}\b-Verb\s+RunAs\b/i, "Start-Process -Verb RunAs elevation"],
|
|
485
485
|
[/\bNew-Object\s+Net\.WebClient\b|\bDownloadString\s*\(/i, "legacy WebClient/DownloadString network execution"]
|
|
486
486
|
];
|
|
487
|
-
for (const [
|
|
488
|
-
if (
|
|
487
|
+
for (const [re, label] of banned) {
|
|
488
|
+
if (re.test(stripped)) issues.push(`${file}: banned PowerShell pattern: ${label}`);
|
|
489
489
|
}
|
|
490
490
|
return issues;
|
|
491
491
|
}
|
|
@@ -647,10 +647,11 @@ async function run6(ctx) {
|
|
|
647
647
|
const t0 = Date.now();
|
|
648
648
|
const which = spawnSync6("gitleaks", ["version"], { encoding: "utf8" });
|
|
649
649
|
if (which.status === null || which.error) {
|
|
650
|
+
const inCI = process.env.CI === "true" || process.env.CI === "1";
|
|
650
651
|
return {
|
|
651
652
|
name: "gitleaks",
|
|
652
|
-
status: "WARN",
|
|
653
|
-
message: "gitleaks not installed -- brew install gitleaks / https://github.com/gitleaks/gitleaks",
|
|
653
|
+
status: inCI ? "FAIL" : "WARN",
|
|
654
|
+
message: inCI ? "gitleaks not installed in CI -- secret scan is mandatory; the workflow must install gitleaks" : "gitleaks not installed -- brew install gitleaks / https://github.com/gitleaks/gitleaks",
|
|
654
655
|
details: ["Secret scan skipped. Install gitleaks to enable this gate."],
|
|
655
656
|
durationMs: Date.now() - t0
|
|
656
657
|
};
|
|
@@ -1053,10 +1054,10 @@ function detect(projectRoot, options = {}) {
|
|
|
1053
1054
|
manifests: walk.manifestsFound.slice(0, 6)
|
|
1054
1055
|
});
|
|
1055
1056
|
}
|
|
1056
|
-
for (const
|
|
1057
|
-
for (const
|
|
1058
|
-
for (const
|
|
1059
|
-
for (const
|
|
1057
|
+
for (const d2 of walk.dirHits.book) signals.push({ kind: "dir_book", weight: 0.4, name: d2 });
|
|
1058
|
+
for (const d2 of walk.dirHits.content) signals.push({ kind: "dir_content", weight: 0.4, name: d2 });
|
|
1059
|
+
for (const d2 of walk.dirHits.business) signals.push({ kind: "dir_business", weight: 0.4, name: d2 });
|
|
1060
|
+
for (const d2 of walk.dirHits.design) signals.push({ kind: "dir_design", weight: 0.4, name: d2 });
|
|
1060
1061
|
const totals = walk.extTotals;
|
|
1061
1062
|
const totalClassified = Object.values(totals).reduce((a, b2) => a + b2, 0);
|
|
1062
1063
|
if (totalClassified > 0) {
|
|
@@ -1205,8 +1206,8 @@ function walkProject(root, { maxFiles, maxDepth, options, timeBudgetMs }) {
|
|
|
1205
1206
|
if (Array.isArray(p.fingerprint)) out.fingerprint = p.fingerprint.slice(0, 4096);
|
|
1206
1207
|
if (Array.isArray(p.manifestsFound)) out.manifestsFound = p.manifestsFound.slice();
|
|
1207
1208
|
if (p.dirHits && typeof p.dirHits === "object") {
|
|
1208
|
-
for (const
|
|
1209
|
-
if (Array.isArray(p.dirHits[
|
|
1209
|
+
for (const k of ["book", "content", "business", "design"]) {
|
|
1210
|
+
if (Array.isArray(p.dirHits[k])) out.dirHits[k] = p.dirHits[k].slice();
|
|
1210
1211
|
}
|
|
1211
1212
|
}
|
|
1212
1213
|
if (p.extTotals && typeof p.extTotals === "object") out.extTotals = { ...p.extTotals };
|
|
@@ -1384,7 +1385,7 @@ function scoreSignals(signals) {
|
|
|
1384
1385
|
return board;
|
|
1385
1386
|
}
|
|
1386
1387
|
function rankDomains(board) {
|
|
1387
|
-
const arr = Object.entries(board).filter(([
|
|
1388
|
+
const arr = Object.entries(board).filter(([d2]) => d2 !== "mixed" && d2 !== "unknown").map(([domain, raw]) => ({ domain, raw }));
|
|
1388
1389
|
if (arr.length === 0) return [];
|
|
1389
1390
|
const maxRaw = arr.reduce((m2, e) => Math.max(m2, e.raw), 0);
|
|
1390
1391
|
if (maxRaw <= 0) return [];
|
|
@@ -1410,15 +1411,15 @@ function branchHash(root) {
|
|
|
1410
1411
|
const dotGit = join5(root, ".git");
|
|
1411
1412
|
if (!existsSync3(dotGit)) return "";
|
|
1412
1413
|
let headPath = null;
|
|
1413
|
-
let
|
|
1414
|
+
let st2;
|
|
1414
1415
|
try {
|
|
1415
|
-
|
|
1416
|
+
st2 = statSync3(dotGit);
|
|
1416
1417
|
} catch {
|
|
1417
1418
|
return "";
|
|
1418
1419
|
}
|
|
1419
|
-
if (
|
|
1420
|
+
if (st2.isDirectory()) {
|
|
1420
1421
|
headPath = join5(dotGit, "HEAD");
|
|
1421
|
-
} else if (
|
|
1422
|
+
} else if (st2.isFile()) {
|
|
1422
1423
|
const ptr = readFileSync3(dotGit, "utf8");
|
|
1423
1424
|
const m3 = ptr.match(/^gitdir:\s*(.+?)\s*$/m);
|
|
1424
1425
|
if (!m3) return "";
|
|
@@ -1963,7 +1964,7 @@ async function run10(ctx) {
|
|
|
1963
1964
|
const t0 = Date.now();
|
|
1964
1965
|
const installerDir = join9(ctx.repoRoot, "installer");
|
|
1965
1966
|
const cleanEnv = Object.fromEntries(
|
|
1966
|
-
Object.entries(process.env).filter(([
|
|
1967
|
+
Object.entries(process.env).filter(([k]) => !k.startsWith("npm_"))
|
|
1967
1968
|
);
|
|
1968
1969
|
const build = spawnSync10("npm", ["run", "build"], {
|
|
1969
1970
|
encoding: "utf8",
|
|
@@ -2121,7 +2122,7 @@ async function run11(ctx) {
|
|
|
2121
2122
|
const t0 = Date.now();
|
|
2122
2123
|
const installerDir = join10(ctx.repoRoot, "installer");
|
|
2123
2124
|
const cleanEnv = Object.fromEntries(
|
|
2124
|
-
Object.entries(process.env).filter(([
|
|
2125
|
+
Object.entries(process.env).filter(([k]) => !k.startsWith("npm_"))
|
|
2125
2126
|
);
|
|
2126
2127
|
const build = spawnSync11("npm", ["run", "build"], {
|
|
2127
2128
|
encoding: "utf8",
|
|
@@ -2475,30 +2476,37 @@ var marked_esm_exports = {};
|
|
|
2475
2476
|
__export(marked_esm_exports, {
|
|
2476
2477
|
Hooks: () => P,
|
|
2477
2478
|
Lexer: () => x,
|
|
2478
|
-
Marked: () =>
|
|
2479
|
+
Marked: () => q,
|
|
2479
2480
|
Parser: () => b,
|
|
2480
2481
|
Renderer: () => y,
|
|
2481
2482
|
TextRenderer: () => L,
|
|
2482
2483
|
Tokenizer: () => w,
|
|
2483
2484
|
defaults: () => T,
|
|
2484
|
-
getDefaults: () =>
|
|
2485
|
-
lexer: () =>
|
|
2485
|
+
getDefaults: () => M,
|
|
2486
|
+
lexer: () => Yt,
|
|
2486
2487
|
marked: () => g,
|
|
2487
|
-
options: () =>
|
|
2488
|
-
parse: () =>
|
|
2489
|
-
parseInline: () =>
|
|
2490
|
-
parser: () =>
|
|
2491
|
-
setOptions: () =>
|
|
2492
|
-
use: () =>
|
|
2493
|
-
walkTokens: () =>
|
|
2488
|
+
options: () => Ft,
|
|
2489
|
+
parse: () => Jt,
|
|
2490
|
+
parseInline: () => Xt,
|
|
2491
|
+
parser: () => Vt,
|
|
2492
|
+
setOptions: () => Ut,
|
|
2493
|
+
use: () => Kt,
|
|
2494
|
+
walkTokens: () => Wt
|
|
2494
2495
|
});
|
|
2495
|
-
function
|
|
2496
|
+
function M() {
|
|
2496
2497
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
2497
2498
|
}
|
|
2498
|
-
function
|
|
2499
|
+
function N(l3) {
|
|
2499
2500
|
T = l3;
|
|
2500
2501
|
}
|
|
2501
|
-
function
|
|
2502
|
+
function E(l3) {
|
|
2503
|
+
let e = [];
|
|
2504
|
+
return (t) => {
|
|
2505
|
+
let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
|
|
2506
|
+
return s || (s = l3(n), e[n] = s), s;
|
|
2507
|
+
};
|
|
2508
|
+
}
|
|
2509
|
+
function d(l3, e = "") {
|
|
2502
2510
|
let t = typeof l3 == "string" ? l3 : l3.source, n = { replace: (s, r) => {
|
|
2503
2511
|
let i = typeof r == "string" ? r : r.source;
|
|
2504
2512
|
return i = i.replace(m.caret, "$1"), t = t.replace(s, i), n;
|
|
@@ -2507,11 +2515,11 @@ function k(l3, e = "") {
|
|
|
2507
2515
|
}
|
|
2508
2516
|
function O(l3, e) {
|
|
2509
2517
|
if (e) {
|
|
2510
|
-
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace,
|
|
2511
|
-
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode,
|
|
2518
|
+
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace, ge);
|
|
2519
|
+
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode, ge);
|
|
2512
2520
|
return l3;
|
|
2513
2521
|
}
|
|
2514
|
-
function
|
|
2522
|
+
function V(l3) {
|
|
2515
2523
|
try {
|
|
2516
2524
|
l3 = encodeURI(l3).replace(m.percentDecode, "%");
|
|
2517
2525
|
} catch {
|
|
@@ -2519,7 +2527,7 @@ function J(l3) {
|
|
|
2519
2527
|
}
|
|
2520
2528
|
return l3;
|
|
2521
2529
|
}
|
|
2522
|
-
function
|
|
2530
|
+
function Y(l3, e) {
|
|
2523
2531
|
let t = l3.replace(m.findPipe, (r, i, o) => {
|
|
2524
2532
|
let u = false, a = i;
|
|
2525
2533
|
for (; --a >= 0 && o[a] === "\\"; ) u = !u;
|
|
@@ -2542,14 +2550,14 @@ function $(l3, e, t) {
|
|
|
2542
2550
|
}
|
|
2543
2551
|
return l3.slice(0, n - s);
|
|
2544
2552
|
}
|
|
2545
|
-
function
|
|
2553
|
+
function ee(l3) {
|
|
2546
2554
|
let e = l3.split(`
|
|
2547
2555
|
`), t = e.length - 1;
|
|
2548
2556
|
for (; t >= 0 && m.blankLine.test(e[t]); ) t--;
|
|
2549
2557
|
return e.length - t <= 2 ? l3 : e.slice(0, t + 1).join(`
|
|
2550
2558
|
`);
|
|
2551
2559
|
}
|
|
2552
|
-
function
|
|
2560
|
+
function fe(l3, e) {
|
|
2553
2561
|
if (l3.indexOf(e[1]) === -1) return -1;
|
|
2554
2562
|
let t = 0;
|
|
2555
2563
|
for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
|
|
@@ -2557,7 +2565,7 @@ function ge(l3, e) {
|
|
|
2557
2565
|
else if (l3[n] === e[1] && (t--, t < 0)) return n;
|
|
2558
2566
|
return t > 0 ? -2 : -1;
|
|
2559
2567
|
}
|
|
2560
|
-
function
|
|
2568
|
+
function me(l3, e = 0) {
|
|
2561
2569
|
let t = e, n = "";
|
|
2562
2570
|
for (let s of l3) if (s === " ") {
|
|
2563
2571
|
let r = 4 - t % 4;
|
|
@@ -2565,13 +2573,13 @@ function fe(l3, e = 0) {
|
|
|
2565
2573
|
} else n += s, t++;
|
|
2566
2574
|
return n;
|
|
2567
2575
|
}
|
|
2568
|
-
function
|
|
2576
|
+
function xe(l3, e, t, n, s) {
|
|
2569
2577
|
let r = e.href, i = e.title || null, o = l3[1].replace(s.other.outputLinkReplace, "$1");
|
|
2570
2578
|
n.state.inLink = true;
|
|
2571
2579
|
let u = { type: l3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: r, title: i, text: o, tokens: n.inlineTokens(o) };
|
|
2572
2580
|
return n.state.inLink = false, u;
|
|
2573
2581
|
}
|
|
2574
|
-
function
|
|
2582
|
+
function st(l3, e, t) {
|
|
2575
2583
|
let n = l3.match(t.other.indentCodeCompensation);
|
|
2576
2584
|
if (n === null) return e;
|
|
2577
2585
|
let s = n[1];
|
|
@@ -2585,85 +2593,85 @@ function rt(l3, e, t) {
|
|
|
2585
2593
|
`);
|
|
2586
2594
|
}
|
|
2587
2595
|
function g(l3, e) {
|
|
2588
|
-
return
|
|
2596
|
+
return z.parse(l3, e);
|
|
2589
2597
|
}
|
|
2590
|
-
var T, _,
|
|
2598
|
+
var T, _, Te, m, Oe, we, ye, B, Pe, j, oe, ae, Se, F, $e, U, Le, _e, H, K, ze, le, Me, W, se, Ee, Ie, Ae, Ce, ue, Be, I, Z, X, De, pe, qe, ve, He, ce, Ze, Ge, he, Ne, Qe, je, Fe, Ue, Ke, We, Xe, Je, Ve, v, Ye, ke, de, et, ie, J, tt, Q, nt, D, A, rt, ge, w, x, y, L, b, P, q, z, Ft, Ut, Kt, Wt, Xt, Jt, Vt, Yt;
|
|
2591
2599
|
var init_marked_esm = __esm({
|
|
2592
2600
|
"node_modules/marked/lib/marked.esm.js"() {
|
|
2593
|
-
T =
|
|
2601
|
+
T = M();
|
|
2594
2602
|
_ = { exec: () => null };
|
|
2595
|
-
|
|
2603
|
+
Te = ((l3 = "") => {
|
|
2596
2604
|
try {
|
|
2597
2605
|
return !!new RegExp("(?<=1)(?<!1)" + l3);
|
|
2598
2606
|
} catch {
|
|
2599
2607
|
return false;
|
|
2600
2608
|
}
|
|
2601
2609
|
})();
|
|
2602
|
-
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, 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, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (l3) => new RegExp(`^ {0,${
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
Me =
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
]`).replace("lheading",
|
|
2610
|
+
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, 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, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: E((l3) => new RegExp(`^ {0,${l3}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: E((l3) => new RegExp(`^ {0,${l3}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}(?:\`\`\`|~~~)`)), headingBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}#`)), htmlBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}>`)) };
|
|
2611
|
+
Oe = /^(?:[ \t]*(?:\n|$))+/;
|
|
2612
|
+
we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
2613
|
+
ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
2614
|
+
B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
2615
|
+
Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
2616
|
+
j = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
|
|
2617
|
+
oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
2618
|
+
ae = d(oe).replace(/bull/g, j).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();
|
|
2619
|
+
Se = d(oe).replace(/bull/g, j).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();
|
|
2620
|
+
F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
2621
|
+
$e = /^[^\n]+/;
|
|
2622
|
+
U = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
2623
|
+
Le = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
2624
|
+
_e = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, j).getRegex();
|
|
2625
|
+
H = "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";
|
|
2626
|
+
K = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
2627
|
+
ze = d("^ {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[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", K).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
2628
|
+
le = d(F).replace("hr", B).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[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
|
|
2629
|
+
Me = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", le).getRegex();
|
|
2630
|
+
W = { blockquote: Me, code: we, def: Le, fences: ye, heading: Pe, hr: B, html: ze, lheading: ae, list: _e, newline: Oe, paragraph: le, table: _, text: $e };
|
|
2631
|
+
se = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
|
|
2632
|
+
Ee = { ...W, lheading: Se, table: se, paragraph: d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex() };
|
|
2633
|
+
Ie = { ...W, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", K).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: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(F).replace("hr", B).replace("heading", ` *#{1,6} *[^
|
|
2634
|
+
]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
2627
2635
|
Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
2628
2636
|
Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
A = { normal:
|
|
2665
|
-
|
|
2666
|
-
|
|
2637
|
+
ue = /^( {2,}|\\)\n(?!\s*$)/;
|
|
2638
|
+
Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
2639
|
+
I = /[\p{P}\p{S}]/u;
|
|
2640
|
+
Z = /[\s\p{P}\p{S}]/u;
|
|
2641
|
+
X = /[^\s\p{P}\p{S}]/u;
|
|
2642
|
+
De = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z).getRegex();
|
|
2643
|
+
pe = /(?!~)[\p{P}\p{S}]/u;
|
|
2644
|
+
qe = /(?!~)[\s\p{P}\p{S}]/u;
|
|
2645
|
+
ve = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
2646
|
+
He = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
2647
|
+
ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
|
|
2648
|
+
Ze = d(ce, "u").replace(/punct/g, I).getRegex();
|
|
2649
|
+
Ge = d(ce, "u").replace(/punct/g, pe).getRegex();
|
|
2650
|
+
he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
2651
|
+
Ne = d(he, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex();
|
|
2652
|
+
Qe = d(he, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, pe).getRegex();
|
|
2653
|
+
je = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex();
|
|
2654
|
+
Fe = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, I).getRegex();
|
|
2655
|
+
Ue = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
|
|
2656
|
+
Ke = d(Ue, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex();
|
|
2657
|
+
We = d(/\\(punct)/, "gu").replace(/punct/g, I).getRegex();
|
|
2658
|
+
Xe = d(/^<(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();
|
|
2659
|
+
Je = d(K).replace("(?:-->|$)", "-->").getRegex();
|
|
2660
|
+
Ve = d("^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", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
2661
|
+
v = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
|
|
2662
|
+
Ye = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", v).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
2663
|
+
ke = d(/^!?\[(label)\]\[(ref)\]/).replace("label", v).replace("ref", U).getRegex();
|
|
2664
|
+
de = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex();
|
|
2665
|
+
et = d("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex();
|
|
2666
|
+
ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
2667
|
+
J = { _backpedal: _, anyPunctuation: We, autolink: Xe, blockSkip: He, br: ue, code: Ce, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: Ze, emStrongRDelimAst: Ne, emStrongRDelimUnd: je, escape: Ae, link: Ye, nolink: de, punctuation: De, reflink: ke, reflinkSearch: et, tag: Ve, text: Be, url: _ };
|
|
2668
|
+
tt = { ...J, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", v).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", v).getRegex() };
|
|
2669
|
+
Q = { ...J, emStrongRDelimAst: Qe, emStrongLDelim: Ge, delLDelim: Fe, delRDelim: Ke, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).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: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() };
|
|
2670
|
+
nt = { ...Q, br: d(ue).replace("{2,}", "*").getRegex(), text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
2671
|
+
D = { normal: W, gfm: Ee, pedantic: Ie };
|
|
2672
|
+
A = { normal: J, gfm: Q, breaks: nt, pedantic: tt };
|
|
2673
|
+
rt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
2674
|
+
ge = (l3) => rt[l3];
|
|
2667
2675
|
w = class {
|
|
2668
2676
|
options;
|
|
2669
2677
|
rules;
|
|
@@ -2678,14 +2686,14 @@ var init_marked_esm = __esm({
|
|
|
2678
2686
|
code(e) {
|
|
2679
2687
|
let t = this.rules.block.code.exec(e);
|
|
2680
2688
|
if (t) {
|
|
2681
|
-
let n = this.options.pedantic ? t[0] :
|
|
2689
|
+
let n = this.options.pedantic ? t[0] : ee(t[0]), s = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
2682
2690
|
return { type: "code", raw: n, codeBlockStyle: "indented", text: s };
|
|
2683
2691
|
}
|
|
2684
2692
|
}
|
|
2685
2693
|
fences(e) {
|
|
2686
2694
|
let t = this.rules.block.fences.exec(e);
|
|
2687
2695
|
if (t) {
|
|
2688
|
-
let n = t[0], s =
|
|
2696
|
+
let n = t[0], s = st(n, t[3] || "", this.rules);
|
|
2689
2697
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: s };
|
|
2690
2698
|
}
|
|
2691
2699
|
}
|
|
@@ -2724,8 +2732,8 @@ var init_marked_esm = __esm({
|
|
|
2724
2732
|
s = s ? `${s}
|
|
2725
2733
|
${c2}` : c2, r = r ? `${r}
|
|
2726
2734
|
${p}` : p;
|
|
2727
|
-
let
|
|
2728
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(p, i, true), this.lexer.state.top =
|
|
2735
|
+
let k = this.lexer.state.top;
|
|
2736
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, i, true), this.lexer.state.top = k, n.length === 0) break;
|
|
2729
2737
|
let h = i.at(-1);
|
|
2730
2738
|
if (h?.type === "code") break;
|
|
2731
2739
|
if (h?.type === "blockquote") {
|
|
@@ -2756,25 +2764,25 @@ ${p}` : p;
|
|
|
2756
2764
|
let a = false, c2 = "", p = "";
|
|
2757
2765
|
if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
2758
2766
|
c2 = t[0], e = e.substring(c2.length);
|
|
2759
|
-
let
|
|
2767
|
+
let k = me(t[2].split(`
|
|
2760
2768
|
`, 1)[0], t[1].length), h = e.split(`
|
|
2761
|
-
`, 1)[0], R = !
|
|
2762
|
-
if (this.options.pedantic ? (f = 2, p =
|
|
2769
|
+
`, 1)[0], R = !k.trim(), f = 0;
|
|
2770
|
+
if (this.options.pedantic ? (f = 2, p = k.trimStart()) : R ? f = t[1].length + 1 : (f = k.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = k.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(h) && (c2 += h + `
|
|
2763
2771
|
`, e = e.substring(h.length + 1), a = true), !a) {
|
|
2764
|
-
let S = this.rules.other.nextBulletRegex(f),
|
|
2772
|
+
let S = this.rules.other.nextBulletRegex(f), te = this.rules.other.hrRegex(f), ne = this.rules.other.fencesBeginRegex(f), re = this.rules.other.headingBeginRegex(f), be = this.rules.other.htmlBeginRegex(f), Re = this.rules.other.blockquoteBeginRegex(f);
|
|
2765
2773
|
for (; e; ) {
|
|
2766
|
-
let
|
|
2774
|
+
let G = e.split(`
|
|
2767
2775
|
`, 1)[0], C;
|
|
2768
|
-
if (h =
|
|
2776
|
+
if (h = G, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), C = h) : C = h.replace(this.rules.other.tabCharGlobal, " "), ne.test(h) || re.test(h) || be.test(h) || Re.test(h) || S.test(h) || te.test(h)) break;
|
|
2769
2777
|
if (C.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) p += `
|
|
2770
2778
|
` + C.slice(f);
|
|
2771
2779
|
else {
|
|
2772
|
-
if (R ||
|
|
2780
|
+
if (R || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(k) || re.test(k) || te.test(k)) break;
|
|
2773
2781
|
p += `
|
|
2774
2782
|
` + h;
|
|
2775
2783
|
}
|
|
2776
|
-
R = !h.trim(), c2 +=
|
|
2777
|
-
`, e = e.substring(
|
|
2784
|
+
R = !h.trim(), c2 += G + `
|
|
2785
|
+
`, e = e.substring(G.length + 1), k = C.slice(f);
|
|
2778
2786
|
}
|
|
2779
2787
|
}
|
|
2780
2788
|
r.loose || (o ? r.loose = true : this.rules.other.doubleBlankLine.test(c2) && (o = true)), r.items.push({ type: "list_item", raw: c2, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: false, text: p, tokens: [] }), r.raw += c2;
|
|
@@ -2784,23 +2792,23 @@ ${p}` : p;
|
|
|
2784
2792
|
else return;
|
|
2785
2793
|
r.raw = r.raw.trimEnd();
|
|
2786
2794
|
for (let a of r.items) {
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2795
|
+
this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []);
|
|
2796
|
+
let c2 = a.tokens[0];
|
|
2797
|
+
if (a.task && (c2?.type === "text" || c2?.type === "paragraph")) {
|
|
2798
|
+
a.text = a.text.replace(this.rules.other.listReplaceTask, ""), c2.raw = c2.raw.replace(this.rules.other.listReplaceTask, ""), c2.text = c2.text.replace(this.rules.other.listReplaceTask, "");
|
|
2799
|
+
for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
|
|
2800
|
+
this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
|
|
2801
|
+
break;
|
|
2794
2802
|
}
|
|
2795
|
-
let
|
|
2796
|
-
if (
|
|
2797
|
-
let
|
|
2798
|
-
a.checked =
|
|
2803
|
+
let p = this.rules.other.listTaskCheckbox.exec(a.raw);
|
|
2804
|
+
if (p) {
|
|
2805
|
+
let k = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
2806
|
+
a.checked = k.checked, r.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = k.raw + a.tokens[0].raw, a.tokens[0].text = k.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(k)) : a.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : a.tokens.unshift(k);
|
|
2799
2807
|
}
|
|
2800
|
-
}
|
|
2808
|
+
} else a.task && (a.task = false);
|
|
2801
2809
|
if (!r.loose) {
|
|
2802
|
-
let
|
|
2803
|
-
r.loose =
|
|
2810
|
+
let p = a.tokens.filter((h) => h.type === "space"), k = p.length > 0 && p.some((h) => this.rules.other.anyLine.test(h.raw));
|
|
2811
|
+
r.loose = k;
|
|
2804
2812
|
}
|
|
2805
2813
|
}
|
|
2806
2814
|
if (r.loose) for (let a of r.items) {
|
|
@@ -2813,7 +2821,7 @@ ${p}` : p;
|
|
|
2813
2821
|
html(e) {
|
|
2814
2822
|
let t = this.rules.block.html.exec(e);
|
|
2815
2823
|
if (t) {
|
|
2816
|
-
let n =
|
|
2824
|
+
let n = ee(t[0]);
|
|
2817
2825
|
return { type: "html", block: true, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n };
|
|
2818
2826
|
}
|
|
2819
2827
|
}
|
|
@@ -2828,13 +2836,13 @@ ${p}` : p;
|
|
|
2828
2836
|
table(e) {
|
|
2829
2837
|
let t = this.rules.block.table.exec(e);
|
|
2830
2838
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
2831
|
-
let n =
|
|
2839
|
+
let n = Y(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
2832
2840
|
`) : [], i = { type: "table", raw: $(t[0], `
|
|
2833
2841
|
`), header: [], align: [], rows: [] };
|
|
2834
2842
|
if (n.length === s.length) {
|
|
2835
2843
|
for (let o of s) this.rules.other.tableAlignRight.test(o) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? i.align.push("left") : i.align.push(null);
|
|
2836
2844
|
for (let o = 0; o < n.length; o++) i.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: true, align: i.align[o] });
|
|
2837
|
-
for (let o of r) i.rows.push(
|
|
2845
|
+
for (let o of r) i.rows.push(Y(o, i.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: false, align: i.align[a] })));
|
|
2838
2846
|
return i;
|
|
2839
2847
|
}
|
|
2840
2848
|
}
|
|
@@ -2875,7 +2883,7 @@ ${p}` : p;
|
|
|
2875
2883
|
let i = $(n.slice(0, -1), "\\");
|
|
2876
2884
|
if ((n.length - i.length) % 2 === 0) return;
|
|
2877
2885
|
} else {
|
|
2878
|
-
let i =
|
|
2886
|
+
let i = fe(t[2], "()");
|
|
2879
2887
|
if (i === -2) return;
|
|
2880
2888
|
if (i > -1) {
|
|
2881
2889
|
let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
|
|
@@ -2887,7 +2895,7 @@ ${p}` : p;
|
|
|
2887
2895
|
let i = this.rules.other.pedanticHrefTitle.exec(s);
|
|
2888
2896
|
i && (s = i[1], r = i[3]);
|
|
2889
2897
|
} else r = t[3] ? t[3].slice(1, -1) : "";
|
|
2890
|
-
return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)),
|
|
2898
|
+
return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), xe(t, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: r && r.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
2891
2899
|
}
|
|
2892
2900
|
}
|
|
2893
2901
|
reflink(e, t) {
|
|
@@ -2898,7 +2906,7 @@ ${p}` : p;
|
|
|
2898
2906
|
let i = n[0].charAt(0);
|
|
2899
2907
|
return { type: "text", raw: i, text: i };
|
|
2900
2908
|
}
|
|
2901
|
-
return
|
|
2909
|
+
return xe(n, r, n[0], this.lexer, this.rules);
|
|
2902
2910
|
}
|
|
2903
2911
|
}
|
|
2904
2912
|
emStrong(e, t, n = "") {
|
|
@@ -2917,7 +2925,7 @@ ${p}` : p;
|
|
|
2917
2925
|
}
|
|
2918
2926
|
if (a -= u, a > 0) continue;
|
|
2919
2927
|
u = Math.min(u, u + a + c2);
|
|
2920
|
-
let
|
|
2928
|
+
let k = [...s[0]][0].length, h = e.slice(0, i + s.index + k + u);
|
|
2921
2929
|
if (Math.min(i, u) % 2) {
|
|
2922
2930
|
let f = h.slice(1, -1);
|
|
2923
2931
|
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
@@ -2951,8 +2959,8 @@ ${p}` : p;
|
|
|
2951
2959
|
}
|
|
2952
2960
|
if (a -= u, a > 0) continue;
|
|
2953
2961
|
u = Math.min(u, u + a);
|
|
2954
|
-
let p = [...s[0]][0].length,
|
|
2955
|
-
return { type: "del", raw:
|
|
2962
|
+
let p = [...s[0]][0].length, k = e.slice(0, i + s.index + p + u), h = k.slice(i, -i);
|
|
2963
|
+
return { type: "del", raw: k, text: h, tokens: this.lexer.inlineTokens(h) };
|
|
2956
2964
|
}
|
|
2957
2965
|
}
|
|
2958
2966
|
}
|
|
@@ -2994,11 +3002,11 @@ ${p}` : p;
|
|
|
2994
3002
|
tokenizer;
|
|
2995
3003
|
constructor(e) {
|
|
2996
3004
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
2997
|
-
let t = { other: m, block:
|
|
2998
|
-
this.options.pedantic ? (t.block =
|
|
3005
|
+
let t = { other: m, block: D.normal, inline: A.normal };
|
|
3006
|
+
this.options.pedantic ? (t.block = D.pedantic, t.inline = A.pedantic) : this.options.gfm && (t.block = D.gfm, this.options.breaks ? t.inline = A.breaks : t.inline = A.gfm), this.tokenizer.rules = t;
|
|
2999
3007
|
}
|
|
3000
3008
|
static get rules() {
|
|
3001
|
-
return { block:
|
|
3009
|
+
return { block: D, inline: A };
|
|
3002
3010
|
}
|
|
3003
3011
|
static lex(e, t) {
|
|
3004
3012
|
return new l(t).lex(e);
|
|
@@ -3182,9 +3190,9 @@ ${p}` : p;
|
|
|
3182
3190
|
}
|
|
3183
3191
|
let c2 = e;
|
|
3184
3192
|
if (this.options.extensions?.startInline) {
|
|
3185
|
-
let p = 1 / 0,
|
|
3193
|
+
let p = 1 / 0, k = e.slice(1), h;
|
|
3186
3194
|
this.options.extensions.startInline.forEach((R) => {
|
|
3187
|
-
h = R.call({ lexer: this },
|
|
3195
|
+
h = R.call({ lexer: this }, k), typeof h == "number" && h >= 0 && (p = Math.min(p, h));
|
|
3188
3196
|
}), p < 1 / 0 && p >= 0 && (c2 = e.substring(0, p + 1));
|
|
3189
3197
|
}
|
|
3190
3198
|
if (a = this.tokenizer.inlineText(c2)) {
|
|
@@ -3306,7 +3314,7 @@ ${e}</tr>
|
|
|
3306
3314
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
3307
3315
|
}
|
|
3308
3316
|
link({ href: e, title: t, tokens: n }) {
|
|
3309
|
-
let s = this.parser.parseInline(n), r =
|
|
3317
|
+
let s = this.parser.parseInline(n), r = V(e);
|
|
3310
3318
|
if (r === null) return s;
|
|
3311
3319
|
e = r;
|
|
3312
3320
|
let i = '<a href="' + e + '"';
|
|
@@ -3314,7 +3322,7 @@ ${e}</tr>
|
|
|
3314
3322
|
}
|
|
3315
3323
|
image({ href: e, title: t, text: n, tokens: s }) {
|
|
3316
3324
|
s && (n = this.parser.parseInline(s, this.parser.textRenderer));
|
|
3317
|
-
let r =
|
|
3325
|
+
let r = V(e);
|
|
3318
3326
|
if (r === null) return O(n);
|
|
3319
3327
|
e = r;
|
|
3320
3328
|
let i = `<img src="${e}" alt="${O(n)}"`;
|
|
@@ -3535,8 +3543,8 @@ ${e}</tr>
|
|
|
3535
3543
|
return e ? b.parse : b.parseInline;
|
|
3536
3544
|
}
|
|
3537
3545
|
};
|
|
3538
|
-
|
|
3539
|
-
defaults =
|
|
3546
|
+
q = class {
|
|
3547
|
+
defaults = M();
|
|
3540
3548
|
options = this.setOptions;
|
|
3541
3549
|
parse = this.parseMarkdown(true);
|
|
3542
3550
|
parseInline = this.parseMarkdown(false);
|
|
@@ -3626,15 +3634,15 @@ ${e}</tr>
|
|
|
3626
3634
|
let o = i, u = n.hooks[o], a = r[o];
|
|
3627
3635
|
P.passThroughHooks.has(i) ? r[o] = (c2) => {
|
|
3628
3636
|
if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
|
|
3629
|
-
let
|
|
3630
|
-
return a.call(r,
|
|
3637
|
+
let k = await u.call(r, c2);
|
|
3638
|
+
return a.call(r, k);
|
|
3631
3639
|
})();
|
|
3632
3640
|
let p = u.call(r, c2);
|
|
3633
3641
|
return a.call(r, p);
|
|
3634
3642
|
} : r[o] = (...c2) => {
|
|
3635
3643
|
if (this.defaults.async) return (async () => {
|
|
3636
|
-
let
|
|
3637
|
-
return
|
|
3644
|
+
let k = await u.apply(r, c2);
|
|
3645
|
+
return k === false && (k = await a.apply(r, c2)), k;
|
|
3638
3646
|
})();
|
|
3639
3647
|
let p = u.apply(r, c2);
|
|
3640
3648
|
return p === false && (p = a.apply(r, c2)), p;
|
|
@@ -3696,19 +3704,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
3696
3704
|
};
|
|
3697
3705
|
}
|
|
3698
3706
|
};
|
|
3699
|
-
|
|
3707
|
+
z = new q();
|
|
3700
3708
|
g.options = g.setOptions = function(l3) {
|
|
3701
|
-
return
|
|
3709
|
+
return z.setOptions(l3), g.defaults = z.defaults, N(g.defaults), g;
|
|
3702
3710
|
};
|
|
3703
|
-
g.getDefaults =
|
|
3711
|
+
g.getDefaults = M;
|
|
3704
3712
|
g.defaults = T;
|
|
3705
3713
|
g.use = function(...l3) {
|
|
3706
|
-
return
|
|
3714
|
+
return z.use(...l3), g.defaults = z.defaults, N(g.defaults), g;
|
|
3707
3715
|
};
|
|
3708
3716
|
g.walkTokens = function(l3, e) {
|
|
3709
|
-
return
|
|
3717
|
+
return z.walkTokens(l3, e);
|
|
3710
3718
|
};
|
|
3711
|
-
g.parseInline =
|
|
3719
|
+
g.parseInline = z.parseInline;
|
|
3712
3720
|
g.Parser = b;
|
|
3713
3721
|
g.parser = b.parse;
|
|
3714
3722
|
g.Renderer = y;
|
|
@@ -3718,14 +3726,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
3718
3726
|
g.Tokenizer = w;
|
|
3719
3727
|
g.Hooks = P;
|
|
3720
3728
|
g.parse = g;
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
+
Ft = g.options;
|
|
3730
|
+
Ut = g.setOptions;
|
|
3731
|
+
Kt = g.use;
|
|
3732
|
+
Wt = g.walkTokens;
|
|
3733
|
+
Xt = g.parseInline;
|
|
3734
|
+
Jt = g;
|
|
3735
|
+
Vt = b.parse;
|
|
3736
|
+
Yt = x.lex;
|
|
3729
3737
|
}
|
|
3730
3738
|
});
|
|
3731
3739
|
|
|
@@ -3769,6 +3777,16 @@ var COMMAND_REGISTRY = Object.freeze([
|
|
|
3769
3777
|
status: "active",
|
|
3770
3778
|
helpGroup: "GET STARTED"
|
|
3771
3779
|
},
|
|
3780
|
+
{
|
|
3781
|
+
name: "init",
|
|
3782
|
+
tier: "primary",
|
|
3783
|
+
owner: "orchestrator",
|
|
3784
|
+
description: "Approve the current folder for codebase indexing",
|
|
3785
|
+
aliases: [],
|
|
3786
|
+
since: "1.6.1",
|
|
3787
|
+
status: "active",
|
|
3788
|
+
helpGroup: "GET STARTED"
|
|
3789
|
+
},
|
|
3772
3790
|
{
|
|
3773
3791
|
name: "update",
|
|
3774
3792
|
tier: "primary",
|
|
@@ -4261,9 +4279,9 @@ function launcherSuggest(raw) {
|
|
|
4261
4279
|
const candidates = [...ALL_COMMAND_NAMES, ...ORCHESTRATOR_COMMAND_NAMES, ...INSTALLER_DIRECT_COMMAND_NAMES].filter((c2) => c2 && !c2.startsWith("--"));
|
|
4262
4280
|
let best = null, bestD = Infinity;
|
|
4263
4281
|
for (const c2 of candidates) {
|
|
4264
|
-
const
|
|
4265
|
-
if (
|
|
4266
|
-
bestD =
|
|
4282
|
+
const d2 = launcherEditDistance(q2, c2.toLowerCase());
|
|
4283
|
+
if (d2 < bestD) {
|
|
4284
|
+
bestD = d2;
|
|
4267
4285
|
best = c2;
|
|
4268
4286
|
}
|
|
4269
4287
|
}
|