hdoc-tools 0.33.2 → 0.33.3

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-serve.js CHANGED
@@ -351,7 +351,6 @@
351
351
 
352
352
  // Catch all
353
353
  app.get("/*", (req, res) => {
354
- const segs = req.url.split("/");
355
354
 
356
355
  const ui_file_path = path.join(ui_path, req.url);
357
356
 
package/hdoc-validate.js CHANGED
@@ -449,7 +449,7 @@ const e = require("express");
449
449
  return returnPaths;
450
450
  }
451
451
 
452
- const checkLinks = async (source_path, htmlFile, links, hdocbook_config) => {
452
+ const checkLinks = async (source_path, htmlFile, links, hdocbook_config, hdocbook_project) => {
453
453
  const markdown_paths = getMDPathFromHtmlPath(htmlFile);
454
454
  const markdown_content = fs.readFileSync(markdown_paths.markdownPath, 'utf8');
455
455
 
@@ -577,7 +577,11 @@ const e = require("express");
577
577
  } else {
578
578
  error_message = processErrorMessage(`Issue with external link [${links[i]}]: ${e}`, markdown_paths.relativePath, markdown_content, links[i]);
579
579
  }
580
- errors[htmlFile.relativePath].push(error_message);
580
+ if (hdocbook_project.validation.external_link_warnings)
581
+ warnings[htmlFile.relativePath].push(error_message);
582
+ else
583
+ errors[htmlFile.relativePath].push(error_message);
584
+
581
585
  }
582
586
  }
583
587
  }
@@ -998,7 +1002,7 @@ const e = require("express");
998
1002
  if (links.href.length === 0) {
999
1003
  messages[file.relativePath].push("No links found in file");
1000
1004
  } else {
1001
- await checkLinks(source_path, file, links.href, hdocbook_config);
1005
+ await checkLinks(source_path, file, links.href, hdocbook_config, hdocbook_project);
1002
1006
  }
1003
1007
  if (links.img.length === 0) {
1004
1008
  messages[file.relativePath].push("No images found in file");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.33.2",
3
+ "version": "0.33.3",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {
@@ -258,6 +258,8 @@ function loadContentUrl(
258
258
  fromPopState,
259
259
  fromBook = true,
260
260
  ) {
261
+
262
+
261
263
  //-- clear table of contents
262
264
  view.docApp.tableOfContents = [];
263
265
  let clean_linkRef = linkRef;
@@ -686,17 +688,16 @@ async function intialiseApp() {
686
688
  `${window.location.origin}/`,
687
689
  "",
688
690
  );
689
- initialLoadContentHref = findFirstClickableBookLink(
691
+ const newInitialLoadContentHref = findFirstClickableBookLink(
690
692
  initialLoadContentHref,
691
693
  );
692
-
694
+ if (newInitialLoadContentHref !== undefined) initialLoadContentHref = newInitialLoadContentHref;
693
695
  if (initialLoadContentHref) {
694
696
  //-- find the link we are going to show and make sure parent/s are set to .expand=true
695
697
  loadContentUrl(initialLoadContentHref, true, false);
696
698
  } else {
697
699
  hslDocLog.log("initial first view link to load is not present");
698
700
  }
699
-
700
701
  $(".hb-hidden").removeClass("hb-hidden");
701
702
  }, 200);
702
703
  })