hdoc-tools 0.29.2 → 0.30.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 +8 -1
  2. 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;
@@ -498,7 +505,7 @@ const e = require("express");
498
505
  }
499
506
 
500
507
  // Skip internal.hornbill.com link validation if run outside of the Hornbill network
501
- if (links[i].toLowerCase().includes(".internal.hornbill.com")) {
508
+ if (links[i].toLowerCase().includes("internal.hornbill.com")) {
502
509
  // DNS lookup internal docs endpoint
503
510
  const hostname = 'docs-internal.hornbill.com';
504
511
  let on_int_net = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.29.2",
3
+ "version": "0.30.0",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {