@diplodoc/yfmlint 1.2.5 → 1.2.7
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/build/config.d.ts +1 -0
- package/build/index.js +35 -2
- package/build/index.js.map +4 -4
- package/build/rules/index.d.ts +1 -0
- package/build/rules/yfm010.d.ts +2 -0
- package/package.json +1 -1
package/build/config.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -21440,8 +21440,10 @@ var config_default = {
|
|
|
21440
21440
|
// Term used without definition
|
|
21441
21441
|
YFM008: "warn" /* WARN */,
|
|
21442
21442
|
// Term inside definition not allowed
|
|
21443
|
-
YFM009: "warn" /* WARN
|
|
21443
|
+
YFM009: "warn" /* WARN */,
|
|
21444
21444
|
// Term definition used not at the end of file
|
|
21445
|
+
YFM010: "error" /* ERROR */
|
|
21446
|
+
// Autotitle anchor is missed
|
|
21445
21447
|
};
|
|
21446
21448
|
|
|
21447
21449
|
// src/rules/index.ts
|
|
@@ -21455,7 +21457,8 @@ __export(rules_exports, {
|
|
|
21455
21457
|
yfm006: () => yfm006,
|
|
21456
21458
|
yfm007: () => yfm007,
|
|
21457
21459
|
yfm008: () => yfm008,
|
|
21458
|
-
yfm009: () => yfm009
|
|
21460
|
+
yfm009: () => yfm009,
|
|
21461
|
+
yfm010: () => yfm010
|
|
21459
21462
|
});
|
|
21460
21463
|
|
|
21461
21464
|
// src/rules/yfm001.ts
|
|
@@ -21780,6 +21783,36 @@ var yfm009 = {
|
|
|
21780
21783
|
}
|
|
21781
21784
|
};
|
|
21782
21785
|
|
|
21786
|
+
// src/rules/yfm010.ts
|
|
21787
|
+
var yfm010 = {
|
|
21788
|
+
names: ["YFM010", "unreachable-autotitle-anchor"],
|
|
21789
|
+
description: "Auto title anchor is unreachable",
|
|
21790
|
+
tags: ["titles"],
|
|
21791
|
+
parser: "markdownit",
|
|
21792
|
+
function: function YFM010(params2, onError) {
|
|
21793
|
+
const { config } = params2;
|
|
21794
|
+
if (!config) {
|
|
21795
|
+
return;
|
|
21796
|
+
}
|
|
21797
|
+
params2.parsers.markdownit.tokens.filter((token) => {
|
|
21798
|
+
return token.type === "inline";
|
|
21799
|
+
}).forEach((inline) => {
|
|
21800
|
+
var _a;
|
|
21801
|
+
(_a = inline.children) == null ? void 0 : _a.filter((child) => {
|
|
21802
|
+
return child.type === "link_open";
|
|
21803
|
+
}).forEach((link) => {
|
|
21804
|
+
if (link.attrGet("YFM010")) {
|
|
21805
|
+
const autotitleAnchorError = `[Unreachable autotitle anchor: "${link.attrGet("href")}"]`;
|
|
21806
|
+
onError({
|
|
21807
|
+
lineNumber: link.lineNumber,
|
|
21808
|
+
context: autotitleAnchorError + link.line
|
|
21809
|
+
});
|
|
21810
|
+
}
|
|
21811
|
+
});
|
|
21812
|
+
});
|
|
21813
|
+
}
|
|
21814
|
+
};
|
|
21815
|
+
|
|
21783
21816
|
// src/index.ts
|
|
21784
21817
|
async function yfmlint(content3, path3, opts) {
|
|
21785
21818
|
const { lint } = await Promise.resolve().then(() => (init_exports_promise(), exports_promise_exports));
|