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.
Files changed (2) hide show
  1. package/hdoc-validate.js +4 -5
  2. 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 link_root = links[i].split("/");
462
- if (link_root[0] === "") link_root.shift();
463
- link_root = link_root[0] === "_books" ? link_root[1] : link_root[0];
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {