hdoc-tools 0.9.9 → 0.9.11

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-init.js CHANGED
@@ -11,8 +11,8 @@
11
11
  const promptProps = [{
12
12
  name: 'id',
13
13
  description: 'Document ID',
14
- validator: /^[a-z][a-z-]+[a-z]$/,
15
- warning: 'Document ID must only contain lower case letters and dashes',
14
+ validator: /^[a-z][a-z0-9-]+[a-z0-9]$/,
15
+ warning: 'Document ID must only contain lower case letters, decimal digits and dashes.',
16
16
  required: true
17
17
  },
18
18
  {
package/hdoc-validate.js CHANGED
@@ -17,7 +17,7 @@
17
17
  british: true,
18
18
  spelling: true
19
19
  },
20
- regex_nav_paths = /[a-z-\/]+/g;
20
+ regex_nav_paths = /[a-z0-9-\/]+/g;
21
21
 
22
22
  let prod_families = {};
23
23
 
@@ -50,12 +50,13 @@
50
50
  const source_path = sourceFile.relativePath.replace('.'+sourceFile.extension, '');
51
51
  const translate_output = translator.translate(text, spellcheck_options);
52
52
  if(Object.keys(translate_output).length){
53
+
53
54
  for (const key in translate_output) {
54
55
  if (translate_output.hasOwnProperty(key)) {
55
56
  let error_message = `Line ${key} - British spelling:`;
56
57
  for (let i = 0; i < translate_output[key].length; i++) {
57
58
  for (const spelling in translate_output[key][i]) {
58
- if (translate_output[key][i].hasOwnProperty(spelling)) {
59
+ if (translate_output[key][i].hasOwnProperty(spelling) && (typeof translate_output[key][i][spelling].details === 'string')) {
59
60
  if (!excludes[source_path]) {
60
61
  errors[sourceFile.relativePath].push(`${error_message} ${spelling} should be ${translate_output[key][i][spelling].details}`);
61
62
  } else if (!excludes[source_path].includes(spelling.toLowerCase())) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.9.9",
3
+ "version": "0.9.11",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {
@@ -3,7 +3,7 @@
3
3
  "title": "--title--",
4
4
  "description": "--description--",
5
5
  "publicSource": "--publicSource--",
6
- "productFamily": "docs",
6
+ "productFamily": "hdocs",
7
7
  "version": "0.0.1",
8
8
  "audience": [
9
9
  "public"