hdoc-tools 0.26.3 → 0.26.4

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 +6 -4
  2. package/package.json +1 -1
package/hdoc-validate.js CHANGED
@@ -415,6 +415,9 @@ const e = require("express");
415
415
  };
416
416
 
417
417
  const isHashAnchor = (html_file, hash_anchor, full_hash_anchor_link = "") => {
418
+ const markdown_paths = getMDPathFromHtmlPath(html_file);
419
+ const markdown_content = fs.readFileSync(markdown_paths.markdownPath, 'utf8');
420
+
418
421
  try {
419
422
  const file_content = fs.readFileSync(html_file.path, {
420
423
  encoding: "utf-8",
@@ -425,9 +428,8 @@ const e = require("express");
425
428
  if (
426
429
  !file_content.includes(`<div id="hb-doc-anchor-${clean_hash_anchor}"`)
427
430
  ) {
428
- errors[html_file.relativePath].push(
429
- `Target hash anchor is not present in page content: ${full_hash_anchor_link !== "" ? full_hash_anchor_link : hash_anchor}`,
430
- );
431
+ const error_message = processErrorMessage(`Target hash anchor is not present in page content: ${full_hash_anchor_link !== "" ? full_hash_anchor_link : hash_anchor}`, markdown_paths.relativePath, markdown_content, full_hash_anchor_link);
432
+ errors[html_file.relativePath].push( error_message );
431
433
  }
432
434
  } catch (e) {
433
435
  errors[html_file.relativePath].push(e);
@@ -688,7 +690,7 @@ const e = require("express");
688
690
  // Check for hash anchor
689
691
  if (hash_anchor !== null) {
690
692
  isHashAnchor(
691
- { path: html_file_path, relativePath: html_path.relativePath },
693
+ { path: html_file_path, relativePath: html_path.relativePath, extension: html_path.extension },
692
694
  hash_anchor,
693
695
  relative_path,
694
696
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.26.3",
3
+ "version": "0.26.4",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {