diff --git a/package.json b/package.json index ac1f545..f6617c0 100644 --- a/package.json +++ b/package.json @@ -7,5 +7,8 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", - "license": "ISC" + "license": "ISC", + "dependencies": { + "node-html-markdown": "^1.3.0" + } } diff --git a/unpack-whenwe-json.js b/unpack-whenwe-json.js index 68d6d7d..b1b94a1 100644 --- a/unpack-whenwe-json.js +++ b/unpack-whenwe-json.js @@ -1,10 +1,12 @@ const data = require('./whenwe.json'); const fs = require('fs'); const path = require('path'); +const { NodeHtmlMarkdown, NodeHtmlMarkdownOptions } = require('node-html-markdown'); +const nhm = new NodeHtmlMarkdown(); function toYaml(data, body) { const frontmatter = Object.keys(data).sort().map(key => key+': '+(data[key] ?? '')).join("\n"); - return frontmatter + "\n---\n" + body; + return frontmatter + "\n---\n" + nhm.translate(body); } function date(datestr) {