hdoc-tools 0.29.3 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- package/hdoc-validate.js +7 -0
- package/package.json +1 -1
package/hdoc-validate.js
CHANGED
@@ -462,6 +462,13 @@ const e = require("express");
|
|
462
462
|
if (link_segments[0] === "") link_segments.shift();
|
463
463
|
const link_root = link_segments[0] === "_books" ? link_segments[1] : link_segments[0];
|
464
464
|
|
465
|
+
// Check for links with a _books path that have no specific file target
|
466
|
+
// We do need to exclude those with an extension though, for pages that link downloadable resources
|
467
|
+
if (link_segments[0] === "_books" && path.extname(links[i]) === '') {
|
468
|
+
const error_message = processErrorMessage(`Root relative page links should not include _books in the path: ${links[i]}`, markdown_paths.relativePath, markdown_content, links[i]);
|
469
|
+
errors[htmlFile.relativePath].push(error_message);
|
470
|
+
}
|
471
|
+
|
465
472
|
// Checking for internal links in other books - can't easily validate those here, returning
|
466
473
|
if (link_segments.length > 1 && link_root !== hdocbook_config.docId) {
|
467
474
|
continue;
|