hdoc-tools 0.43.0 → 0.44.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/hdoc-validate.js +5 -1
- package/package.json +1 -1
package/hdoc-validate.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const e = require("express");
|
|
2
|
+
const { error } = require("node:console");
|
|
2
3
|
|
|
3
4
|
(() => {
|
|
4
5
|
const axios = require("axios");
|
|
@@ -884,6 +885,9 @@ const e = require("express");
|
|
|
884
885
|
.get();
|
|
885
886
|
const srcs = $("img")
|
|
886
887
|
.map(function (i) {
|
|
888
|
+
if ($(this).attr("alt") === undefined || $(this).attr("alt").trim() === "") {
|
|
889
|
+
errors[file.relativePath].push(`Image tag with src [${$(this).attr("src")}] is missing alt attribute.`);
|
|
890
|
+
}
|
|
887
891
|
return $(this).attr("src");
|
|
888
892
|
})
|
|
889
893
|
.get();
|
|
@@ -1132,7 +1136,7 @@ const e = require("express");
|
|
|
1132
1136
|
for (const key in errors) {
|
|
1133
1137
|
if (Object.hasOwn(errors, key) && errors[key].length > 0) {
|
|
1134
1138
|
for (let i = 0; i < errors[key].length; i++) {
|
|
1135
|
-
console.error(`${errors[key][i]}`);
|
|
1139
|
+
console.error(`${key} - ${errors[key][i]}`);
|
|
1136
1140
|
error_count++;
|
|
1137
1141
|
}
|
|
1138
1142
|
}
|