hdoc-tools 0.32.1 → 0.33.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-build.js +13 -9
  2. package/package.json +1 -1
package/hdoc-build.js CHANGED
@@ -40,7 +40,8 @@
40
40
  const pdf_template_file_path = path.join(pdf_template_path, "template.html");
41
41
  const regex_version = /^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,6}$/;
42
42
  const h1_pattern = /(<h1.*?>)\s*.*\s*(.*<\/h1>)/;
43
- const regex_filename = /^[a-z]+-{0,1}([-a-z0-9]+)*$/;
43
+ const regex_filename = /^[a-z]+[-a-z0-9]+[a-z0-9]$/;
44
+ const regex_filename_img = /^[a-z]+[_\-a-z0-9]+[a-z0-9]$/;
44
45
 
45
46
  const built_file_hashes = [];
46
47
  const css_templates = [];
@@ -1044,15 +1045,18 @@
1044
1045
  const filename_validation_callback = (element) => {
1045
1046
  if (element.relativePath.startsWith("_inline/")) return;
1046
1047
  if (element.name.toLowerCase() === ".ds_store") return;
1047
- if (
1048
- element.name === "article_ext.md" ||
1049
- element.name === "description_ext.md"
1050
- )
1051
- return;
1052
- if (image_extensions.includes(element.extension)) return;
1048
+ if (element.name === "article_ext.md" || element.name === "description_ext.md" ) return;
1049
+
1053
1050
  const file_no_ext = element.name.replace(`.${element.extension}`, "");
1054
- if (!file_no_ext.match(regex_filename))
1055
- errors_filename.push(element.relativePath);
1051
+
1052
+ if (image_extensions.includes(element.extension)) {
1053
+ if (!file_no_ext.match(regex_filename_img)) {
1054
+ errors_filename.push(element.relativePath);
1055
+ }
1056
+ return;
1057
+ }
1058
+
1059
+ if (!file_no_ext.match(regex_filename)) errors_filename.push(element.relativePath);
1056
1060
  };
1057
1061
 
1058
1062
  const dreeOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.32.1",
3
+ "version": "0.33.0",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {