@diplodoc/yfmlint 1.2.4 → 1.2.6

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 CHANGED
@@ -65,3 +65,11 @@ Tags: tab
65
65
  Aliases: tab-list-not-closed
66
66
 
67
67
  This rule is triggered when tab list don't have close token.
68
+
69
+ ### YFM006 - Tab list not closed
70
+
71
+ Tags: term
72
+
73
+ Aliases: term-definition-duplicated
74
+
75
+ This rule is triggered when term definition duplicated.
package/build/config.d.ts CHANGED
@@ -13,5 +13,6 @@ declare const _default: {
13
13
  YFM007: LogLevels;
14
14
  YFM008: LogLevels;
15
15
  YFM009: LogLevels;
16
+ YFM010: LogLevels;
16
17
  };
17
18
  export default _default;
package/build/index.js CHANGED
@@ -21428,7 +21428,7 @@ var config_default = {
21428
21428
  },
21429
21429
  YFM002: "warn" /* WARN */,
21430
21430
  // No header found in the file for the link text
21431
- YFM003: "warn" /* WARN */,
21431
+ YFM003: "error" /* ERROR */,
21432
21432
  // Link is unreachable
21433
21433
  YFM004: "error" /* ERROR */,
21434
21434
  // Table not closed
@@ -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));