hdoc-tools 0.7.21 → 0.7.23

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 CHANGED
@@ -8,6 +8,8 @@
8
8
  validate = require(path.join(__dirname, 'hdoc-validate.js')),
9
9
  hdoc = require(path.join(__dirname, 'hdoc-module.js')),
10
10
  zipper = require('zip-local');
11
+ const mdfm = require('markdown-it-front-matter');
12
+
11
13
 
12
14
  let conversion_attempted = 0,
13
15
  conversion_success = 0,
@@ -36,11 +38,15 @@
36
38
  }
37
39
  }
38
40
 
41
+ var frontmatter_content;
42
+ md.use(mdfm, function (fm) {
43
+ frontmatter_content = fm;
44
+ });
45
+
39
46
  // Render markdown into HTML
40
- let frontmatter_content = '';
47
+ frontmatter_content = "";
41
48
  var html_txt = md.render(md_txt.toString());
42
49
 
43
-
44
50
  if (frontmatter_content.length) {
45
51
  html_txt = "<!--[[FRONTMATTER\r\n" + frontmatter_content + "]]-->\r\n" + html_txt;
46
52
  }
package/hdoc-serve.js CHANGED
@@ -6,6 +6,7 @@
6
6
  path = require('path'),
7
7
  hdoc = require(path.join(__dirname, 'hdoc-module.js')),
8
8
  stream = require('stream');
9
+ const mdfm = require('markdown-it-front-matter');
9
10
 
10
11
  let port = 3000;
11
12
  let docId;
@@ -88,8 +89,13 @@
88
89
  console.log(`Includes injected into document: ${includes_processed.success}`);
89
90
  }
90
91
  }
92
+
93
+ var frontmatter_content;
94
+ md.use(mdfm, function (fm) {
95
+ frontmatter_content = fm;
96
+ });
97
+
91
98
  // Render markdown into HTML
92
- let frontmatter_content = '';
93
99
  var html_txt = md.render(md_txt.toString());
94
100
 
95
101
  if (frontmatter_content.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.7.21",
3
+ "version": "0.7.23",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {