@storm-software/markdownlint 0.18.35 → 0.18.36
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/{chunk-KF4NZASG.mjs → chunk-3ZA6O7AY.mjs} +5 -9
- package/dist/{chunk-T5XN24SU.mjs → chunk-GGMQ54WL.mjs} +20 -30
- package/dist/{chunk-UP2FAX2A.mjs → chunk-I2NU2OJP.mjs} +15 -21
- package/dist/chunk-J4SXAUTH.js +22 -0
- package/dist/{chunk-5BKT4CS5.js → chunk-JSBRDJBE.js} +1 -3
- package/dist/{chunk-T2GN3E2Q.js → chunk-LJKIR7QG.js} +20 -30
- package/dist/{chunk-A3UDIEI3.mjs → chunk-UJCSKKID.mjs} +0 -2
- package/dist/{chunk-CSEVGJXW.js → chunk-WMAPY4ND.js} +15 -17
- package/dist/{chunk-ZD5PYAVS.js → chunk-XHKGFYKR.js} +15 -21
- package/dist/{chunk-BLA57FQS.mjs → chunk-YJIN6DTZ.mjs} +15 -17
- package/dist/index.js +11 -19
- package/dist/index.mjs +10 -18
- package/dist/rules/rules/index.js +6 -6
- package/dist/rules/rules/index.mjs +5 -5
- package/dist/rules/rules/no-default-alt-text.js +3 -3
- package/dist/rules/rules/no-default-alt-text.mjs +2 -2
- package/dist/rules/rules/no-empty-alt-text.js +3 -3
- package/dist/rules/rules/no-empty-alt-text.mjs +2 -2
- package/dist/rules/rules/no-generic-link-text.js +3 -3
- package/dist/rules/rules/no-generic-link-text.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-ZPSREAWV.js +0 -26
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_no_default_alt_text
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GGMQ54WL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
require_no_empty_alt_text
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I2NU2OJP.mjs";
|
|
7
7
|
import {
|
|
8
8
|
require_no_generic_link_text
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YJIN6DTZ.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__toESM
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UJCSKKID.mjs";
|
|
13
13
|
|
|
14
14
|
// src/rules/index.ts
|
|
15
15
|
var SS01 = __toESM(require_no_default_alt_text());
|
|
16
16
|
var SS03 = __toESM(require_no_empty_alt_text());
|
|
17
17
|
var SS02 = __toESM(require_no_generic_link_text());
|
|
18
|
-
var rules = [
|
|
19
|
-
SS01,
|
|
20
|
-
SS02,
|
|
21
|
-
SS03
|
|
22
|
-
];
|
|
18
|
+
var rules = [SS01, SS02, SS03];
|
|
23
19
|
|
|
24
20
|
export {
|
|
25
21
|
rules
|
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__commonJS
|
|
3
|
-
|
|
4
|
-
} from "./chunk-A3UDIEI3.mjs";
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-UJCSKKID.mjs";
|
|
5
4
|
|
|
6
5
|
// src/rules/no-default-alt-text.ts
|
|
7
6
|
var require_no_default_alt_text = __commonJS({
|
|
8
7
|
"src/rules/no-default-alt-text.ts"(exports, module) {
|
|
9
8
|
var defaultScreenshotRegex = `(?:screen|clean) ?(?:shot|cast) \\d{4}-\\d{2}-\\d{2}[^'"\\]]*`;
|
|
10
9
|
var imageRegex = "image";
|
|
11
|
-
var combinedRegex = `(${[
|
|
12
|
-
defaultScreenshotRegex,
|
|
13
|
-
imageRegex
|
|
14
|
-
].join("|")})`;
|
|
10
|
+
var combinedRegex = `(${[defaultScreenshotRegex, imageRegex].join("|")})`;
|
|
15
11
|
var markdownAltRegex = new RegExp(`!\\[${combinedRegex}\\]\\(.*\\)`, "gid");
|
|
16
12
|
var htmlAltRegex = new RegExp(`alt=["']${combinedRegex}["']`, "gid");
|
|
17
13
|
module.exports = {
|
|
18
|
-
names: [
|
|
19
|
-
"SSW01",
|
|
20
|
-
"no-default-alt-text"
|
|
21
|
-
],
|
|
14
|
+
names: ["SSW01", "no-default-alt-text"],
|
|
22
15
|
description: "Images should have meaningful alternative text (alt text)",
|
|
23
|
-
information: new URL(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
]) {
|
|
16
|
+
information: new URL(
|
|
17
|
+
"https://github.com/github/markdownlint-github/blob/main/docs/rules/GH001-no-default-alt-text.md"
|
|
18
|
+
),
|
|
19
|
+
tags: ["accessibility", "images"],
|
|
20
|
+
function: function SS001(params, onError) {
|
|
21
|
+
const htmlTagsWithImages = params.parsers.markdownit.tokens.filter(
|
|
22
|
+
(token) => {
|
|
23
|
+
return token.type === "html_block" && token.content.includes("<img") || token.type === "inline" && token.content.includes("<img") && token.children.some((child) => child.type === "html_inline");
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
const inlineImages = params.parsers.markdownit.tokens.filter(
|
|
27
|
+
(token) => token.type === "inline" && token.children.some((child) => child.type === "image")
|
|
28
|
+
);
|
|
29
|
+
for (const token of [...htmlTagsWithImages, ...inlineImages]) {
|
|
37
30
|
const lineRange = token.map;
|
|
38
31
|
const lineNumber = token.lineNumber;
|
|
39
32
|
const lines = params.lines.slice(lineRange[0], lineRange[1]);
|
|
@@ -54,16 +47,13 @@ var require_no_default_alt_text = __commonJS({
|
|
|
54
47
|
const [startIndex] = match.indices[1];
|
|
55
48
|
onError({
|
|
56
49
|
lineNumber: lineNumber + i,
|
|
57
|
-
range: [
|
|
58
|
-
startIndex + 1,
|
|
59
|
-
altText.length
|
|
60
|
-
],
|
|
50
|
+
range: [startIndex + 1, altText.length],
|
|
61
51
|
detail: `Flagged alt: ${altText}`
|
|
62
52
|
});
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
|
-
}
|
|
56
|
+
}
|
|
67
57
|
};
|
|
68
58
|
}
|
|
69
59
|
});
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__commonJS
|
|
3
|
-
|
|
4
|
-
} from "./chunk-A3UDIEI3.mjs";
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-UJCSKKID.mjs";
|
|
5
4
|
|
|
6
5
|
// src/rules/no-empty-alt-text.ts
|
|
7
6
|
var require_no_empty_alt_text = __commonJS({
|
|
8
7
|
"src/rules/no-empty-alt-text.ts"(exports, module) {
|
|
9
8
|
module.exports = {
|
|
10
|
-
names: [
|
|
11
|
-
"SSW03",
|
|
12
|
-
"no-empty-alt-text"
|
|
13
|
-
],
|
|
9
|
+
names: ["SSW03", "no-empty-alt-text"],
|
|
14
10
|
description: "Please provide an alternative text for the image.",
|
|
15
|
-
information: new URL(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
information: new URL(
|
|
12
|
+
"https://github.com/github/markdownlint-github/blob/main/docs/rules/GH003-no-empty-alt-text.md"
|
|
13
|
+
),
|
|
14
|
+
tags: ["accessibility", "images"],
|
|
15
|
+
function: function SS003(params, onError) {
|
|
16
|
+
const htmlTagsWithImages = params.parsers.markdownit.tokens.filter(
|
|
17
|
+
(token) => {
|
|
18
|
+
return token.type === "html_block" && token.content.includes("<img") || token.type === "inline" && token.content.includes("<img") && token.children.some((child) => child.type === "html_inline");
|
|
19
|
+
}
|
|
20
|
+
);
|
|
24
21
|
const ImageRegex = new RegExp(/<img(.*?)>/, "gid");
|
|
25
22
|
const htmlEmptyAltRegex = new RegExp(/alt=['"]['"]/, "gid");
|
|
26
23
|
for (const token of htmlTagsWithImages) {
|
|
@@ -39,16 +36,13 @@ var require_no_empty_alt_text = __commonJS({
|
|
|
39
36
|
const startIndex = emptyAltMatches.indices[0][0];
|
|
40
37
|
onError({
|
|
41
38
|
lineNumber: lineNumber + i,
|
|
42
|
-
range: [
|
|
43
|
-
imageTagIndex + startIndex + 1,
|
|
44
|
-
matchingContent.length
|
|
45
|
-
]
|
|
39
|
+
range: [imageTagIndex + startIndex + 1, matchingContent.length]
|
|
46
40
|
});
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
|
-
}
|
|
45
|
+
}
|
|
52
46
|
};
|
|
53
47
|
}
|
|
54
48
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkLJKIR7QGjs = require('./chunk-LJKIR7QG.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkXHKGFYKRjs = require('./chunk-XHKGFYKR.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkWMAPY4NDjs = require('./chunk-WMAPY4ND.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkJSBRDJBEjs = require('./chunk-JSBRDJBE.js');
|
|
13
|
+
|
|
14
|
+
// src/rules/index.ts
|
|
15
|
+
var SS01 = _chunkJSBRDJBEjs.__toESM.call(void 0, _chunkLJKIR7QGjs.require_no_default_alt_text.call(void 0, ));
|
|
16
|
+
var SS03 = _chunkJSBRDJBEjs.__toESM.call(void 0, _chunkXHKGFYKRjs.require_no_empty_alt_text.call(void 0, ));
|
|
17
|
+
var SS02 = _chunkJSBRDJBEjs.__toESM.call(void 0, _chunkWMAPY4NDjs.require_no_generic_link_text.call(void 0, ));
|
|
18
|
+
var rules = [SS01, SS02, SS03];
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.rules = rules;
|
|
@@ -4,7 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
9
|
};
|
|
@@ -28,5 +27,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
exports.__name = __name; exports.__commonJS = __commonJS; exports.__toESM = __toESM;
|
|
30
|
+
exports.__commonJS = __commonJS; exports.__toESM = __toESM;
|
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var _chunk5BKT4CS5js = require('./chunk-5BKT4CS5.js');
|
|
3
|
+
var _chunkJSBRDJBEjs = require('./chunk-JSBRDJBE.js');
|
|
5
4
|
|
|
6
5
|
// src/rules/no-default-alt-text.ts
|
|
7
|
-
var require_no_default_alt_text =
|
|
6
|
+
var require_no_default_alt_text = _chunkJSBRDJBEjs.__commonJS.call(void 0, {
|
|
8
7
|
"src/rules/no-default-alt-text.ts"(exports, module) {
|
|
9
8
|
var defaultScreenshotRegex = `(?:screen|clean) ?(?:shot|cast) \\d{4}-\\d{2}-\\d{2}[^'"\\]]*`;
|
|
10
9
|
var imageRegex = "image";
|
|
11
|
-
var combinedRegex = `(${[
|
|
12
|
-
defaultScreenshotRegex,
|
|
13
|
-
imageRegex
|
|
14
|
-
].join("|")})`;
|
|
10
|
+
var combinedRegex = `(${[defaultScreenshotRegex, imageRegex].join("|")})`;
|
|
15
11
|
var markdownAltRegex = new RegExp(`!\\[${combinedRegex}\\]\\(.*\\)`, "gid");
|
|
16
12
|
var htmlAltRegex = new RegExp(`alt=["']${combinedRegex}["']`, "gid");
|
|
17
13
|
module.exports = {
|
|
18
|
-
names: [
|
|
19
|
-
"SSW01",
|
|
20
|
-
"no-default-alt-text"
|
|
21
|
-
],
|
|
14
|
+
names: ["SSW01", "no-default-alt-text"],
|
|
22
15
|
description: "Images should have meaningful alternative text (alt text)",
|
|
23
|
-
information: new URL(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
]) {
|
|
16
|
+
information: new URL(
|
|
17
|
+
"https://github.com/github/markdownlint-github/blob/main/docs/rules/GH001-no-default-alt-text.md"
|
|
18
|
+
),
|
|
19
|
+
tags: ["accessibility", "images"],
|
|
20
|
+
function: function SS001(params, onError) {
|
|
21
|
+
const htmlTagsWithImages = params.parsers.markdownit.tokens.filter(
|
|
22
|
+
(token) => {
|
|
23
|
+
return token.type === "html_block" && token.content.includes("<img") || token.type === "inline" && token.content.includes("<img") && token.children.some((child) => child.type === "html_inline");
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
const inlineImages = params.parsers.markdownit.tokens.filter(
|
|
27
|
+
(token) => token.type === "inline" && token.children.some((child) => child.type === "image")
|
|
28
|
+
);
|
|
29
|
+
for (const token of [...htmlTagsWithImages, ...inlineImages]) {
|
|
37
30
|
const lineRange = token.map;
|
|
38
31
|
const lineNumber = token.lineNumber;
|
|
39
32
|
const lines = params.lines.slice(lineRange[0], lineRange[1]);
|
|
@@ -54,16 +47,13 @@ var require_no_default_alt_text = _chunk5BKT4CS5js.__commonJS.call(void 0, {
|
|
|
54
47
|
const [startIndex] = match.indices[1];
|
|
55
48
|
onError({
|
|
56
49
|
lineNumber: lineNumber + i,
|
|
57
|
-
range: [
|
|
58
|
-
startIndex + 1,
|
|
59
|
-
altText.length
|
|
60
|
-
],
|
|
50
|
+
range: [startIndex + 1, altText.length],
|
|
61
51
|
detail: `Flagged alt: ${altText}`
|
|
62
52
|
});
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
55
|
}
|
|
66
|
-
}
|
|
56
|
+
}
|
|
67
57
|
};
|
|
68
58
|
}
|
|
69
59
|
});
|
|
@@ -4,7 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
9
|
};
|
|
@@ -26,7 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
25
|
));
|
|
27
26
|
|
|
28
27
|
export {
|
|
29
|
-
__name,
|
|
30
28
|
__commonJS,
|
|
31
29
|
__toESM
|
|
32
30
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var _chunk5BKT4CS5js = require('./chunk-5BKT4CS5.js');
|
|
3
|
+
var _chunkJSBRDJBEjs = require('./chunk-JSBRDJBE.js');
|
|
5
4
|
|
|
6
5
|
// src/rules/no-generic-link-text.ts
|
|
7
|
-
var require_no_generic_link_text =
|
|
6
|
+
var require_no_generic_link_text = _chunkJSBRDJBEjs.__commonJS.call(void 0, {
|
|
8
7
|
"src/rules/no-generic-link-text.ts"(exports, module) {
|
|
9
8
|
function stripAndDowncaseText(text) {
|
|
10
9
|
return text.toLowerCase().replace(/[.,/#!$%^&*;:{}=\-_`~()]/g, "").replace(/\s+/g, " ").trim();
|
|
11
10
|
}
|
|
12
|
-
_chunk5BKT4CS5js.__name.call(void 0, stripAndDowncaseText, "stripAndDowncaseText");
|
|
13
11
|
var bannedLinkText = [
|
|
14
12
|
"read more",
|
|
15
13
|
"learn more",
|
|
@@ -19,21 +17,21 @@ var require_no_generic_link_text = _chunk5BKT4CS5js.__commonJS.call(void 0, {
|
|
|
19
17
|
"link"
|
|
20
18
|
];
|
|
21
19
|
module.exports = {
|
|
22
|
-
names: [
|
|
23
|
-
"SSW02",
|
|
24
|
-
"no-generic-link-text"
|
|
25
|
-
],
|
|
20
|
+
names: ["SSW02", "no-generic-link-text"],
|
|
26
21
|
description: "Avoid using generic link text like `Learn more` or `Click here`",
|
|
27
|
-
information: new URL(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
information: new URL(
|
|
23
|
+
"https://github.com/github/markdownlint-github/blob/main/docs/rules/GH002-no-generic-link-text.md"
|
|
24
|
+
),
|
|
25
|
+
tags: ["accessibility", "links"],
|
|
26
|
+
function: function SS002(params, onError) {
|
|
27
|
+
let bannedLinkTexts = bannedLinkText.concat(
|
|
28
|
+
params.config.additional_banned_texts || []
|
|
29
|
+
);
|
|
34
30
|
const exceptions = params.config.exceptions || [];
|
|
35
31
|
if (exceptions.length > 0) {
|
|
36
|
-
bannedLinkTexts = bannedLinkTexts.filter(
|
|
32
|
+
bannedLinkTexts = bannedLinkTexts.filter(
|
|
33
|
+
(text) => !exceptions.includes(text)
|
|
34
|
+
);
|
|
37
35
|
}
|
|
38
36
|
const inlineTokens = params.tokens.filter((t) => t.type === "inline");
|
|
39
37
|
for (const token of inlineTokens) {
|
|
@@ -58,7 +56,7 @@ var require_no_generic_link_text = _chunk5BKT4CS5js.__commonJS.call(void 0, {
|
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
|
-
}
|
|
59
|
+
}
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
62
|
});
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var _chunk5BKT4CS5js = require('./chunk-5BKT4CS5.js');
|
|
3
|
+
var _chunkJSBRDJBEjs = require('./chunk-JSBRDJBE.js');
|
|
5
4
|
|
|
6
5
|
// src/rules/no-empty-alt-text.ts
|
|
7
|
-
var require_no_empty_alt_text =
|
|
6
|
+
var require_no_empty_alt_text = _chunkJSBRDJBEjs.__commonJS.call(void 0, {
|
|
8
7
|
"src/rules/no-empty-alt-text.ts"(exports, module) {
|
|
9
8
|
module.exports = {
|
|
10
|
-
names: [
|
|
11
|
-
"SSW03",
|
|
12
|
-
"no-empty-alt-text"
|
|
13
|
-
],
|
|
9
|
+
names: ["SSW03", "no-empty-alt-text"],
|
|
14
10
|
description: "Please provide an alternative text for the image.",
|
|
15
|
-
information: new URL(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
information: new URL(
|
|
12
|
+
"https://github.com/github/markdownlint-github/blob/main/docs/rules/GH003-no-empty-alt-text.md"
|
|
13
|
+
),
|
|
14
|
+
tags: ["accessibility", "images"],
|
|
15
|
+
function: function SS003(params, onError) {
|
|
16
|
+
const htmlTagsWithImages = params.parsers.markdownit.tokens.filter(
|
|
17
|
+
(token) => {
|
|
18
|
+
return token.type === "html_block" && token.content.includes("<img") || token.type === "inline" && token.content.includes("<img") && token.children.some((child) => child.type === "html_inline");
|
|
19
|
+
}
|
|
20
|
+
);
|
|
24
21
|
const ImageRegex = new RegExp(/<img(.*?)>/, "gid");
|
|
25
22
|
const htmlEmptyAltRegex = new RegExp(/alt=['"]['"]/, "gid");
|
|
26
23
|
for (const token of htmlTagsWithImages) {
|
|
@@ -39,16 +36,13 @@ var require_no_empty_alt_text = _chunk5BKT4CS5js.__commonJS.call(void 0, {
|
|
|
39
36
|
const startIndex = emptyAltMatches.indices[0][0];
|
|
40
37
|
onError({
|
|
41
38
|
lineNumber: lineNumber + i,
|
|
42
|
-
range: [
|
|
43
|
-
imageTagIndex + startIndex + 1,
|
|
44
|
-
matchingContent.length
|
|
45
|
-
]
|
|
39
|
+
range: [imageTagIndex + startIndex + 1, matchingContent.length]
|
|
46
40
|
});
|
|
47
41
|
}
|
|
48
42
|
}
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
|
-
}
|
|
45
|
+
}
|
|
52
46
|
};
|
|
53
47
|
}
|
|
54
48
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__commonJS
|
|
3
|
-
|
|
4
|
-
} from "./chunk-A3UDIEI3.mjs";
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-UJCSKKID.mjs";
|
|
5
4
|
|
|
6
5
|
// src/rules/no-generic-link-text.ts
|
|
7
6
|
var require_no_generic_link_text = __commonJS({
|
|
@@ -9,7 +8,6 @@ var require_no_generic_link_text = __commonJS({
|
|
|
9
8
|
function stripAndDowncaseText(text) {
|
|
10
9
|
return text.toLowerCase().replace(/[.,/#!$%^&*;:{}=\-_`~()]/g, "").replace(/\s+/g, " ").trim();
|
|
11
10
|
}
|
|
12
|
-
__name(stripAndDowncaseText, "stripAndDowncaseText");
|
|
13
11
|
var bannedLinkText = [
|
|
14
12
|
"read more",
|
|
15
13
|
"learn more",
|
|
@@ -19,21 +17,21 @@ var require_no_generic_link_text = __commonJS({
|
|
|
19
17
|
"link"
|
|
20
18
|
];
|
|
21
19
|
module.exports = {
|
|
22
|
-
names: [
|
|
23
|
-
"SSW02",
|
|
24
|
-
"no-generic-link-text"
|
|
25
|
-
],
|
|
20
|
+
names: ["SSW02", "no-generic-link-text"],
|
|
26
21
|
description: "Avoid using generic link text like `Learn more` or `Click here`",
|
|
27
|
-
information: new URL(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
information: new URL(
|
|
23
|
+
"https://github.com/github/markdownlint-github/blob/main/docs/rules/GH002-no-generic-link-text.md"
|
|
24
|
+
),
|
|
25
|
+
tags: ["accessibility", "links"],
|
|
26
|
+
function: function SS002(params, onError) {
|
|
27
|
+
let bannedLinkTexts = bannedLinkText.concat(
|
|
28
|
+
params.config.additional_banned_texts || []
|
|
29
|
+
);
|
|
34
30
|
const exceptions = params.config.exceptions || [];
|
|
35
31
|
if (exceptions.length > 0) {
|
|
36
|
-
bannedLinkTexts = bannedLinkTexts.filter(
|
|
32
|
+
bannedLinkTexts = bannedLinkTexts.filter(
|
|
33
|
+
(text) => !exceptions.includes(text)
|
|
34
|
+
);
|
|
37
35
|
}
|
|
38
36
|
const inlineTokens = params.tokens.filter((t) => t.type === "inline");
|
|
39
37
|
for (const token of inlineTokens) {
|
|
@@ -58,7 +56,7 @@ var require_no_generic_link_text = __commonJS({
|
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
|
-
}
|
|
59
|
+
}
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
62
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunk5BKT4CS5js = require('./chunk-5BKT4CS5.js');
|
|
3
|
+
var _chunkJ4SXAUTHjs = require('./chunk-J4SXAUTH.js');
|
|
4
|
+
require('./chunk-LJKIR7QG.js');
|
|
5
|
+
require('./chunk-XHKGFYKR.js');
|
|
6
|
+
require('./chunk-WMAPY4ND.js');
|
|
7
|
+
require('./chunk-JSBRDJBE.js');
|
|
10
8
|
|
|
11
9
|
// src/index.ts
|
|
12
10
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
@@ -102,9 +100,7 @@ var markdownlintConfig = {
|
|
|
102
100
|
shortcut_syntax: false
|
|
103
101
|
},
|
|
104
102
|
"link-image-reference-definitions": {
|
|
105
|
-
ignored_definitions: [
|
|
106
|
-
"//"
|
|
107
|
-
]
|
|
103
|
+
ignored_definitions: ["//"]
|
|
108
104
|
},
|
|
109
105
|
"link-image-style": {
|
|
110
106
|
autolink: true,
|
|
@@ -126,21 +122,17 @@ var markdownlintConfig = {
|
|
|
126
122
|
|
|
127
123
|
// src/index.ts
|
|
128
124
|
var offByDefault = [];
|
|
129
|
-
var baseConfig = {
|
|
130
|
-
|
|
131
|
-
};
|
|
132
|
-
for (const rule of _chunkZPSREAWVjs.rules) {
|
|
125
|
+
var baseConfig = { ...markdownlintConfig };
|
|
126
|
+
for (const rule of _chunkJ4SXAUTHjs.rules) {
|
|
133
127
|
const ruleName = _optionalChain([rule, 'optionalAccess', _ => _.names, 'access', _2 => _2[1]]);
|
|
134
128
|
if (ruleName) {
|
|
135
129
|
baseConfig[ruleName] = offByDefault.includes(ruleName) ? false : true;
|
|
136
130
|
}
|
|
137
131
|
}
|
|
138
|
-
var init =
|
|
132
|
+
var init = function init2(defaultConfig) {
|
|
139
133
|
return _defu2.default.call(void 0, defaultConfig, baseConfig);
|
|
140
|
-
}
|
|
141
|
-
var rules2 = [
|
|
142
|
-
..._chunkZPSREAWVjs.rules
|
|
143
|
-
];
|
|
134
|
+
};
|
|
135
|
+
var rules2 = [..._chunkJ4SXAUTHjs.rules];
|
|
144
136
|
var config = baseConfig;
|
|
145
137
|
var index_default = config;
|
|
146
138
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rules
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import
|
|
8
|
-
__name
|
|
9
|
-
} from "./chunk-A3UDIEI3.mjs";
|
|
3
|
+
} from "./chunk-3ZA6O7AY.mjs";
|
|
4
|
+
import "./chunk-GGMQ54WL.mjs";
|
|
5
|
+
import "./chunk-I2NU2OJP.mjs";
|
|
6
|
+
import "./chunk-YJIN6DTZ.mjs";
|
|
7
|
+
import "./chunk-UJCSKKID.mjs";
|
|
10
8
|
|
|
11
9
|
// src/index.ts
|
|
12
10
|
import defu from "defu";
|
|
@@ -102,9 +100,7 @@ var markdownlintConfig = {
|
|
|
102
100
|
shortcut_syntax: false
|
|
103
101
|
},
|
|
104
102
|
"link-image-reference-definitions": {
|
|
105
|
-
ignored_definitions: [
|
|
106
|
-
"//"
|
|
107
|
-
]
|
|
103
|
+
ignored_definitions: ["//"]
|
|
108
104
|
},
|
|
109
105
|
"link-image-style": {
|
|
110
106
|
autolink: true,
|
|
@@ -126,21 +122,17 @@ var markdownlintConfig = {
|
|
|
126
122
|
|
|
127
123
|
// src/index.ts
|
|
128
124
|
var offByDefault = [];
|
|
129
|
-
var baseConfig = {
|
|
130
|
-
...markdownlintConfig
|
|
131
|
-
};
|
|
125
|
+
var baseConfig = { ...markdownlintConfig };
|
|
132
126
|
for (const rule of rules) {
|
|
133
127
|
const ruleName = rule?.names[1];
|
|
134
128
|
if (ruleName) {
|
|
135
129
|
baseConfig[ruleName] = offByDefault.includes(ruleName) ? false : true;
|
|
136
130
|
}
|
|
137
131
|
}
|
|
138
|
-
var init =
|
|
132
|
+
var init = function init2(defaultConfig) {
|
|
139
133
|
return defu(defaultConfig, baseConfig);
|
|
140
|
-
}
|
|
141
|
-
var rules2 = [
|
|
142
|
-
...rules
|
|
143
|
-
];
|
|
134
|
+
};
|
|
135
|
+
var rules2 = [...rules];
|
|
144
136
|
var config = baseConfig;
|
|
145
137
|
var index_default = config;
|
|
146
138
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
3
|
+
var _chunkJ4SXAUTHjs = require('../chunk-J4SXAUTH.js');
|
|
4
|
+
require('../chunk-LJKIR7QG.js');
|
|
5
|
+
require('../chunk-XHKGFYKR.js');
|
|
6
|
+
require('../chunk-WMAPY4ND.js');
|
|
7
|
+
require('../chunk-JSBRDJBE.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.rules =
|
|
10
|
+
exports.rules = _chunkJ4SXAUTHjs.rules;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rules
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-3ZA6O7AY.mjs";
|
|
4
|
+
import "../chunk-GGMQ54WL.mjs";
|
|
5
|
+
import "../chunk-I2NU2OJP.mjs";
|
|
6
|
+
import "../chunk-YJIN6DTZ.mjs";
|
|
7
|
+
import "../chunk-UJCSKKID.mjs";
|
|
8
8
|
export {
|
|
9
9
|
rules
|
|
10
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
exports. default =
|
|
3
|
+
var _chunkLJKIR7QGjs = require('../chunk-LJKIR7QG.js');
|
|
4
|
+
require('../chunk-JSBRDJBE.js');
|
|
5
|
+
exports. default = _chunkLJKIR7QGjs.require_no_default_alt_text.call(void 0, );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
exports. default =
|
|
3
|
+
var _chunkXHKGFYKRjs = require('../chunk-XHKGFYKR.js');
|
|
4
|
+
require('../chunk-JSBRDJBE.js');
|
|
5
|
+
exports. default = _chunkXHKGFYKRjs.require_no_empty_alt_text.call(void 0, );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
exports. default =
|
|
3
|
+
var _chunkWMAPY4NDjs = require('../chunk-WMAPY4ND.js');
|
|
4
|
+
require('../chunk-JSBRDJBE.js');
|
|
5
|
+
exports. default = _chunkWMAPY4NDjs.require_no_generic_link_text.call(void 0, );
|
package/package.json
CHANGED
package/dist/chunk-ZPSREAWV.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkT2GN3E2Qjs = require('./chunk-T2GN3E2Q.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkZD5PYAVSjs = require('./chunk-ZD5PYAVS.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkCSEVGJXWjs = require('./chunk-CSEVGJXW.js');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunk5BKT4CS5js = require('./chunk-5BKT4CS5.js');
|
|
13
|
-
|
|
14
|
-
// src/rules/index.ts
|
|
15
|
-
var SS01 = _chunk5BKT4CS5js.__toESM.call(void 0, _chunkT2GN3E2Qjs.require_no_default_alt_text.call(void 0, ));
|
|
16
|
-
var SS03 = _chunk5BKT4CS5js.__toESM.call(void 0, _chunkZD5PYAVSjs.require_no_empty_alt_text.call(void 0, ));
|
|
17
|
-
var SS02 = _chunk5BKT4CS5js.__toESM.call(void 0, _chunkCSEVGJXWjs.require_no_generic_link_text.call(void 0, ));
|
|
18
|
-
var rules = [
|
|
19
|
-
SS01,
|
|
20
|
-
SS02,
|
|
21
|
-
SS03
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
exports.rules = rules;
|