hdoc-tools 0.29.0 → 0.29.1

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.
Files changed (2) hide show
  1. package/hdoc-validate.js +7 -1
  2. package/package.json +1 -1
package/hdoc-validate.js CHANGED
@@ -542,7 +542,7 @@ const e = require("express");
542
542
  url: links[i],
543
543
  method: 'get',
544
544
  timeout: 10000,
545
- maxRedirects: 0,
545
+ maxRedirects: 5,
546
546
  validateStatus: (status) =>
547
547
  status >= 200 && status < 400,
548
548
  })
@@ -576,6 +576,12 @@ const e = require("express");
576
576
  for (let i = 0; i < links.length; i++) {
577
577
  // Validate that image is a valid URL first
578
578
  if (!hdoc.valid_url(links[i])) {
579
+
580
+ if (!links[i].startsWith("/")) {
581
+ const error_message = processErrorMessage(`Root relative image links should start with a forward-slash: ${links[i]}`, markdown_paths.relativePath, markdown_content, links[i]);
582
+ errors[htmlFile.relativePath].push(error_message);
583
+ }
584
+
579
585
  // Could be a relative path, check image exists
580
586
  doesFileExist(source_path, htmlFile, links[i], markdown_paths.relativePath, markdown_content);
581
587
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {