@ijfw/install 1.6.1 → 1.6.3
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 +194 -181
- package/dist/install.js +331 -102
- package/dist/uninstall.js +112 -40
- package/package.json +3 -3
- package/src/install.ps1 +1 -1
package/dist/ijfw.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __esm = (fn, res) => function __init() {
|
|
5
|
-
|
|
4
|
+
var __esm = (fn, res, err) => function __init() {
|
|
5
|
+
if (err) throw err[0];
|
|
6
|
+
try {
|
|
7
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
+
} catch (e) {
|
|
9
|
+
throw err = [e], e;
|
|
10
|
+
}
|
|
6
11
|
};
|
|
7
12
|
var __export = (target, all) => {
|
|
8
13
|
for (var name12 in all)
|
|
@@ -144,13 +149,13 @@ function findShFiles(dir, acc = []) {
|
|
|
144
149
|
for (const e of entries) {
|
|
145
150
|
if (e === "node_modules" || e === ".git") continue;
|
|
146
151
|
const full = join(dir, e);
|
|
147
|
-
let
|
|
152
|
+
let st2;
|
|
148
153
|
try {
|
|
149
|
-
|
|
154
|
+
st2 = statSync(full);
|
|
150
155
|
} catch {
|
|
151
156
|
continue;
|
|
152
157
|
}
|
|
153
|
-
if (
|
|
158
|
+
if (st2.isDirectory()) findShFiles(full, acc);
|
|
154
159
|
else if (e.endsWith(".sh")) acc.push(full);
|
|
155
160
|
}
|
|
156
161
|
return acc;
|
|
@@ -401,13 +406,13 @@ function findPs1Files(dir, acc = []) {
|
|
|
401
406
|
for (const e of entries) {
|
|
402
407
|
if (e === "node_modules" || e === ".git") continue;
|
|
403
408
|
const full = join3(dir, e);
|
|
404
|
-
let
|
|
409
|
+
let st2;
|
|
405
410
|
try {
|
|
406
|
-
|
|
411
|
+
st2 = statSync2(full);
|
|
407
412
|
} catch {
|
|
408
413
|
continue;
|
|
409
414
|
}
|
|
410
|
-
if (
|
|
415
|
+
if (st2.isDirectory()) findPs1Files(full, acc);
|
|
411
416
|
else if (e.endsWith(".ps1")) acc.push(full);
|
|
412
417
|
}
|
|
413
418
|
return acc;
|
|
@@ -484,8 +489,8 @@ function fallbackAnalyzePowerShellText(source, file = "<inline>") {
|
|
|
484
489
|
[/\bStart-Process\b[\s\S]{0,160}\b-Verb\s+RunAs\b/i, "Start-Process -Verb RunAs elevation"],
|
|
485
490
|
[/\bNew-Object\s+Net\.WebClient\b|\bDownloadString\s*\(/i, "legacy WebClient/DownloadString network execution"]
|
|
486
491
|
];
|
|
487
|
-
for (const [
|
|
488
|
-
if (
|
|
492
|
+
for (const [re, label] of banned) {
|
|
493
|
+
if (re.test(stripped)) issues.push(`${file}: banned PowerShell pattern: ${label}`);
|
|
489
494
|
}
|
|
490
495
|
return issues;
|
|
491
496
|
}
|
|
@@ -647,10 +652,11 @@ async function run6(ctx) {
|
|
|
647
652
|
const t0 = Date.now();
|
|
648
653
|
const which = spawnSync6("gitleaks", ["version"], { encoding: "utf8" });
|
|
649
654
|
if (which.status === null || which.error) {
|
|
655
|
+
const inCI = process.env.CI === "true" || process.env.CI === "1";
|
|
650
656
|
return {
|
|
651
657
|
name: "gitleaks",
|
|
652
|
-
status: "WARN",
|
|
653
|
-
message: "gitleaks not installed -- brew install gitleaks / https://github.com/gitleaks/gitleaks",
|
|
658
|
+
status: inCI ? "FAIL" : "WARN",
|
|
659
|
+
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
660
|
details: ["Secret scan skipped. Install gitleaks to enable this gate."],
|
|
655
661
|
durationMs: Date.now() - t0
|
|
656
662
|
};
|
|
@@ -658,7 +664,7 @@ async function run6(ctx) {
|
|
|
658
664
|
const res = spawnSync6(
|
|
659
665
|
"gitleaks",
|
|
660
666
|
["detect", "--no-git", "--source", ctx.repoRoot, "--gitleaks-ignore-path", ".gitleaksignore", "-v", "--exit-code", "1"],
|
|
661
|
-
{ encoding: "utf8", cwd: ctx.repoRoot, timeout:
|
|
667
|
+
{ encoding: "utf8", cwd: ctx.repoRoot, timeout: 12e4 }
|
|
662
668
|
);
|
|
663
669
|
const durationMs = Date.now() - t0;
|
|
664
670
|
if (res.status === 0) {
|
|
@@ -1053,10 +1059,10 @@ function detect(projectRoot, options = {}) {
|
|
|
1053
1059
|
manifests: walk.manifestsFound.slice(0, 6)
|
|
1054
1060
|
});
|
|
1055
1061
|
}
|
|
1056
|
-
for (const
|
|
1057
|
-
for (const
|
|
1058
|
-
for (const
|
|
1059
|
-
for (const
|
|
1062
|
+
for (const d2 of walk.dirHits.book) signals.push({ kind: "dir_book", weight: 0.4, name: d2 });
|
|
1063
|
+
for (const d2 of walk.dirHits.content) signals.push({ kind: "dir_content", weight: 0.4, name: d2 });
|
|
1064
|
+
for (const d2 of walk.dirHits.business) signals.push({ kind: "dir_business", weight: 0.4, name: d2 });
|
|
1065
|
+
for (const d2 of walk.dirHits.design) signals.push({ kind: "dir_design", weight: 0.4, name: d2 });
|
|
1060
1066
|
const totals = walk.extTotals;
|
|
1061
1067
|
const totalClassified = Object.values(totals).reduce((a, b2) => a + b2, 0);
|
|
1062
1068
|
if (totalClassified > 0) {
|
|
@@ -1205,8 +1211,8 @@ function walkProject(root, { maxFiles, maxDepth, options, timeBudgetMs }) {
|
|
|
1205
1211
|
if (Array.isArray(p.fingerprint)) out.fingerprint = p.fingerprint.slice(0, 4096);
|
|
1206
1212
|
if (Array.isArray(p.manifestsFound)) out.manifestsFound = p.manifestsFound.slice();
|
|
1207
1213
|
if (p.dirHits && typeof p.dirHits === "object") {
|
|
1208
|
-
for (const
|
|
1209
|
-
if (Array.isArray(p.dirHits[
|
|
1214
|
+
for (const k of ["book", "content", "business", "design"]) {
|
|
1215
|
+
if (Array.isArray(p.dirHits[k])) out.dirHits[k] = p.dirHits[k].slice();
|
|
1210
1216
|
}
|
|
1211
1217
|
}
|
|
1212
1218
|
if (p.extTotals && typeof p.extTotals === "object") out.extTotals = { ...p.extTotals };
|
|
@@ -1384,7 +1390,7 @@ function scoreSignals(signals) {
|
|
|
1384
1390
|
return board;
|
|
1385
1391
|
}
|
|
1386
1392
|
function rankDomains(board) {
|
|
1387
|
-
const arr = Object.entries(board).filter(([
|
|
1393
|
+
const arr = Object.entries(board).filter(([d2]) => d2 !== "mixed" && d2 !== "unknown").map(([domain, raw]) => ({ domain, raw }));
|
|
1388
1394
|
if (arr.length === 0) return [];
|
|
1389
1395
|
const maxRaw = arr.reduce((m2, e) => Math.max(m2, e.raw), 0);
|
|
1390
1396
|
if (maxRaw <= 0) return [];
|
|
@@ -1410,15 +1416,15 @@ function branchHash(root) {
|
|
|
1410
1416
|
const dotGit = join5(root, ".git");
|
|
1411
1417
|
if (!existsSync3(dotGit)) return "";
|
|
1412
1418
|
let headPath = null;
|
|
1413
|
-
let
|
|
1419
|
+
let st2;
|
|
1414
1420
|
try {
|
|
1415
|
-
|
|
1421
|
+
st2 = statSync3(dotGit);
|
|
1416
1422
|
} catch {
|
|
1417
1423
|
return "";
|
|
1418
1424
|
}
|
|
1419
|
-
if (
|
|
1425
|
+
if (st2.isDirectory()) {
|
|
1420
1426
|
headPath = join5(dotGit, "HEAD");
|
|
1421
|
-
} else if (
|
|
1427
|
+
} else if (st2.isFile()) {
|
|
1422
1428
|
const ptr = readFileSync3(dotGit, "utf8");
|
|
1423
1429
|
const m3 = ptr.match(/^gitdir:\s*(.+?)\s*$/m);
|
|
1424
1430
|
if (!m3) return "";
|
|
@@ -1963,7 +1969,7 @@ async function run10(ctx) {
|
|
|
1963
1969
|
const t0 = Date.now();
|
|
1964
1970
|
const installerDir = join9(ctx.repoRoot, "installer");
|
|
1965
1971
|
const cleanEnv = Object.fromEntries(
|
|
1966
|
-
Object.entries(process.env).filter(([
|
|
1972
|
+
Object.entries(process.env).filter(([k]) => !k.startsWith("npm_"))
|
|
1967
1973
|
);
|
|
1968
1974
|
const build = spawnSync10("npm", ["run", "build"], {
|
|
1969
1975
|
encoding: "utf8",
|
|
@@ -2121,7 +2127,7 @@ async function run11(ctx) {
|
|
|
2121
2127
|
const t0 = Date.now();
|
|
2122
2128
|
const installerDir = join10(ctx.repoRoot, "installer");
|
|
2123
2129
|
const cleanEnv = Object.fromEntries(
|
|
2124
|
-
Object.entries(process.env).filter(([
|
|
2130
|
+
Object.entries(process.env).filter(([k]) => !k.startsWith("npm_"))
|
|
2125
2131
|
);
|
|
2126
2132
|
const build = spawnSync11("npm", ["run", "build"], {
|
|
2127
2133
|
encoding: "utf8",
|
|
@@ -2475,30 +2481,37 @@ var marked_esm_exports = {};
|
|
|
2475
2481
|
__export(marked_esm_exports, {
|
|
2476
2482
|
Hooks: () => P,
|
|
2477
2483
|
Lexer: () => x,
|
|
2478
|
-
Marked: () =>
|
|
2484
|
+
Marked: () => q,
|
|
2479
2485
|
Parser: () => b,
|
|
2480
2486
|
Renderer: () => y,
|
|
2481
2487
|
TextRenderer: () => L,
|
|
2482
2488
|
Tokenizer: () => w,
|
|
2483
2489
|
defaults: () => T,
|
|
2484
|
-
getDefaults: () =>
|
|
2485
|
-
lexer: () =>
|
|
2490
|
+
getDefaults: () => M,
|
|
2491
|
+
lexer: () => Yt,
|
|
2486
2492
|
marked: () => g,
|
|
2487
|
-
options: () =>
|
|
2488
|
-
parse: () =>
|
|
2489
|
-
parseInline: () =>
|
|
2490
|
-
parser: () =>
|
|
2491
|
-
setOptions: () =>
|
|
2492
|
-
use: () =>
|
|
2493
|
-
walkTokens: () =>
|
|
2493
|
+
options: () => Ft,
|
|
2494
|
+
parse: () => Jt,
|
|
2495
|
+
parseInline: () => Xt,
|
|
2496
|
+
parser: () => Vt,
|
|
2497
|
+
setOptions: () => Ut,
|
|
2498
|
+
use: () => Kt,
|
|
2499
|
+
walkTokens: () => Wt
|
|
2494
2500
|
});
|
|
2495
|
-
function
|
|
2501
|
+
function M() {
|
|
2496
2502
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
2497
2503
|
}
|
|
2498
|
-
function
|
|
2504
|
+
function N(l3) {
|
|
2499
2505
|
T = l3;
|
|
2500
2506
|
}
|
|
2501
|
-
function
|
|
2507
|
+
function E(l3) {
|
|
2508
|
+
let e = [];
|
|
2509
|
+
return (t) => {
|
|
2510
|
+
let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
|
|
2511
|
+
return s || (s = l3(n), e[n] = s), s;
|
|
2512
|
+
};
|
|
2513
|
+
}
|
|
2514
|
+
function d(l3, e = "") {
|
|
2502
2515
|
let t = typeof l3 == "string" ? l3 : l3.source, n = { replace: (s, r) => {
|
|
2503
2516
|
let i = typeof r == "string" ? r : r.source;
|
|
2504
2517
|
return i = i.replace(m.caret, "$1"), t = t.replace(s, i), n;
|
|
@@ -2507,11 +2520,11 @@ function k(l3, e = "") {
|
|
|
2507
2520
|
}
|
|
2508
2521
|
function O(l3, e) {
|
|
2509
2522
|
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,
|
|
2523
|
+
if (m.escapeTest.test(l3)) return l3.replace(m.escapeReplace, ge);
|
|
2524
|
+
} else if (m.escapeTestNoEncode.test(l3)) return l3.replace(m.escapeReplaceNoEncode, ge);
|
|
2512
2525
|
return l3;
|
|
2513
2526
|
}
|
|
2514
|
-
function
|
|
2527
|
+
function V(l3) {
|
|
2515
2528
|
try {
|
|
2516
2529
|
l3 = encodeURI(l3).replace(m.percentDecode, "%");
|
|
2517
2530
|
} catch {
|
|
@@ -2519,7 +2532,7 @@ function J(l3) {
|
|
|
2519
2532
|
}
|
|
2520
2533
|
return l3;
|
|
2521
2534
|
}
|
|
2522
|
-
function
|
|
2535
|
+
function Y(l3, e) {
|
|
2523
2536
|
let t = l3.replace(m.findPipe, (r, i, o) => {
|
|
2524
2537
|
let u = false, a = i;
|
|
2525
2538
|
for (; --a >= 0 && o[a] === "\\"; ) u = !u;
|
|
@@ -2542,14 +2555,14 @@ function $(l3, e, t) {
|
|
|
2542
2555
|
}
|
|
2543
2556
|
return l3.slice(0, n - s);
|
|
2544
2557
|
}
|
|
2545
|
-
function
|
|
2558
|
+
function ee(l3) {
|
|
2546
2559
|
let e = l3.split(`
|
|
2547
2560
|
`), t = e.length - 1;
|
|
2548
2561
|
for (; t >= 0 && m.blankLine.test(e[t]); ) t--;
|
|
2549
2562
|
return e.length - t <= 2 ? l3 : e.slice(0, t + 1).join(`
|
|
2550
2563
|
`);
|
|
2551
2564
|
}
|
|
2552
|
-
function
|
|
2565
|
+
function fe(l3, e) {
|
|
2553
2566
|
if (l3.indexOf(e[1]) === -1) return -1;
|
|
2554
2567
|
let t = 0;
|
|
2555
2568
|
for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
|
|
@@ -2557,7 +2570,7 @@ function ge(l3, e) {
|
|
|
2557
2570
|
else if (l3[n] === e[1] && (t--, t < 0)) return n;
|
|
2558
2571
|
return t > 0 ? -2 : -1;
|
|
2559
2572
|
}
|
|
2560
|
-
function
|
|
2573
|
+
function me(l3, e = 0) {
|
|
2561
2574
|
let t = e, n = "";
|
|
2562
2575
|
for (let s of l3) if (s === " ") {
|
|
2563
2576
|
let r = 4 - t % 4;
|
|
@@ -2565,13 +2578,13 @@ function fe(l3, e = 0) {
|
|
|
2565
2578
|
} else n += s, t++;
|
|
2566
2579
|
return n;
|
|
2567
2580
|
}
|
|
2568
|
-
function
|
|
2581
|
+
function xe(l3, e, t, n, s) {
|
|
2569
2582
|
let r = e.href, i = e.title || null, o = l3[1].replace(s.other.outputLinkReplace, "$1");
|
|
2570
2583
|
n.state.inLink = true;
|
|
2571
2584
|
let u = { type: l3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: r, title: i, text: o, tokens: n.inlineTokens(o) };
|
|
2572
2585
|
return n.state.inLink = false, u;
|
|
2573
2586
|
}
|
|
2574
|
-
function
|
|
2587
|
+
function st(l3, e, t) {
|
|
2575
2588
|
let n = l3.match(t.other.indentCodeCompensation);
|
|
2576
2589
|
if (n === null) return e;
|
|
2577
2590
|
let s = n[1];
|
|
@@ -2585,85 +2598,85 @@ function rt(l3, e, t) {
|
|
|
2585
2598
|
`);
|
|
2586
2599
|
}
|
|
2587
2600
|
function g(l3, e) {
|
|
2588
|
-
return
|
|
2601
|
+
return z.parse(l3, e);
|
|
2589
2602
|
}
|
|
2590
|
-
var T, _,
|
|
2603
|
+
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
2604
|
var init_marked_esm = __esm({
|
|
2592
2605
|
"node_modules/marked/lib/marked.esm.js"() {
|
|
2593
|
-
T =
|
|
2606
|
+
T = M();
|
|
2594
2607
|
_ = { exec: () => null };
|
|
2595
|
-
|
|
2608
|
+
Te = ((l3 = "") => {
|
|
2596
2609
|
try {
|
|
2597
2610
|
return !!new RegExp("(?<=1)(?<!1)" + l3);
|
|
2598
2611
|
} catch {
|
|
2599
2612
|
return false;
|
|
2600
2613
|
}
|
|
2601
2614
|
})();
|
|
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",
|
|
2615
|
+
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}}>`)) };
|
|
2616
|
+
Oe = /^(?:[ \t]*(?:\n|$))+/;
|
|
2617
|
+
we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
2618
|
+
ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
2619
|
+
B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
2620
|
+
Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
2621
|
+
j = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
|
|
2622
|
+
oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
2623
|
+
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();
|
|
2624
|
+
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();
|
|
2625
|
+
F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
2626
|
+
$e = /^[^\n]+/;
|
|
2627
|
+
U = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
2628
|
+
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();
|
|
2629
|
+
_e = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, j).getRegex();
|
|
2630
|
+
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";
|
|
2631
|
+
K = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
2632
|
+
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();
|
|
2633
|
+
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();
|
|
2634
|
+
Me = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", le).getRegex();
|
|
2635
|
+
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 };
|
|
2636
|
+
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();
|
|
2637
|
+
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() };
|
|
2638
|
+
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} *[^
|
|
2639
|
+
]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
2627
2640
|
Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
2628
2641
|
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
|
-
|
|
2642
|
+
ue = /^( {2,}|\\)\n(?!\s*$)/;
|
|
2643
|
+
Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
2644
|
+
I = /[\p{P}\p{S}]/u;
|
|
2645
|
+
Z = /[\s\p{P}\p{S}]/u;
|
|
2646
|
+
X = /[^\s\p{P}\p{S}]/u;
|
|
2647
|
+
De = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z).getRegex();
|
|
2648
|
+
pe = /(?!~)[\p{P}\p{S}]/u;
|
|
2649
|
+
qe = /(?!~)[\s\p{P}\p{S}]/u;
|
|
2650
|
+
ve = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
2651
|
+
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();
|
|
2652
|
+
ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
|
|
2653
|
+
Ze = d(ce, "u").replace(/punct/g, I).getRegex();
|
|
2654
|
+
Ge = d(ce, "u").replace(/punct/g, pe).getRegex();
|
|
2655
|
+
he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
2656
|
+
Ne = d(he, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex();
|
|
2657
|
+
Qe = d(he, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, pe).getRegex();
|
|
2658
|
+
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();
|
|
2659
|
+
Fe = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, I).getRegex();
|
|
2660
|
+
Ue = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
|
|
2661
|
+
Ke = d(Ue, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex();
|
|
2662
|
+
We = d(/\\(punct)/, "gu").replace(/punct/g, I).getRegex();
|
|
2663
|
+
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();
|
|
2664
|
+
Je = d(K).replace("(?:-->|$)", "-->").getRegex();
|
|
2665
|
+
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();
|
|
2666
|
+
v = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
|
|
2667
|
+
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();
|
|
2668
|
+
ke = d(/^!?\[(label)\]\[(ref)\]/).replace("label", v).replace("ref", U).getRegex();
|
|
2669
|
+
de = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex();
|
|
2670
|
+
et = d("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex();
|
|
2671
|
+
ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
2672
|
+
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: _ };
|
|
2673
|
+
tt = { ...J, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", v).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", v).getRegex() };
|
|
2674
|
+
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() };
|
|
2675
|
+
nt = { ...Q, br: d(ue).replace("{2,}", "*").getRegex(), text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
2676
|
+
D = { normal: W, gfm: Ee, pedantic: Ie };
|
|
2677
|
+
A = { normal: J, gfm: Q, breaks: nt, pedantic: tt };
|
|
2678
|
+
rt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
2679
|
+
ge = (l3) => rt[l3];
|
|
2667
2680
|
w = class {
|
|
2668
2681
|
options;
|
|
2669
2682
|
rules;
|
|
@@ -2678,14 +2691,14 @@ var init_marked_esm = __esm({
|
|
|
2678
2691
|
code(e) {
|
|
2679
2692
|
let t = this.rules.block.code.exec(e);
|
|
2680
2693
|
if (t) {
|
|
2681
|
-
let n = this.options.pedantic ? t[0] :
|
|
2694
|
+
let n = this.options.pedantic ? t[0] : ee(t[0]), s = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
2682
2695
|
return { type: "code", raw: n, codeBlockStyle: "indented", text: s };
|
|
2683
2696
|
}
|
|
2684
2697
|
}
|
|
2685
2698
|
fences(e) {
|
|
2686
2699
|
let t = this.rules.block.fences.exec(e);
|
|
2687
2700
|
if (t) {
|
|
2688
|
-
let n = t[0], s =
|
|
2701
|
+
let n = t[0], s = st(n, t[3] || "", this.rules);
|
|
2689
2702
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: s };
|
|
2690
2703
|
}
|
|
2691
2704
|
}
|
|
@@ -2724,8 +2737,8 @@ var init_marked_esm = __esm({
|
|
|
2724
2737
|
s = s ? `${s}
|
|
2725
2738
|
${c2}` : c2, r = r ? `${r}
|
|
2726
2739
|
${p}` : p;
|
|
2727
|
-
let
|
|
2728
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(p, i, true), this.lexer.state.top =
|
|
2740
|
+
let k = this.lexer.state.top;
|
|
2741
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, i, true), this.lexer.state.top = k, n.length === 0) break;
|
|
2729
2742
|
let h = i.at(-1);
|
|
2730
2743
|
if (h?.type === "code") break;
|
|
2731
2744
|
if (h?.type === "blockquote") {
|
|
@@ -2756,25 +2769,25 @@ ${p}` : p;
|
|
|
2756
2769
|
let a = false, c2 = "", p = "";
|
|
2757
2770
|
if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
2758
2771
|
c2 = t[0], e = e.substring(c2.length);
|
|
2759
|
-
let
|
|
2772
|
+
let k = me(t[2].split(`
|
|
2760
2773
|
`, 1)[0], t[1].length), h = e.split(`
|
|
2761
|
-
`, 1)[0], R = !
|
|
2762
|
-
if (this.options.pedantic ? (f = 2, p =
|
|
2774
|
+
`, 1)[0], R = !k.trim(), f = 0;
|
|
2775
|
+
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
2776
|
`, e = e.substring(h.length + 1), a = true), !a) {
|
|
2764
|
-
let S = this.rules.other.nextBulletRegex(f),
|
|
2777
|
+
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
2778
|
for (; e; ) {
|
|
2766
|
-
let
|
|
2779
|
+
let G = e.split(`
|
|
2767
2780
|
`, 1)[0], C;
|
|
2768
|
-
if (h =
|
|
2781
|
+
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
2782
|
if (C.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) p += `
|
|
2770
2783
|
` + C.slice(f);
|
|
2771
2784
|
else {
|
|
2772
|
-
if (R ||
|
|
2785
|
+
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
2786
|
p += `
|
|
2774
2787
|
` + h;
|
|
2775
2788
|
}
|
|
2776
|
-
R = !h.trim(), c2 +=
|
|
2777
|
-
`, e = e.substring(
|
|
2789
|
+
R = !h.trim(), c2 += G + `
|
|
2790
|
+
`, e = e.substring(G.length + 1), k = C.slice(f);
|
|
2778
2791
|
}
|
|
2779
2792
|
}
|
|
2780
2793
|
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 +2797,23 @@ ${p}` : p;
|
|
|
2784
2797
|
else return;
|
|
2785
2798
|
r.raw = r.raw.trimEnd();
|
|
2786
2799
|
for (let a of r.items) {
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2800
|
+
this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []);
|
|
2801
|
+
let c2 = a.tokens[0];
|
|
2802
|
+
if (a.task && (c2?.type === "text" || c2?.type === "paragraph")) {
|
|
2803
|
+
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, "");
|
|
2804
|
+
for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
|
|
2805
|
+
this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
|
|
2806
|
+
break;
|
|
2794
2807
|
}
|
|
2795
|
-
let
|
|
2796
|
-
if (
|
|
2797
|
-
let
|
|
2798
|
-
a.checked =
|
|
2808
|
+
let p = this.rules.other.listTaskCheckbox.exec(a.raw);
|
|
2809
|
+
if (p) {
|
|
2810
|
+
let k = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
2811
|
+
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
2812
|
}
|
|
2800
|
-
}
|
|
2813
|
+
} else a.task && (a.task = false);
|
|
2801
2814
|
if (!r.loose) {
|
|
2802
|
-
let
|
|
2803
|
-
r.loose =
|
|
2815
|
+
let p = a.tokens.filter((h) => h.type === "space"), k = p.length > 0 && p.some((h) => this.rules.other.anyLine.test(h.raw));
|
|
2816
|
+
r.loose = k;
|
|
2804
2817
|
}
|
|
2805
2818
|
}
|
|
2806
2819
|
if (r.loose) for (let a of r.items) {
|
|
@@ -2813,7 +2826,7 @@ ${p}` : p;
|
|
|
2813
2826
|
html(e) {
|
|
2814
2827
|
let t = this.rules.block.html.exec(e);
|
|
2815
2828
|
if (t) {
|
|
2816
|
-
let n =
|
|
2829
|
+
let n = ee(t[0]);
|
|
2817
2830
|
return { type: "html", block: true, raw: n, pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: n };
|
|
2818
2831
|
}
|
|
2819
2832
|
}
|
|
@@ -2828,13 +2841,13 @@ ${p}` : p;
|
|
|
2828
2841
|
table(e) {
|
|
2829
2842
|
let t = this.rules.block.table.exec(e);
|
|
2830
2843
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
2831
|
-
let n =
|
|
2844
|
+
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
2845
|
`) : [], i = { type: "table", raw: $(t[0], `
|
|
2833
2846
|
`), header: [], align: [], rows: [] };
|
|
2834
2847
|
if (n.length === s.length) {
|
|
2835
2848
|
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
2849
|
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(
|
|
2850
|
+
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
2851
|
return i;
|
|
2839
2852
|
}
|
|
2840
2853
|
}
|
|
@@ -2875,7 +2888,7 @@ ${p}` : p;
|
|
|
2875
2888
|
let i = $(n.slice(0, -1), "\\");
|
|
2876
2889
|
if ((n.length - i.length) % 2 === 0) return;
|
|
2877
2890
|
} else {
|
|
2878
|
-
let i =
|
|
2891
|
+
let i = fe(t[2], "()");
|
|
2879
2892
|
if (i === -2) return;
|
|
2880
2893
|
if (i > -1) {
|
|
2881
2894
|
let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
|
|
@@ -2887,7 +2900,7 @@ ${p}` : p;
|
|
|
2887
2900
|
let i = this.rules.other.pedanticHrefTitle.exec(s);
|
|
2888
2901
|
i && (s = i[1], r = i[3]);
|
|
2889
2902
|
} 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)),
|
|
2903
|
+
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
2904
|
}
|
|
2892
2905
|
}
|
|
2893
2906
|
reflink(e, t) {
|
|
@@ -2898,7 +2911,7 @@ ${p}` : p;
|
|
|
2898
2911
|
let i = n[0].charAt(0);
|
|
2899
2912
|
return { type: "text", raw: i, text: i };
|
|
2900
2913
|
}
|
|
2901
|
-
return
|
|
2914
|
+
return xe(n, r, n[0], this.lexer, this.rules);
|
|
2902
2915
|
}
|
|
2903
2916
|
}
|
|
2904
2917
|
emStrong(e, t, n = "") {
|
|
@@ -2917,7 +2930,7 @@ ${p}` : p;
|
|
|
2917
2930
|
}
|
|
2918
2931
|
if (a -= u, a > 0) continue;
|
|
2919
2932
|
u = Math.min(u, u + a + c2);
|
|
2920
|
-
let
|
|
2933
|
+
let k = [...s[0]][0].length, h = e.slice(0, i + s.index + k + u);
|
|
2921
2934
|
if (Math.min(i, u) % 2) {
|
|
2922
2935
|
let f = h.slice(1, -1);
|
|
2923
2936
|
return { type: "em", raw: h, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
@@ -2951,8 +2964,8 @@ ${p}` : p;
|
|
|
2951
2964
|
}
|
|
2952
2965
|
if (a -= u, a > 0) continue;
|
|
2953
2966
|
u = Math.min(u, u + a);
|
|
2954
|
-
let p = [...s[0]][0].length,
|
|
2955
|
-
return { type: "del", raw:
|
|
2967
|
+
let p = [...s[0]][0].length, k = e.slice(0, i + s.index + p + u), h = k.slice(i, -i);
|
|
2968
|
+
return { type: "del", raw: k, text: h, tokens: this.lexer.inlineTokens(h) };
|
|
2956
2969
|
}
|
|
2957
2970
|
}
|
|
2958
2971
|
}
|
|
@@ -2994,11 +3007,11 @@ ${p}` : p;
|
|
|
2994
3007
|
tokenizer;
|
|
2995
3008
|
constructor(e) {
|
|
2996
3009
|
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 =
|
|
3010
|
+
let t = { other: m, block: D.normal, inline: A.normal };
|
|
3011
|
+
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
3012
|
}
|
|
3000
3013
|
static get rules() {
|
|
3001
|
-
return { block:
|
|
3014
|
+
return { block: D, inline: A };
|
|
3002
3015
|
}
|
|
3003
3016
|
static lex(e, t) {
|
|
3004
3017
|
return new l(t).lex(e);
|
|
@@ -3182,9 +3195,9 @@ ${p}` : p;
|
|
|
3182
3195
|
}
|
|
3183
3196
|
let c2 = e;
|
|
3184
3197
|
if (this.options.extensions?.startInline) {
|
|
3185
|
-
let p = 1 / 0,
|
|
3198
|
+
let p = 1 / 0, k = e.slice(1), h;
|
|
3186
3199
|
this.options.extensions.startInline.forEach((R) => {
|
|
3187
|
-
h = R.call({ lexer: this },
|
|
3200
|
+
h = R.call({ lexer: this }, k), typeof h == "number" && h >= 0 && (p = Math.min(p, h));
|
|
3188
3201
|
}), p < 1 / 0 && p >= 0 && (c2 = e.substring(0, p + 1));
|
|
3189
3202
|
}
|
|
3190
3203
|
if (a = this.tokenizer.inlineText(c2)) {
|
|
@@ -3306,7 +3319,7 @@ ${e}</tr>
|
|
|
3306
3319
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
3307
3320
|
}
|
|
3308
3321
|
link({ href: e, title: t, tokens: n }) {
|
|
3309
|
-
let s = this.parser.parseInline(n), r =
|
|
3322
|
+
let s = this.parser.parseInline(n), r = V(e);
|
|
3310
3323
|
if (r === null) return s;
|
|
3311
3324
|
e = r;
|
|
3312
3325
|
let i = '<a href="' + e + '"';
|
|
@@ -3314,7 +3327,7 @@ ${e}</tr>
|
|
|
3314
3327
|
}
|
|
3315
3328
|
image({ href: e, title: t, text: n, tokens: s }) {
|
|
3316
3329
|
s && (n = this.parser.parseInline(s, this.parser.textRenderer));
|
|
3317
|
-
let r =
|
|
3330
|
+
let r = V(e);
|
|
3318
3331
|
if (r === null) return O(n);
|
|
3319
3332
|
e = r;
|
|
3320
3333
|
let i = `<img src="${e}" alt="${O(n)}"`;
|
|
@@ -3535,8 +3548,8 @@ ${e}</tr>
|
|
|
3535
3548
|
return e ? b.parse : b.parseInline;
|
|
3536
3549
|
}
|
|
3537
3550
|
};
|
|
3538
|
-
|
|
3539
|
-
defaults =
|
|
3551
|
+
q = class {
|
|
3552
|
+
defaults = M();
|
|
3540
3553
|
options = this.setOptions;
|
|
3541
3554
|
parse = this.parseMarkdown(true);
|
|
3542
3555
|
parseInline = this.parseMarkdown(false);
|
|
@@ -3626,15 +3639,15 @@ ${e}</tr>
|
|
|
3626
3639
|
let o = i, u = n.hooks[o], a = r[o];
|
|
3627
3640
|
P.passThroughHooks.has(i) ? r[o] = (c2) => {
|
|
3628
3641
|
if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
|
|
3629
|
-
let
|
|
3630
|
-
return a.call(r,
|
|
3642
|
+
let k = await u.call(r, c2);
|
|
3643
|
+
return a.call(r, k);
|
|
3631
3644
|
})();
|
|
3632
3645
|
let p = u.call(r, c2);
|
|
3633
3646
|
return a.call(r, p);
|
|
3634
3647
|
} : r[o] = (...c2) => {
|
|
3635
3648
|
if (this.defaults.async) return (async () => {
|
|
3636
|
-
let
|
|
3637
|
-
return
|
|
3649
|
+
let k = await u.apply(r, c2);
|
|
3650
|
+
return k === false && (k = await a.apply(r, c2)), k;
|
|
3638
3651
|
})();
|
|
3639
3652
|
let p = u.apply(r, c2);
|
|
3640
3653
|
return p === false && (p = a.apply(r, c2)), p;
|
|
@@ -3696,19 +3709,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
3696
3709
|
};
|
|
3697
3710
|
}
|
|
3698
3711
|
};
|
|
3699
|
-
|
|
3712
|
+
z = new q();
|
|
3700
3713
|
g.options = g.setOptions = function(l3) {
|
|
3701
|
-
return
|
|
3714
|
+
return z.setOptions(l3), g.defaults = z.defaults, N(g.defaults), g;
|
|
3702
3715
|
};
|
|
3703
|
-
g.getDefaults =
|
|
3716
|
+
g.getDefaults = M;
|
|
3704
3717
|
g.defaults = T;
|
|
3705
3718
|
g.use = function(...l3) {
|
|
3706
|
-
return
|
|
3719
|
+
return z.use(...l3), g.defaults = z.defaults, N(g.defaults), g;
|
|
3707
3720
|
};
|
|
3708
3721
|
g.walkTokens = function(l3, e) {
|
|
3709
|
-
return
|
|
3722
|
+
return z.walkTokens(l3, e);
|
|
3710
3723
|
};
|
|
3711
|
-
g.parseInline =
|
|
3724
|
+
g.parseInline = z.parseInline;
|
|
3712
3725
|
g.Parser = b;
|
|
3713
3726
|
g.parser = b.parse;
|
|
3714
3727
|
g.Renderer = y;
|
|
@@ -3718,14 +3731,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
3718
3731
|
g.Tokenizer = w;
|
|
3719
3732
|
g.Hooks = P;
|
|
3720
3733
|
g.parse = g;
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3734
|
+
Ft = g.options;
|
|
3735
|
+
Ut = g.setOptions;
|
|
3736
|
+
Kt = g.use;
|
|
3737
|
+
Wt = g.walkTokens;
|
|
3738
|
+
Xt = g.parseInline;
|
|
3739
|
+
Jt = g;
|
|
3740
|
+
Vt = b.parse;
|
|
3741
|
+
Yt = x.lex;
|
|
3729
3742
|
}
|
|
3730
3743
|
});
|
|
3731
3744
|
|
|
@@ -4271,9 +4284,9 @@ function launcherSuggest(raw) {
|
|
|
4271
4284
|
const candidates = [...ALL_COMMAND_NAMES, ...ORCHESTRATOR_COMMAND_NAMES, ...INSTALLER_DIRECT_COMMAND_NAMES].filter((c2) => c2 && !c2.startsWith("--"));
|
|
4272
4285
|
let best = null, bestD = Infinity;
|
|
4273
4286
|
for (const c2 of candidates) {
|
|
4274
|
-
const
|
|
4275
|
-
if (
|
|
4276
|
-
bestD =
|
|
4287
|
+
const d2 = launcherEditDistance(q2, c2.toLowerCase());
|
|
4288
|
+
if (d2 < bestD) {
|
|
4289
|
+
bestD = d2;
|
|
4277
4290
|
best = c2;
|
|
4278
4291
|
}
|
|
4279
4292
|
}
|