@hawkeyexl/manni 4.16.0 → 4.18.0
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 +1 -1
- package/dist/{batch-L5W4JS7A.js → batch-5TPNK5BQ.js} +14 -14
- package/dist/{build-GNZUVDZX.js → build-GGKCRWKH.js} +15 -14
- package/dist/{calibrate-2LYIDN6U.js → calibrate-OGOLLGXY.js} +15 -15
- package/dist/{capture-OEDMFU5Z.js → capture-CNHRHTA7.js} +14 -14
- package/dist/{check-NLLFHNWG.js → check-BAMOJMOJ.js} +16 -15
- package/dist/{check-Z5VGDSDT.js → check-XLIS5A7G.js} +13 -14
- package/dist/check-XYGABPXI.js +47 -0
- package/dist/{check-JR2TYL2Y.js → check-ZFI7H7LS.js} +15 -15
- package/dist/{cli-THEU2QG2.js → chunk-245W2Q7C.js} +133 -365
- package/dist/chunk-245W2Q7C.js.map +1 -0
- package/dist/{chunk-OJ7FEM2G.js → chunk-27FP4KKD.js} +47 -10
- package/dist/chunk-27FP4KKD.js.map +1 -0
- package/dist/{chunk-GQQ2AX63.js → chunk-2QZCPPVE.js} +38 -432
- package/dist/chunk-2QZCPPVE.js.map +1 -0
- package/dist/{chunk-BMYCLTFK.js → chunk-327CWO33.js} +3 -3
- package/dist/{chunk-WT3AATHC.js → chunk-33FIOHJ4.js} +252 -425
- package/dist/chunk-33FIOHJ4.js.map +1 -0
- package/dist/{chunk-ZJZQPOJO.js → chunk-3COYAAR7.js} +2 -2
- package/dist/{chunk-6ANTGYNT.js → chunk-3LZ6AYB4.js} +2 -2
- package/dist/{chunk-2AUULNIJ.js → chunk-4A445ALG.js} +3 -3
- package/dist/{chunk-L3YGGYBG.js → chunk-4KY2RUXQ.js} +3 -3
- package/dist/{chunk-NDBISART.js → chunk-5VA3ZOB7.js} +3 -3
- package/dist/{chunk-4LLYPDNG.js → chunk-6E6Z6UQL.js} +7 -7
- package/dist/{chunk-CSLJMML4.js → chunk-6ZYXK3JT.js} +4 -4
- package/dist/chunk-7RZQAMA2.js +314 -0
- package/dist/chunk-7RZQAMA2.js.map +1 -0
- package/dist/{chunk-NH6B6DDI.js → chunk-CWVL7XZR.js} +4 -4
- package/dist/{chunk-DTG6S2UG.js → chunk-E3YXGLEU.js} +2 -2
- package/dist/{chunk-5PO2BWZF.js → chunk-E76WPNYO.js} +2 -2
- package/dist/{chunk-F4GXZMEO.js → chunk-EITEHOSX.js} +12 -7
- package/dist/{chunk-F4GXZMEO.js.map → chunk-EITEHOSX.js.map} +1 -1
- package/dist/{chunk-DSTRT6YD.js → chunk-EU5QLSNN.js} +3 -3
- package/dist/{chunk-F6B2TNXU.js → chunk-F7GYY373.js} +6 -6
- package/dist/{chunk-6NTNLKNQ.js → chunk-FE3US7FR.js} +6 -5
- package/dist/{chunk-6NTNLKNQ.js.map → chunk-FE3US7FR.js.map} +1 -1
- package/dist/{chunk-IL62WATF.js → chunk-FNQE3RAW.js} +2 -2
- package/dist/chunk-FO6MNXOF.js +580 -0
- package/dist/chunk-FO6MNXOF.js.map +1 -0
- package/dist/{chunk-5D24C6WM.js → chunk-GMOAW2EG.js} +6 -2
- package/dist/chunk-GMOAW2EG.js.map +1 -0
- package/dist/chunk-GNZKLUZW.js +459 -0
- package/dist/chunk-GNZKLUZW.js.map +1 -0
- package/dist/{chunk-LEOQO3S6.js → chunk-ICRYIYMJ.js} +7 -7
- package/dist/{chunk-GR6QQ7GM.js → chunk-IIBVQCCR.js} +4 -4
- package/dist/{chunk-O6YTTBSN.js → chunk-JFB45L7D.js} +2 -2
- package/dist/chunk-JFPCDIES.js +1338 -0
- package/dist/chunk-JFPCDIES.js.map +1 -0
- package/dist/{chunk-2XRET3ZG.js → chunk-JHUEACRT.js} +31 -47
- package/dist/chunk-JHUEACRT.js.map +1 -0
- package/dist/{chunk-7UC55CAU.js → chunk-JS5NCZYC.js} +187 -159
- package/dist/chunk-JS5NCZYC.js.map +1 -0
- package/dist/{chunk-63GILHR5.js → chunk-KRQTN5KE.js} +4 -4
- package/dist/{chunk-WDENIUC7.js → chunk-MDZXRHIJ.js} +1 -1
- package/dist/chunk-MDZXRHIJ.js.map +1 -0
- package/dist/{chunk-3GLDB7MZ.js → chunk-MH5MX4B3.js} +1311 -18
- package/dist/chunk-MH5MX4B3.js.map +1 -0
- package/dist/{chunk-IGRXQC3H.js → chunk-N25KDXOV.js} +2 -2
- package/dist/{chunk-DW22KCLN.js → chunk-NPZWOPOH.js} +3 -3
- package/dist/{chunk-4L3JBAW4.js → chunk-NUAVQQMC.js} +2 -2
- package/dist/{chunk-PBZZUNDV.js → chunk-O2TE5X25.js} +7 -7
- package/dist/{chunk-EOSQENQF.js → chunk-OVQDZOMU.js} +2 -2
- package/dist/{chunk-WD33LE5A.js → chunk-OZWV27SE.js} +1313 -127
- package/dist/chunk-OZWV27SE.js.map +1 -0
- package/dist/{chunk-5OOQ3HQ3.js → chunk-PCTJ7P6U.js} +11 -2
- package/dist/chunk-PCTJ7P6U.js.map +1 -0
- package/dist/{chunk-EZCJPF72.js → chunk-PLN2LJDM.js} +3 -3
- package/dist/{chunk-D4ANAOY7.js → chunk-QGJA43DX.js} +20 -6
- package/dist/chunk-QGJA43DX.js.map +1 -0
- package/dist/{chunk-6YFEV7CM.js → chunk-QWYE3S3U.js} +5 -5
- package/dist/{chunk-GC47NBGO.js → chunk-QXTL5MGT.js} +4 -4
- package/dist/{chunk-AWAXAJ6R.js → chunk-RCWP63XT.js} +2 -2
- package/dist/{chunk-IM67NRUW.js → chunk-RMKMJ43W.js} +2 -2
- package/dist/{chunk-EA5KKIFG.js → chunk-RVSUMNCR.js} +3 -3
- package/dist/{chunk-NFJGIBES.js → chunk-SVB45M54.js} +82 -238
- package/dist/chunk-SVB45M54.js.map +1 -0
- package/dist/{chunk-4HEEXPVX.js → chunk-T3VFO2LO.js} +6 -6
- package/dist/{chunk-FU3OCYYH.js → chunk-TFTGMYDR.js} +2 -2
- package/dist/chunk-UP6NBQ62.js +2 -0
- package/dist/{chunk-LPBVWUKS.js → chunk-V2IP2ZMD.js} +2 -2
- package/dist/{chunk-PHNAQ4QX.js → chunk-V5QTIP2M.js} +182 -94
- package/dist/chunk-V5QTIP2M.js.map +1 -0
- package/dist/{chunk-B3XXCDYW.js → chunk-VV4YM6VM.js} +2385 -2061
- package/dist/chunk-VV4YM6VM.js.map +1 -0
- package/dist/{chunk-7GB3KEEM.js → chunk-XKZZRG3Z.js} +24 -460
- package/dist/chunk-XKZZRG3Z.js.map +1 -0
- package/dist/{chunk-ZT5NUSZA.js → chunk-XTQTA262.js} +146 -27
- package/dist/chunk-XTQTA262.js.map +1 -0
- package/dist/chunk-YLU4H2H3.js +545 -0
- package/dist/chunk-YLU4H2H3.js.map +1 -0
- package/dist/{chunk-YF6IZXAC.js → chunk-ZLOLC6WD.js} +7 -7
- package/dist/{cli-RWRYV5FB.js → cli-6UQ3QV2G.js} +9 -9
- package/dist/{cli-LZW6Z33F.js → cli-GH42HLFK.js} +42 -24
- package/dist/cli-GH42HLFK.js.map +1 -0
- package/dist/{cli-5QTSTGTX.js → cli-GND6TVRG.js} +18 -18
- package/dist/{cli-4Y2XY52B.js → cli-JHULEOH2.js} +2 -2
- package/dist/cli-LVHZCC2O.js +379 -0
- package/dist/cli-LVHZCC2O.js.map +1 -0
- package/dist/{cli-2EKRURBU.js → cli-NWU77YRZ.js} +15 -15
- package/dist/{cli-2SDBEUER.js → cli-PUO75R3L.js} +21 -21
- package/dist/{cli-TZ2OHF3H.js → cli-Q2RJMCVE.js} +28 -20
- package/dist/cli-Q2RJMCVE.js.map +1 -0
- package/dist/{cli-DBMPGGOV.js → cli-RUNYBUIV.js} +38 -38
- package/dist/{cli-BXUZ3KEQ.js → cli-T7UJF3BF.js} +634 -36
- package/dist/cli-T7UJF3BF.js.map +1 -0
- package/dist/{cli-KAUXC7EZ.js → cli-WUFQGIUG.js} +9 -9
- package/dist/cli.js +14 -14
- package/dist/docmeta.js +8 -8
- package/dist/{github-UR6LMUMW.js → github-BV42LSW2.js} +13 -14
- package/dist/github-XZ7OLATY.js +35 -0
- package/dist/graph/runtime.d.ts +633 -217
- package/dist/graph/runtime.js +1001 -370
- package/dist/graph/runtime.js.map +1 -1
- package/dist/index.d.ts +2734 -1977
- package/dist/index.js +109 -65
- package/dist/index.js.map +1 -1
- package/dist/{json-QTYN2JQB.js → json-LEEXKSGP.js} +13 -14
- package/dist/{json-5EQCGVCV.js → json-YTKUFNO3.js} +2 -2
- package/dist/{labels-UM2AFR5S.js → labels-E256WRAI.js} +12 -13
- package/dist/{labels-UM2AFR5S.js.map → labels-E256WRAI.js.map} +1 -1
- package/dist/{lint-LOFNZZPR.js → lint-W4CM3EIO.js} +13 -13
- package/dist/{list-GU7S6KEX.js → list-TB4R6AP4.js} +13 -14
- package/dist/{list-EPMHOU7T.js → list-UDDGL2OI.js} +15 -15
- package/dist/{page-25CN3AFY.js → page-L64NO57W.js} +13 -14
- package/dist/{prepare-5GYMBF4P.js → prepare-GFTAYDTP.js} +13 -13
- package/dist/{pretty-52Z74O6F.js → pretty-HYCYKYHB.js} +14 -15
- package/dist/{pretty-QW6OSYRS.js → pretty-Q43TCD6D.js} +13 -14
- package/dist/{reporters-WT53GD4P.js → reporters-4HRBSMUF.js} +4 -4
- package/dist/{reporters-FSXJ42EB.js → reporters-6TEJDXXO.js} +4 -4
- package/dist/{reporters-3FXX2W4X.js → reporters-E3FUVBQ6.js} +12 -12
- package/dist/{run-H7XJMUWK.js → run-UDX2C54M.js} +16 -16
- package/dist/{sarif-C427U3NA.js → sarif-WL353VTA.js} +11 -11
- package/dist/sarif-XZFJ5VIJ.js +36 -0
- package/dist/site/rehype.d.ts +33 -0
- package/dist/site/rehype.js +49 -0
- package/dist/site/rehype.js.map +1 -0
- package/dist/{term-VG65JRNR.js → term-OZ7ZR5KB.js} +18 -19
- package/dist/{term-VG65JRNR.js.map → term-OZ7ZR5KB.js.map} +1 -1
- package/dist/{types-VMOT7RAL.js → types-7N7ETP3W.js} +2 -2
- package/dist/{validate-K36F54UB.js → validate-CR3TI7GP.js} +5 -5
- package/package.json +10 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/shapes/graph/shapes-1.2.0.ttl +1161 -0
- package/dist/check-LVO4HZ3F.js +0 -36
- package/dist/chunk-2XRET3ZG.js.map +0 -1
- package/dist/chunk-3GLDB7MZ.js.map +0 -1
- package/dist/chunk-3WZQ2FR3.js +0 -236
- package/dist/chunk-3WZQ2FR3.js.map +0 -1
- package/dist/chunk-5D24C6WM.js.map +0 -1
- package/dist/chunk-5OOQ3HQ3.js.map +0 -1
- package/dist/chunk-7GB3KEEM.js.map +0 -1
- package/dist/chunk-7UC55CAU.js.map +0 -1
- package/dist/chunk-B3XXCDYW.js.map +0 -1
- package/dist/chunk-D4ANAOY7.js.map +0 -1
- package/dist/chunk-GQQ2AX63.js.map +0 -1
- package/dist/chunk-IKEWBMCN.js +0 -98
- package/dist/chunk-IKEWBMCN.js.map +0 -1
- package/dist/chunk-NFJGIBES.js.map +0 -1
- package/dist/chunk-OJ7FEM2G.js.map +0 -1
- package/dist/chunk-PHNAQ4QX.js.map +0 -1
- package/dist/chunk-WD33LE5A.js.map +0 -1
- package/dist/chunk-WDENIUC7.js.map +0 -1
- package/dist/chunk-WT3AATHC.js.map +0 -1
- package/dist/chunk-YUTVAMWW.js +0 -2
- package/dist/chunk-ZT5NUSZA.js.map +0 -1
- package/dist/cli-BXUZ3KEQ.js.map +0 -1
- package/dist/cli-LZW6Z33F.js.map +0 -1
- package/dist/cli-THEU2QG2.js.map +0 -1
- package/dist/cli-TZ2OHF3H.js.map +0 -1
- package/dist/github-ICZ5UDGX.js +0 -36
- package/dist/sarif-UVAFWZKS.js +0 -37
- /package/dist/{batch-L5W4JS7A.js.map → batch-5TPNK5BQ.js.map} +0 -0
- /package/dist/{build-GNZUVDZX.js.map → build-GGKCRWKH.js.map} +0 -0
- /package/dist/{calibrate-2LYIDN6U.js.map → calibrate-OGOLLGXY.js.map} +0 -0
- /package/dist/{capture-OEDMFU5Z.js.map → capture-CNHRHTA7.js.map} +0 -0
- /package/dist/{check-LVO4HZ3F.js.map → check-BAMOJMOJ.js.map} +0 -0
- /package/dist/{check-NLLFHNWG.js.map → check-XLIS5A7G.js.map} +0 -0
- /package/dist/{check-Z5VGDSDT.js.map → check-XYGABPXI.js.map} +0 -0
- /package/dist/{check-JR2TYL2Y.js.map → check-ZFI7H7LS.js.map} +0 -0
- /package/dist/{chunk-BMYCLTFK.js.map → chunk-327CWO33.js.map} +0 -0
- /package/dist/{chunk-ZJZQPOJO.js.map → chunk-3COYAAR7.js.map} +0 -0
- /package/dist/{chunk-6ANTGYNT.js.map → chunk-3LZ6AYB4.js.map} +0 -0
- /package/dist/{chunk-2AUULNIJ.js.map → chunk-4A445ALG.js.map} +0 -0
- /package/dist/{chunk-L3YGGYBG.js.map → chunk-4KY2RUXQ.js.map} +0 -0
- /package/dist/{chunk-NDBISART.js.map → chunk-5VA3ZOB7.js.map} +0 -0
- /package/dist/{chunk-4LLYPDNG.js.map → chunk-6E6Z6UQL.js.map} +0 -0
- /package/dist/{chunk-CSLJMML4.js.map → chunk-6ZYXK3JT.js.map} +0 -0
- /package/dist/{chunk-NH6B6DDI.js.map → chunk-CWVL7XZR.js.map} +0 -0
- /package/dist/{chunk-DTG6S2UG.js.map → chunk-E3YXGLEU.js.map} +0 -0
- /package/dist/{chunk-5PO2BWZF.js.map → chunk-E76WPNYO.js.map} +0 -0
- /package/dist/{chunk-DSTRT6YD.js.map → chunk-EU5QLSNN.js.map} +0 -0
- /package/dist/{chunk-F6B2TNXU.js.map → chunk-F7GYY373.js.map} +0 -0
- /package/dist/{chunk-IL62WATF.js.map → chunk-FNQE3RAW.js.map} +0 -0
- /package/dist/{chunk-LEOQO3S6.js.map → chunk-ICRYIYMJ.js.map} +0 -0
- /package/dist/{chunk-GR6QQ7GM.js.map → chunk-IIBVQCCR.js.map} +0 -0
- /package/dist/{chunk-O6YTTBSN.js.map → chunk-JFB45L7D.js.map} +0 -0
- /package/dist/{chunk-63GILHR5.js.map → chunk-KRQTN5KE.js.map} +0 -0
- /package/dist/{chunk-IGRXQC3H.js.map → chunk-N25KDXOV.js.map} +0 -0
- /package/dist/{chunk-DW22KCLN.js.map → chunk-NPZWOPOH.js.map} +0 -0
- /package/dist/{chunk-4L3JBAW4.js.map → chunk-NUAVQQMC.js.map} +0 -0
- /package/dist/{chunk-PBZZUNDV.js.map → chunk-O2TE5X25.js.map} +0 -0
- /package/dist/{chunk-EOSQENQF.js.map → chunk-OVQDZOMU.js.map} +0 -0
- /package/dist/{chunk-EZCJPF72.js.map → chunk-PLN2LJDM.js.map} +0 -0
- /package/dist/{chunk-6YFEV7CM.js.map → chunk-QWYE3S3U.js.map} +0 -0
- /package/dist/{chunk-GC47NBGO.js.map → chunk-QXTL5MGT.js.map} +0 -0
- /package/dist/{chunk-AWAXAJ6R.js.map → chunk-RCWP63XT.js.map} +0 -0
- /package/dist/{chunk-IM67NRUW.js.map → chunk-RMKMJ43W.js.map} +0 -0
- /package/dist/{chunk-EA5KKIFG.js.map → chunk-RVSUMNCR.js.map} +0 -0
- /package/dist/{chunk-4HEEXPVX.js.map → chunk-T3VFO2LO.js.map} +0 -0
- /package/dist/{chunk-FU3OCYYH.js.map → chunk-TFTGMYDR.js.map} +0 -0
- /package/dist/{chunk-YUTVAMWW.js.map → chunk-UP6NBQ62.js.map} +0 -0
- /package/dist/{chunk-LPBVWUKS.js.map → chunk-V2IP2ZMD.js.map} +0 -0
- /package/dist/{chunk-YF6IZXAC.js.map → chunk-ZLOLC6WD.js.map} +0 -0
- /package/dist/{cli-RWRYV5FB.js.map → cli-6UQ3QV2G.js.map} +0 -0
- /package/dist/{cli-5QTSTGTX.js.map → cli-GND6TVRG.js.map} +0 -0
- /package/dist/{cli-4Y2XY52B.js.map → cli-JHULEOH2.js.map} +0 -0
- /package/dist/{cli-2EKRURBU.js.map → cli-NWU77YRZ.js.map} +0 -0
- /package/dist/{cli-2SDBEUER.js.map → cli-PUO75R3L.js.map} +0 -0
- /package/dist/{cli-DBMPGGOV.js.map → cli-RUNYBUIV.js.map} +0 -0
- /package/dist/{cli-KAUXC7EZ.js.map → cli-WUFQGIUG.js.map} +0 -0
- /package/dist/{github-ICZ5UDGX.js.map → github-BV42LSW2.js.map} +0 -0
- /package/dist/{github-UR6LMUMW.js.map → github-XZ7OLATY.js.map} +0 -0
- /package/dist/{json-5EQCGVCV.js.map → json-LEEXKSGP.js.map} +0 -0
- /package/dist/{json-QTYN2JQB.js.map → json-YTKUFNO3.js.map} +0 -0
- /package/dist/{lint-LOFNZZPR.js.map → lint-W4CM3EIO.js.map} +0 -0
- /package/dist/{list-EPMHOU7T.js.map → list-TB4R6AP4.js.map} +0 -0
- /package/dist/{list-GU7S6KEX.js.map → list-UDDGL2OI.js.map} +0 -0
- /package/dist/{page-25CN3AFY.js.map → page-L64NO57W.js.map} +0 -0
- /package/dist/{prepare-5GYMBF4P.js.map → prepare-GFTAYDTP.js.map} +0 -0
- /package/dist/{pretty-52Z74O6F.js.map → pretty-HYCYKYHB.js.map} +0 -0
- /package/dist/{pretty-QW6OSYRS.js.map → pretty-Q43TCD6D.js.map} +0 -0
- /package/dist/{reporters-3FXX2W4X.js.map → reporters-4HRBSMUF.js.map} +0 -0
- /package/dist/{reporters-FSXJ42EB.js.map → reporters-6TEJDXXO.js.map} +0 -0
- /package/dist/{reporters-WT53GD4P.js.map → reporters-E3FUVBQ6.js.map} +0 -0
- /package/dist/{run-H7XJMUWK.js.map → run-UDX2C54M.js.map} +0 -0
- /package/dist/{sarif-C427U3NA.js.map → sarif-WL353VTA.js.map} +0 -0
- /package/dist/{sarif-UVAFWZKS.js.map → sarif-XZFJ5VIJ.js.map} +0 -0
- /package/dist/{types-VMOT7RAL.js.map → types-7N7ETP3W.js.map} +0 -0
- /package/dist/{validate-K36F54UB.js.map → validate-CR3TI7GP.js.map} +0 -0
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
codeEndAt,
|
|
4
|
-
codeRegions
|
|
5
|
-
} from "./chunk-IKEWBMCN.js";
|
|
6
2
|
import {
|
|
7
3
|
LineRangeError,
|
|
8
4
|
MAX_RANGE_LINES,
|
|
@@ -11,16 +7,18 @@ import {
|
|
|
11
7
|
isKeyedPin,
|
|
12
8
|
lineSpec,
|
|
13
9
|
parseLines,
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
parseStatements,
|
|
11
|
+
sliceLines,
|
|
12
|
+
statementForms
|
|
13
|
+
} from "./chunk-MH5MX4B3.js";
|
|
16
14
|
import {
|
|
17
|
-
|
|
15
|
+
__default4 as __default,
|
|
18
16
|
extractorByName,
|
|
19
17
|
extractorForExtension,
|
|
20
18
|
hasFrontmatterFence,
|
|
21
19
|
locateFrontmatter,
|
|
22
20
|
supportedExtensions
|
|
23
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OZWV27SE.js";
|
|
24
22
|
import {
|
|
25
23
|
isEncryptedValue
|
|
26
24
|
} from "./chunk-B2242FYO.js";
|
|
@@ -59,17 +57,23 @@ function hashRange2(text, range, key) {
|
|
|
59
57
|
// src/cite/core/range.ts
|
|
60
58
|
var FILE_PATTERN = /^(?:~[A-Za-z0-9_-]{82,}|(?!~)(?:(?!\.\.?(?:\/|$))[^/\\:\r\n\t]+)(?:\/(?:(?!\.\.?(?:\/|$))[^/\\:\r\n\t]+))*)$/;
|
|
61
59
|
var SRC_PATTERN = /^(?:~[A-Za-z0-9_-]{82,}|(?!~)(?:(?!\.\.?(?:\/|:|$))[^/\\:\r\n\t]+)(?:\/(?:(?!\.\.?(?:\/|:|$))[^/\\:\r\n\t]+))*)(?::[1-9][0-9]*(?:-[1-9][0-9]*)?)?$/;
|
|
60
|
+
var REPO_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
|
|
61
|
+
var LINES_TAIL = /^[0-9-]*$/;
|
|
62
62
|
function parseSrc(src) {
|
|
63
|
-
|
|
63
|
+
const first = src.indexOf(":");
|
|
64
|
+
const repo = first !== -1 && !LINES_TAIL.test(src.slice(first + 1)) ? src.slice(0, first) : void 0;
|
|
65
|
+
const rest = repo === void 0 ? src : src.slice(first + 1);
|
|
66
|
+
if (repo !== void 0 && !REPO_PATTERN.test(repo) || !SRC_PATTERN.test(rest)) {
|
|
64
67
|
throw new CiteError(
|
|
65
|
-
`Invalid src "${src}": expected path, path:L, path:L1-L2, or an encrypted source (~ and at least 82 base64url characters) with the same line forms; the path is
|
|
68
|
+
`Invalid src "${src}": expected path, path:L, path:L1-L2, or an encrypted source (~ and at least 82 base64url characters) with the same line forms, each optionally prefixed with a repo name and a colon; the path is relative to its checkout, posix, and free of . and .. segments.`
|
|
66
69
|
);
|
|
67
70
|
}
|
|
68
|
-
const colon =
|
|
69
|
-
const path = colon === -1 ?
|
|
71
|
+
const colon = rest.indexOf(":");
|
|
72
|
+
const path = colon === -1 ? rest : rest.slice(0, colon);
|
|
70
73
|
const range = { path, encrypted: isEncryptedValue(path) };
|
|
74
|
+
if (repo !== void 0) range.repo = repo;
|
|
71
75
|
if (colon === -1) return range;
|
|
72
|
-
const [startText, endText] =
|
|
76
|
+
const [startText, endText] = rest.slice(colon + 1).split("-");
|
|
73
77
|
const start = Number(startText);
|
|
74
78
|
const end = endText === void 0 ? start : Number(endText);
|
|
75
79
|
if (end < start) {
|
|
@@ -84,13 +88,15 @@ function tooWide(lines) {
|
|
|
84
88
|
return width > MAX_RANGE_LINES ? `spans ${String(width)} lines, more than ${String(MAX_RANGE_LINES)}` : void 0;
|
|
85
89
|
}
|
|
86
90
|
function formatSrc(range) {
|
|
87
|
-
const {
|
|
91
|
+
const { start, end } = range;
|
|
92
|
+
const path = range.repo === void 0 ? range.path : `${range.repo}:${range.path}`;
|
|
88
93
|
if (start === void 0) return path;
|
|
89
94
|
if (end === void 0 || end === start) return `${path}:${start}`;
|
|
90
95
|
return `${path}:${start}-${end}`;
|
|
91
96
|
}
|
|
92
97
|
function sourceRange(source) {
|
|
93
98
|
const range = { path: source.file, encrypted: isEncryptedValue(source.file) };
|
|
99
|
+
if (source.repo !== void 0) range.repo = source.repo;
|
|
94
100
|
if (source.lines === void 0) return range;
|
|
95
101
|
const lines = parseLines(source.lines);
|
|
96
102
|
if (lines !== void 0) {
|
|
@@ -153,7 +159,7 @@ var RULE_DESCRIPTIONS = {
|
|
|
153
159
|
"source-moved-ambiguous": "The cited lines now occur in more than one place.",
|
|
154
160
|
"source-changed": "The cited lines are not what they were.",
|
|
155
161
|
"source-never-true": "The pin held at no commit in the source's history.",
|
|
156
|
-
"source-missing": "The path names no tracked file, or an encrypted source cannot be decrypted.",
|
|
162
|
+
"source-missing": "The path names no tracked file, names an undeclared repo, or an encrypted source cannot be decrypted.",
|
|
157
163
|
"claim-moved": "The pinned page text sits at a different line.",
|
|
158
164
|
"claim-moved-ambiguous": "The pinned page text now occurs in more than one place.",
|
|
159
165
|
"claim-reanchored": "The pinned words are unchanged, and only the layout around them moved.",
|
|
@@ -185,265 +191,6 @@ function resolveSeverity(overrides) {
|
|
|
185
191
|
}
|
|
186
192
|
|
|
187
193
|
// src/cite/core/statements.ts
|
|
188
|
-
var HTML_COMMENT = { open: "<!--", close: "-->" };
|
|
189
|
-
var JSX_COMMENT = { open: "{/*", close: "*/}" };
|
|
190
|
-
var LINK_REFERENCE = { open: "[comment]: # (", close: ")" };
|
|
191
|
-
var MARKDOWN_FORMS = [HTML_COMMENT, JSX_COMMENT, LINK_REFERENCE];
|
|
192
|
-
var MDX_FORMS = [JSX_COMMENT, HTML_COMMENT, LINK_REFERENCE];
|
|
193
|
-
var COMMENT_FORMS = [{ open: "<!--", close: "-->" }];
|
|
194
|
-
var ASCIIDOC_FORMS = [{ open: "// (", close: ")" }];
|
|
195
|
-
var RST_FORMS = [{ open: ".. (", close: ")" }];
|
|
196
|
-
var ID = /^[a-z0-9][a-z0-9-]*$/;
|
|
197
|
-
var ANY_FENCE = /^(?:[ \t]*(?:`{3,}|~{3,})|-{4,})/;
|
|
198
|
-
var MARKDOWN_FENCE = /^(`{3,}|~{3,})/;
|
|
199
|
-
var ASCIIDOC_FENCE = /^(-{4,})/;
|
|
200
|
-
function statementForms(format) {
|
|
201
|
-
switch (format) {
|
|
202
|
-
case "markdown":
|
|
203
|
-
return MARKDOWN_FORMS;
|
|
204
|
-
case "mdx":
|
|
205
|
-
return MDX_FORMS;
|
|
206
|
-
case "html":
|
|
207
|
-
case "xml":
|
|
208
|
-
return COMMENT_FORMS;
|
|
209
|
-
case "asciidoc":
|
|
210
|
-
return ASCIIDOC_FORMS;
|
|
211
|
-
case "rst":
|
|
212
|
-
return RST_FORMS;
|
|
213
|
-
default:
|
|
214
|
-
return [];
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function fenceFor(format) {
|
|
218
|
-
switch (format) {
|
|
219
|
-
case "markdown":
|
|
220
|
-
case "mdx":
|
|
221
|
-
return MARKDOWN_FENCE;
|
|
222
|
-
case "asciidoc":
|
|
223
|
-
return ASCIIDOC_FENCE;
|
|
224
|
-
default:
|
|
225
|
-
return void 0;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function lineEnd(content, pos) {
|
|
229
|
-
const nl = content.indexOf("\n", pos);
|
|
230
|
-
return nl === -1 ? content.length : nl;
|
|
231
|
-
}
|
|
232
|
-
function lineText(content, pos, end) {
|
|
233
|
-
const text = content.slice(pos, end);
|
|
234
|
-
return text.endsWith("\r") ? text.slice(0, -1) : text;
|
|
235
|
-
}
|
|
236
|
-
function beforeCr(content, end) {
|
|
237
|
-
return end > 0 && content.charCodeAt(end - 1) === 13 ? end - 1 : end;
|
|
238
|
-
}
|
|
239
|
-
function nextLineStart(content, offset) {
|
|
240
|
-
if (offset === 0 || content.charCodeAt(offset - 1) === 10) return offset;
|
|
241
|
-
return lineEnd(content, offset) + 1;
|
|
242
|
-
}
|
|
243
|
-
var MAX_IDS_PER_MARKER = 25;
|
|
244
|
-
var EMPTY_PAYLOAD = "empty payload. Name an entry id, or remove the marker.";
|
|
245
|
-
function payloadOf(payload) {
|
|
246
|
-
if (payload === "") return { kind: "bad", reason: EMPTY_PAYLOAD };
|
|
247
|
-
if (/[\r\n]/.test(payload)) {
|
|
248
|
-
return { kind: "bad", reason: "a marker is one line; write two markers" };
|
|
249
|
-
}
|
|
250
|
-
const [head, ...rest] = payload.split(" ").filter((word) => word !== "");
|
|
251
|
-
if (head === void 0) return { kind: "bad", reason: EMPTY_PAYLOAD };
|
|
252
|
-
const words = [head, ...rest];
|
|
253
|
-
if (words.some((word) => word.startsWith("{"))) {
|
|
254
|
-
return { kind: "bad", reason: "a JSON payload", json: true };
|
|
255
|
-
}
|
|
256
|
-
if (words.length > MAX_IDS_PER_MARKER) {
|
|
257
|
-
return {
|
|
258
|
-
kind: "bad",
|
|
259
|
-
reason: `more than ${String(MAX_IDS_PER_MARKER)} ids in one marker (${String(words.length)}); write a second marker`
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
const bad = words.find((word) => !ID.test(word));
|
|
263
|
-
if (bad !== void 0) {
|
|
264
|
-
return {
|
|
265
|
-
kind: "bad",
|
|
266
|
-
reason: `"${bad}" is not an id. An id is lowercase letters, digits and hyphens. Separate ids with spaces.`
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
const seen = /* @__PURE__ */ new Set();
|
|
270
|
-
for (const word of words) {
|
|
271
|
-
if (seen.has(word)) {
|
|
272
|
-
return { kind: "bad", reason: `"${word}" is named twice in one marker. Remove one.` };
|
|
273
|
-
}
|
|
274
|
-
seen.add(word);
|
|
275
|
-
}
|
|
276
|
-
return { kind: "ref", ids: words };
|
|
277
|
-
}
|
|
278
|
-
function isCite(inner) {
|
|
279
|
-
return inner === "cite" || inner.startsWith("cite") && /\s/.test(inner.charAt(4));
|
|
280
|
-
}
|
|
281
|
-
function isMarkerLine(line, format) {
|
|
282
|
-
const text = line.trim();
|
|
283
|
-
return statementForms(format).some((form) => {
|
|
284
|
-
if (text.length < form.open.length + form.close.length) return false;
|
|
285
|
-
if (!text.startsWith(form.open)) return false;
|
|
286
|
-
const closeAt = text.indexOf(form.close, form.open.length);
|
|
287
|
-
if (closeAt !== text.length - form.close.length) return false;
|
|
288
|
-
return isCite(text.slice(form.open.length, closeAt).trim());
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
var ATX_HEADING = /^[ \t]*#{1,6}([ \t]|$)/;
|
|
292
|
-
var ASCIIDOC_TITLE = /^={1,6}[ \t]/;
|
|
293
|
-
var ADORNMENT = /^[ \t]*([-=~^"'*+#_:<>])(?:[ \t]*\1){2,}[ \t]*$/;
|
|
294
|
-
var TAG_LINE = /^[ \t]*<\/?[A-Za-z][^<>]*>[ \t]*$/;
|
|
295
|
-
var TABLE_ROW = /^[ \t]*\|/;
|
|
296
|
-
function isTableRow(line) {
|
|
297
|
-
return TABLE_ROW.test(line);
|
|
298
|
-
}
|
|
299
|
-
var TABLE_RULE = /^(?=[^|]*\|)[ \t]*\|?(?:[ \t]*:?-+:?[ \t]*\|)*[ \t]*:?-+:?[ \t]*\|?[ \t]*$/;
|
|
300
|
-
function isTableSeparator(line) {
|
|
301
|
-
return TABLE_RULE.test(line);
|
|
302
|
-
}
|
|
303
|
-
function isBoundLine(line, format) {
|
|
304
|
-
if (ADORNMENT.test(line)) return true;
|
|
305
|
-
switch (format) {
|
|
306
|
-
case "markdown":
|
|
307
|
-
case "mdx":
|
|
308
|
-
return ATX_HEADING.test(line) || TAG_LINE.test(line);
|
|
309
|
-
case "html":
|
|
310
|
-
case "xml":
|
|
311
|
-
return TAG_LINE.test(line);
|
|
312
|
-
case "asciidoc":
|
|
313
|
-
return ASCIIDOC_TITLE.test(line);
|
|
314
|
-
default:
|
|
315
|
-
return false;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
function parseStatements(body, format, from = { offset: 0, line: 1 }) {
|
|
319
|
-
const out = [];
|
|
320
|
-
const fileLine = (bodyOffset) => from.line + lineAt(body, bodyOffset) - 1;
|
|
321
|
-
const code = codeRegions(body, format);
|
|
322
|
-
for (const form of statementForms(format)) {
|
|
323
|
-
let cursor = 0;
|
|
324
|
-
for (; ; ) {
|
|
325
|
-
const at = body.indexOf(form.open, cursor);
|
|
326
|
-
if (at === -1) break;
|
|
327
|
-
const codeEnd = codeEndAt(code, at);
|
|
328
|
-
if (codeEnd !== void 0) {
|
|
329
|
-
cursor = codeEnd;
|
|
330
|
-
continue;
|
|
331
|
-
}
|
|
332
|
-
const closeAt = body.indexOf(form.close, at + form.open.length);
|
|
333
|
-
if (closeAt === -1) break;
|
|
334
|
-
const end = closeAt + form.close.length;
|
|
335
|
-
cursor = end;
|
|
336
|
-
const inner = body.slice(at + form.open.length, closeAt).trim();
|
|
337
|
-
if (!isCite(inner)) continue;
|
|
338
|
-
const payload = inner.slice(4).trim();
|
|
339
|
-
const unit = anchoredLines(body, end, format);
|
|
340
|
-
const anchorLine = unit === void 0 ? void 0 : from.line + unit.start - 1;
|
|
341
|
-
const statement = {
|
|
342
|
-
line: fileLine(at),
|
|
343
|
-
payload: payloadOf(payload),
|
|
344
|
-
raw: inner,
|
|
345
|
-
start: from.offset + at,
|
|
346
|
-
end: from.offset + end
|
|
347
|
-
};
|
|
348
|
-
if (anchorLine !== void 0) statement.anchorLine = anchorLine;
|
|
349
|
-
out.push(statement);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return out.sort((a, b) => a.start - b.start);
|
|
353
|
-
}
|
|
354
|
-
function detectEol(text) {
|
|
355
|
-
const nl = text.indexOf("\n");
|
|
356
|
-
return nl > 0 && text.charCodeAt(nl - 1) === 13 ? "\r\n" : "\n";
|
|
357
|
-
}
|
|
358
|
-
function paragraphAfter(content, offset, format) {
|
|
359
|
-
const marker = (text) => format !== void 0 && isMarkerLine(text, format);
|
|
360
|
-
const bound = (text) => format !== void 0 && isBoundLine(text, format);
|
|
361
|
-
let pos = offset;
|
|
362
|
-
const firstEnd = lineEnd(content, pos);
|
|
363
|
-
if (lineText(content, pos, firstEnd).trim() === "") pos = firstEnd + 1;
|
|
364
|
-
while (pos < content.length) {
|
|
365
|
-
const end = lineEnd(content, pos);
|
|
366
|
-
const text = lineText(content, pos, end);
|
|
367
|
-
if (text.trim() === "" || marker(text)) {
|
|
368
|
-
pos = end + 1;
|
|
369
|
-
continue;
|
|
370
|
-
}
|
|
371
|
-
if (ANY_FENCE.test(text)) return void 0;
|
|
372
|
-
const start = pos;
|
|
373
|
-
let last = end;
|
|
374
|
-
let cursor = bound(text) ? content.length : end + 1;
|
|
375
|
-
while (cursor < content.length) {
|
|
376
|
-
const e = lineEnd(content, cursor);
|
|
377
|
-
const t = lineText(content, cursor, e);
|
|
378
|
-
if (t.trim() === "" || ANY_FENCE.test(t) || marker(t) || bound(t)) break;
|
|
379
|
-
last = e;
|
|
380
|
-
cursor = e + 1;
|
|
381
|
-
}
|
|
382
|
-
return { start, end: beforeCr(content, last), line: lineAt(content, start) };
|
|
383
|
-
}
|
|
384
|
-
return void 0;
|
|
385
|
-
}
|
|
386
|
-
function scanFence(content, offset, fence) {
|
|
387
|
-
let pos = nextLineStart(content, offset);
|
|
388
|
-
while (pos < content.length) {
|
|
389
|
-
const end = lineEnd(content, pos);
|
|
390
|
-
const text = lineText(content, pos, end);
|
|
391
|
-
const opener = fence.exec(text)?.[1];
|
|
392
|
-
if (opener === void 0) {
|
|
393
|
-
pos = end + 1;
|
|
394
|
-
continue;
|
|
395
|
-
}
|
|
396
|
-
const line = lineAt(content, pos);
|
|
397
|
-
const start = Math.min(end + 1, content.length);
|
|
398
|
-
let cursor = start;
|
|
399
|
-
while (cursor < content.length) {
|
|
400
|
-
const e = lineEnd(content, cursor);
|
|
401
|
-
if (lineText(content, cursor, e).startsWith(opener)) {
|
|
402
|
-
return {
|
|
403
|
-
start,
|
|
404
|
-
end: cursor,
|
|
405
|
-
line,
|
|
406
|
-
text: content.slice(start, cursor),
|
|
407
|
-
next: e + 1
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
cursor = e + 1;
|
|
411
|
-
}
|
|
412
|
-
return void 0;
|
|
413
|
-
}
|
|
414
|
-
return void 0;
|
|
415
|
-
}
|
|
416
|
-
function fencedBlockAfter(content, offset, format) {
|
|
417
|
-
const fence = fenceFor(format);
|
|
418
|
-
if (!fence) return void 0;
|
|
419
|
-
const block = scanFence(content, offset, fence);
|
|
420
|
-
if (!block) return void 0;
|
|
421
|
-
const { start, end, line, text } = block;
|
|
422
|
-
return { start, end, line, text };
|
|
423
|
-
}
|
|
424
|
-
function fencedBlockAt(content, offset) {
|
|
425
|
-
const pos = nextLineStart(content, offset);
|
|
426
|
-
if (!ANY_FENCE.test(lineText(content, pos, lineEnd(content, pos)))) {
|
|
427
|
-
return void 0;
|
|
428
|
-
}
|
|
429
|
-
const block = scanFence(content, pos, MARKDOWN_FENCE) ?? scanFence(content, pos, ASCIIDOC_FENCE);
|
|
430
|
-
if (!block || block.line !== lineAt(content, pos)) return void 0;
|
|
431
|
-
const { start, end, line, text } = block;
|
|
432
|
-
return { start, end, line, text };
|
|
433
|
-
}
|
|
434
|
-
function fencedBlocks(content, bodyOffset, format) {
|
|
435
|
-
const fence = fenceFor(format);
|
|
436
|
-
if (!fence) return [];
|
|
437
|
-
const out = [];
|
|
438
|
-
let pos = bodyOffset;
|
|
439
|
-
for (; ; ) {
|
|
440
|
-
const block = scanFence(content, pos, fence);
|
|
441
|
-
if (!block) return out;
|
|
442
|
-
const { start, end, line, text } = block;
|
|
443
|
-
out.push({ start, end, line, text });
|
|
444
|
-
pos = block.next;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
194
|
function writtenForm(format) {
|
|
448
195
|
const form = statementForms(format)[0];
|
|
449
196
|
if (!form) {
|
|
@@ -456,168 +203,6 @@ function formatStatement(format, payload) {
|
|
|
456
203
|
const pad = form.open.endsWith("(") ? "" : " ";
|
|
457
204
|
return `${form.open}${pad}cite ${payload.ids.join(" ")}${pad}${form.close}`;
|
|
458
205
|
}
|
|
459
|
-
function respellEdit(content, statement, ids) {
|
|
460
|
-
const text = content.slice(statement.start, statement.end);
|
|
461
|
-
const at = text.indexOf(statement.raw);
|
|
462
|
-
if (at === -1) return void 0;
|
|
463
|
-
return {
|
|
464
|
-
start: statement.start + at,
|
|
465
|
-
end: statement.start + at + statement.raw.length,
|
|
466
|
-
text: `cite ${ids.join(" ")}`
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
function respellStatement(content, statement, ids) {
|
|
470
|
-
const edit = respellEdit(content, statement, ids);
|
|
471
|
-
if (edit === void 0) return content;
|
|
472
|
-
return content.slice(0, edit.start) + edit.text + content.slice(edit.end);
|
|
473
|
-
}
|
|
474
|
-
function nextTextLine(text, offset, format) {
|
|
475
|
-
let pos = nextLineStart(text, offset);
|
|
476
|
-
while (pos < text.length) {
|
|
477
|
-
const end = lineEnd(text, pos);
|
|
478
|
-
const line = lineText(text, pos, end);
|
|
479
|
-
if (line.trim() !== "" && !isMarkerLine(line, format)) return lineAt(text, pos);
|
|
480
|
-
pos = end + 1;
|
|
481
|
-
}
|
|
482
|
-
return void 0;
|
|
483
|
-
}
|
|
484
|
-
function fenceSpanAt(text, line, format) {
|
|
485
|
-
const fence = fenceFor(format);
|
|
486
|
-
if (!fence) return void 0;
|
|
487
|
-
const block = scanFence(text, offsetOfLine(text, line), fence);
|
|
488
|
-
if (!block || block.line !== line) return void 0;
|
|
489
|
-
return { start: line, end: lineAt(text, block.end) };
|
|
490
|
-
}
|
|
491
|
-
function fenceAround(text, bodyOffset, line, format) {
|
|
492
|
-
const block = fencedBlocks(text, bodyOffset, format).find(
|
|
493
|
-
(b) => line > b.line && line <= lineAt(text, b.end)
|
|
494
|
-
);
|
|
495
|
-
return block === void 0 ? void 0 : { start: block.line, end: lineAt(text, block.end) };
|
|
496
|
-
}
|
|
497
|
-
function insideFence(text, bodyOffset, line, format) {
|
|
498
|
-
return fenceAround(text, bodyOffset, line, format) !== void 0;
|
|
499
|
-
}
|
|
500
|
-
function unitHolding(text, line, format, body) {
|
|
501
|
-
const textOf = (n) => lineText(text, offsetOfLine(text, n), lineEnd(text, offsetOfLine(text, n)));
|
|
502
|
-
const own = textOf(line);
|
|
503
|
-
if (own.trim() === "" || isMarkerLine(own, format)) return void 0;
|
|
504
|
-
const block = fencedBlocks(text, body.offset, format).find(
|
|
505
|
-
(b) => line >= b.line && line <= lineAt(text, b.end)
|
|
506
|
-
);
|
|
507
|
-
if (block !== void 0) {
|
|
508
|
-
return { start: block.line, end: lineAt(text, block.end), kind: "block" };
|
|
509
|
-
}
|
|
510
|
-
if (ANY_FENCE.test(own)) return void 0;
|
|
511
|
-
let start = line;
|
|
512
|
-
while (start - 1 >= body.line && !isBoundLine(own, format)) {
|
|
513
|
-
const above = textOf(start - 1);
|
|
514
|
-
if (above.trim() === "" || ANY_FENCE.test(above) || isMarkerLine(above, format) || isBoundLine(above, format)) {
|
|
515
|
-
break;
|
|
516
|
-
}
|
|
517
|
-
start--;
|
|
518
|
-
}
|
|
519
|
-
const paragraph = paragraphAfter(text, offsetOfLine(text, start), format);
|
|
520
|
-
if (paragraph?.line !== start) return void 0;
|
|
521
|
-
return { start, end: lineAt(text, paragraph.end), kind: "paragraph" };
|
|
522
|
-
}
|
|
523
|
-
var LIST_ITEM = /^([ \t]*)([-*+]|\d{1,9}[.)])([ \t]+|$)/;
|
|
524
|
-
var THEMATIC_BREAK = /^[ \t]*([-*_])(?:[ \t]*\1){2,}[ \t]*$/;
|
|
525
|
-
function textOfLine(text, n) {
|
|
526
|
-
const pos = offsetOfLine(text, n);
|
|
527
|
-
return lineText(text, pos, lineEnd(text, pos));
|
|
528
|
-
}
|
|
529
|
-
function indentOf(line) {
|
|
530
|
-
return /^[ \t]*/.exec(line)?.[0] ?? "";
|
|
531
|
-
}
|
|
532
|
-
function columnOf(indent) {
|
|
533
|
-
let column = 0;
|
|
534
|
-
for (const ch of indent) column = ch === " " ? column + 4 - column % 4 : column + 1;
|
|
535
|
-
return column;
|
|
536
|
-
}
|
|
537
|
-
function listItemOf(line) {
|
|
538
|
-
if (THEMATIC_BREAK.test(line)) return void 0;
|
|
539
|
-
const match = LIST_ITEM.exec(line);
|
|
540
|
-
if (match === null) return void 0;
|
|
541
|
-
const [, lead = "", bullet = "", gap = ""] = match;
|
|
542
|
-
return { lead, bullet, gap };
|
|
543
|
-
}
|
|
544
|
-
function continuesList(text, line, format, bodyLine, column) {
|
|
545
|
-
let n = line - 1;
|
|
546
|
-
while (n >= bodyLine) {
|
|
547
|
-
const above = textOfLine(text, n);
|
|
548
|
-
if (above.trim() !== "" && !isMarkerLine(above, format)) break;
|
|
549
|
-
n--;
|
|
550
|
-
}
|
|
551
|
-
if (n < bodyLine) return false;
|
|
552
|
-
if (columnOf(indentOf(textOfLine(text, n))) > column) return true;
|
|
553
|
-
for (; n >= bodyLine; n--) {
|
|
554
|
-
const above = textOfLine(text, n);
|
|
555
|
-
if (above.trim() === "" || ANY_FENCE.test(above) || isMarkerLine(above, format) || isBoundLine(above, format)) {
|
|
556
|
-
break;
|
|
557
|
-
}
|
|
558
|
-
const item = listItemOf(above);
|
|
559
|
-
if (item !== void 0 && columnOf(item.lead) === column) return true;
|
|
560
|
-
}
|
|
561
|
-
return false;
|
|
562
|
-
}
|
|
563
|
-
function markerIndent(text, line, format, bodyLine) {
|
|
564
|
-
if (format === "asciidoc") return "";
|
|
565
|
-
const own = textOfLine(text, line);
|
|
566
|
-
const indent = indentOf(own);
|
|
567
|
-
if (format !== "markdown" && format !== "mdx") return indent;
|
|
568
|
-
const item = listItemOf(own);
|
|
569
|
-
if (item === void 0 || !continuesList(text, line, format, bodyLine, columnOf(item.lead))) {
|
|
570
|
-
return indent;
|
|
571
|
-
}
|
|
572
|
-
const gap = item.gap === "" || columnOf(item.gap) > 4 ? " " : item.gap;
|
|
573
|
-
return item.lead + " ".repeat(item.bullet.length) + gap;
|
|
574
|
-
}
|
|
575
|
-
function anchoredLines(text, after, format, quote = false) {
|
|
576
|
-
if (quote) {
|
|
577
|
-
const block = fencedBlockAfter(text, after, format);
|
|
578
|
-
return block === void 0 ? void 0 : { start: block.line, end: lineAt(text, block.end) };
|
|
579
|
-
}
|
|
580
|
-
const restEnd = lineEnd(text, after);
|
|
581
|
-
if (text.slice(after, restEnd).trim() !== "") {
|
|
582
|
-
const line2 = lineAt(text, after);
|
|
583
|
-
return { start: line2, end: line2 };
|
|
584
|
-
}
|
|
585
|
-
const paragraph = paragraphAfter(text, after, format);
|
|
586
|
-
if (paragraph !== void 0) {
|
|
587
|
-
return { start: paragraph.line, end: lineAt(text, paragraph.end) };
|
|
588
|
-
}
|
|
589
|
-
const line = nextTextLine(text, after, format);
|
|
590
|
-
return line === void 0 ? void 0 : fenceSpanAt(text, line, format);
|
|
591
|
-
}
|
|
592
|
-
var LINE_INDEX_SLOTS = 4;
|
|
593
|
-
var lineIndexes = [];
|
|
594
|
-
function newlinesOf(content) {
|
|
595
|
-
const hit = lineIndexes.findIndex((entry) => entry.text === content);
|
|
596
|
-
const found = hit === -1 ? void 0 : lineIndexes[hit];
|
|
597
|
-
if (found !== void 0) return found.newlines;
|
|
598
|
-
const newlines = [];
|
|
599
|
-
for (let at = content.indexOf("\n"); at !== -1; at = content.indexOf("\n", at + 1)) newlines.push(at);
|
|
600
|
-
lineIndexes.unshift({ text: content, newlines });
|
|
601
|
-
lineIndexes.length = Math.min(lineIndexes.length, LINE_INDEX_SLOTS);
|
|
602
|
-
return newlines;
|
|
603
|
-
}
|
|
604
|
-
function lineAt(content, offset) {
|
|
605
|
-
const stop = Math.min(offset, content.length);
|
|
606
|
-
const newlines = newlinesOf(content);
|
|
607
|
-
let low = 0;
|
|
608
|
-
let high = newlines.length;
|
|
609
|
-
while (low < high) {
|
|
610
|
-
const mid = low + high >>> 1;
|
|
611
|
-
if ((newlines[mid] ?? Infinity) < stop) low = mid + 1;
|
|
612
|
-
else high = mid;
|
|
613
|
-
}
|
|
614
|
-
return low + 1;
|
|
615
|
-
}
|
|
616
|
-
function offsetOfLine(content, line) {
|
|
617
|
-
if (line <= 1) return 0;
|
|
618
|
-
const before = newlinesOf(content)[line - 2];
|
|
619
|
-
return before === void 0 ? content.length : before + 1;
|
|
620
|
-
}
|
|
621
206
|
|
|
622
207
|
// src/cite/core/page.ts
|
|
623
208
|
var MAX_MARKERS_PER_PAGE = 500;
|
|
@@ -662,6 +247,7 @@ function toCitation(entry) {
|
|
|
662
247
|
if (typeof source["commit-sha"] === "string") {
|
|
663
248
|
citation.source["commit-sha"] = source["commit-sha"];
|
|
664
249
|
}
|
|
250
|
+
if (typeof source.repo === "string") citation.source.repo = source.repo;
|
|
665
251
|
if (typeof entry.id === "string") citation.id = entry.id;
|
|
666
252
|
if (isRecord(entry.claim)) {
|
|
667
253
|
const claim = entry.claim;
|
|
@@ -966,6 +552,7 @@ export {
|
|
|
966
552
|
hashRange2 as hashRange,
|
|
967
553
|
FILE_PATTERN,
|
|
968
554
|
SRC_PATTERN,
|
|
555
|
+
REPO_PATTERN,
|
|
969
556
|
parseSrc,
|
|
970
557
|
tooWide,
|
|
971
558
|
formatSrc,
|
|
@@ -979,30 +566,7 @@ export {
|
|
|
979
566
|
ruleId,
|
|
980
567
|
isCiteRule,
|
|
981
568
|
resolveSeverity,
|
|
982
|
-
ANY_FENCE,
|
|
983
|
-
statementForms,
|
|
984
|
-
MAX_IDS_PER_MARKER,
|
|
985
|
-
isMarkerLine,
|
|
986
|
-
isTableRow,
|
|
987
|
-
isTableSeparator,
|
|
988
|
-
isBoundLine,
|
|
989
|
-
parseStatements,
|
|
990
|
-
detectEol,
|
|
991
|
-
paragraphAfter,
|
|
992
|
-
fencedBlockAfter,
|
|
993
|
-
fencedBlockAt,
|
|
994
|
-
fencedBlocks,
|
|
995
569
|
formatStatement,
|
|
996
|
-
respellEdit,
|
|
997
|
-
respellStatement,
|
|
998
|
-
fenceSpanAt,
|
|
999
|
-
fenceAround,
|
|
1000
|
-
insideFence,
|
|
1001
|
-
unitHolding,
|
|
1002
|
-
markerIndent,
|
|
1003
|
-
anchoredLines,
|
|
1004
|
-
lineAt,
|
|
1005
|
-
offsetOfLine,
|
|
1006
570
|
MAX_MARKERS_PER_PAGE,
|
|
1007
571
|
MARKER_JSON,
|
|
1008
572
|
ownedMessage,
|
|
@@ -1011,4 +575,4 @@ export {
|
|
|
1011
575
|
citationInputs,
|
|
1012
576
|
readPage
|
|
1013
577
|
};
|
|
1014
|
-
//# sourceMappingURL=chunk-
|
|
578
|
+
//# sourceMappingURL=chunk-XKZZRG3Z.js.map
|