hdoc-tools 0.8.34 → 0.8.35

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/hdoc-build.js +12 -10
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Hornbill Docs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/hdoc-build.js CHANGED
@@ -307,22 +307,24 @@
307
307
 
308
308
  if (fm_content.length >= 0) {
309
309
  fm_content.forEach(function (fm_prop) {
310
- const fm_property = fm_prop.split(':');
311
- if (fm_property[0] && fm_property[0].trim().length > 0 && fm_property[1] && fm_property[1].trim().length > 0) {
310
+ const fm_id = fm_prop.slice(0, fm_prop.indexOf(':'));
311
+ const fm_val = fm_prop.slice(fm_prop.indexOf(':') + 1);
312
+
313
+ if (fm_id && fm_id.trim().length > 0 && fm_val && fm_val.trim().length > 0) {
312
314
  fm_headers.push({
313
- id: fm_property[0].trim(),
314
- value: fm_property[1].trim()
315
+ id: fm_id.trim(),
316
+ value: fm_val.trim()
315
317
  });
316
318
 
317
- if (fm_property[0].trim() === 'title') {
319
+ if (fm_id.trim() === 'title') {
318
320
  fm_contains_title = true;
319
- doc_title = fm_property[1].trim();
321
+ doc_title = fm_val.trim();
320
322
  }
321
- if (fm_property[0].trim() === 'type') {
322
- doc_type = fm_property[1].trim();
323
+ if (fm_id.trim() === 'type') {
324
+ doc_type = fm_val.trim();
323
325
  }
324
- if (fm_property[0].trim() === 'reading-time') {
325
- book_read_time += parseInt(fm_property[1].trim(), 10);
326
+ if (fm_id.trim() === 'reading-time') {
327
+ book_read_time += parseInt(fm_val.trim(), 10);
326
328
  fm_contains_reading_time = true;
327
329
  }
328
330
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.8.34",
3
+ "version": "0.8.35",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {