hdoc-tools 0.42.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 +11 -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();
|
|
@@ -977,6 +981,12 @@ const e = require("express");
|
|
|
977
981
|
Array.isArray(hdocbook_project.validation.exclude_spellcheck)
|
|
978
982
|
) {
|
|
979
983
|
for (const excl_sc of hdocbook_project.validation.exclude_spellcheck) {
|
|
984
|
+
|
|
985
|
+
if (exclude_spellcheck[excl_sc.document_path] !== undefined) {
|
|
986
|
+
meta_errors.push(
|
|
987
|
+
"Document path is duplicated in exclude_spellcheck validation array: " + excl_sc.document_path,
|
|
988
|
+
);
|
|
989
|
+
}
|
|
980
990
|
exclude_spellcheck[excl_sc.document_path] = excl_sc.words;
|
|
981
991
|
}
|
|
982
992
|
}
|
|
@@ -1126,7 +1136,7 @@ const e = require("express");
|
|
|
1126
1136
|
for (const key in errors) {
|
|
1127
1137
|
if (Object.hasOwn(errors, key) && errors[key].length > 0) {
|
|
1128
1138
|
for (let i = 0; i < errors[key].length; i++) {
|
|
1129
|
-
console.error(`${errors[key][i]}`);
|
|
1139
|
+
console.error(`${key} - ${errors[key][i]}`);
|
|
1130
1140
|
error_count++;
|
|
1131
1141
|
}
|
|
1132
1142
|
}
|