hdoc-tools 0.28.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- package/hdoc-validate.js +4 -5
- package/package.json +1 -1
package/hdoc-validate.js
CHANGED
@@ -458,15 +458,14 @@ const e = require("express");
|
|
458
458
|
if (!valid_url) {
|
459
459
|
// Could be a relative path, check
|
460
460
|
if (links[i].startsWith("/") && !links[i].startsWith("/#")) {
|
461
|
-
let
|
462
|
-
if (
|
463
|
-
link_root =
|
461
|
+
let link_segments = links[i].split("/");
|
462
|
+
if (link_segments[0] === "") link_segments.shift();
|
463
|
+
const link_root = link_segments[0] === "_books" ? link_segments[1] : link_segments[0];
|
464
464
|
|
465
465
|
// Checking for internal links in other books - can't easily validate those here, returning
|
466
|
-
if (link_root !== hdocbook_config.docId) {
|
466
|
+
if (link_segments.length > 1 && link_root !== hdocbook_config.docId) {
|
467
467
|
continue;
|
468
468
|
}
|
469
|
-
|
470
469
|
isRelativePath(source_path, htmlFile, links[i]);
|
471
470
|
} else if (links[i].startsWith("#") || links[i].startsWith("/#")) {
|
472
471
|
//Flat Anchor - validate we have a same-file hit
|