poops 1.4.0 → 1.4.1

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.
@@ -45,7 +45,7 @@ export default class LiquidEngine {
45
45
  const engine = this.engine
46
46
  engine.registerFilter('slugify', (str) => slugify(str))
47
47
  engine.registerFilter('jsonify', (obj) => JSON.stringify(obj))
48
- engine.registerFilter('markdown', (str) => marked.parse(str))
48
+ engine.registerFilter('markdown', (str) => marked.parse(String(str || '')))
49
49
  engine.registerFilter('toc', (html) => renderToc(String(html || '')))
50
50
  engine.registerFilter('date', (str, template) => {
51
51
  const fmt = template || timeDateFormat
@@ -79,7 +79,7 @@ export default class NunjucksEngine {
79
79
  const env = this.env
80
80
  env.addFilter('slugify', slugify)
81
81
  env.addFilter('jsonify', (obj) => JSON.stringify(obj))
82
- env.addFilter('markdown', (str) => marked.parse(str))
82
+ env.addFilter('markdown', (str) => marked.parse(String(str || '')))
83
83
  env.addFilter('toc', (html) => {
84
84
  const toc = renderToc(String(html || ''))
85
85
  // plain '' (falsy) when there are no headings, so `{% if x | toc %}` can
package/lib/markups.js CHANGED
@@ -223,6 +223,7 @@ export default class Markups {
223
223
  try {
224
224
  const frontMatterResult = parseFrontMatter(templateName)
225
225
  context.page = frontMatterResult.frontMatter
226
+ context.page.content = frontMatterResult.content
226
227
  context.page.wordcount = wordcount(frontMatterResult.content)
227
228
  } catch (err) {
228
229
  log({ tag: 'error', text: 'Failed parsing front matter:', link: templateName })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "poops",
3
3
  "description": "Straightforward, no-bullshit bundler for the web.",
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "poops.js",