@diplodoc/yfmlint 1.2.8 → 1.3.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/build/config.d.ts CHANGED
@@ -14,5 +14,6 @@ declare const _default: {
14
14
  YFM008: LogLevels;
15
15
  YFM009: LogLevels;
16
16
  YFM010: LogLevels;
17
+ YFM011: LogLevels;
17
18
  };
18
19
  export default _default;
package/build/index.js CHANGED
@@ -21442,8 +21442,10 @@ var config_default = {
21442
21442
  // Term inside definition not allowed
21443
21443
  YFM009: "warn" /* WARN */,
21444
21444
  // Term definition used not at the end of file
21445
- YFM010: "warn" /* WARN */
21445
+ YFM010: "warn" /* WARN */,
21446
21446
  // Autotitle anchor is missed
21447
+ YFM011: "warn" /* WARN */
21448
+ // Max svg size
21447
21449
  };
21448
21450
 
21449
21451
  // src/rules/index.ts
@@ -21458,7 +21460,8 @@ __export(rules_exports, {
21458
21460
  yfm007: () => yfm007,
21459
21461
  yfm008: () => yfm008,
21460
21462
  yfm009: () => yfm009,
21461
- yfm010: () => yfm010
21463
+ yfm010: () => yfm010,
21464
+ yfm011: () => yfm011
21462
21465
  });
21463
21466
 
21464
21467
  // src/rules/yfm001.ts
@@ -21813,6 +21816,36 @@ var yfm010 = {
21813
21816
  }
21814
21817
  };
21815
21818
 
21819
+ // src/rules/yfm011.ts
21820
+ var yfm011 = {
21821
+ names: ["YFM011", "max-svg-size"],
21822
+ description: "Max svg size",
21823
+ tags: ["image_svg"],
21824
+ parser: "markdownit",
21825
+ function: function YFM011(params2, onError) {
21826
+ const { config } = params2;
21827
+ if (!config) {
21828
+ return;
21829
+ }
21830
+ params2.parsers.markdownit.tokens.filter((token) => {
21831
+ return token.type === "inline";
21832
+ }).forEach((inline) => {
21833
+ var _a;
21834
+ (_a = inline.children) == null ? void 0 : _a.filter((child) => {
21835
+ return child.type === "image";
21836
+ }).forEach((link) => {
21837
+ if (link.attrGet("YFM011")) {
21838
+ const svgSizeError = link.attrGet("YFM011");
21839
+ onError({
21840
+ lineNumber: link.lineNumber,
21841
+ context: svgSizeError + " " + link.line
21842
+ });
21843
+ }
21844
+ });
21845
+ });
21846
+ }
21847
+ };
21848
+
21816
21849
  // src/index.ts
21817
21850
  async function yfmlint(content3, path3, opts) {
21818
21851
  const { lint } = await Promise.resolve().then(() => (init_exports_promise(), exports_promise_exports));