hdoc-tools 0.32.1 → 0.33.0
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-build.js +13 -9
- 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]
|
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
|
-
|
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
|
-
|
1055
|
-
|
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 = {
|