diff options
| author | Ben Beltran <ben@nsovocal.com> | 2017-07-03 01:28:34 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2017-07-03 01:28:34 -0500 |
| commit | 2afa1e2b3829d704dd84ad1dce3f00a6996ec4af (patch) | |
| tree | 0bfc4fb50cd454ebb11c76b5f786f1a0059c156b /lib | |
| parent | eccb3cc40e104fffaa89ef62b686659458021298 (diff) | |
Substitute markdown for showdown
It has better support for code blocks
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/blog.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/blog.js b/lib/blog.js index 3b91943..f31234b 100644 --- a/lib/blog.js +++ b/lib/blog.js @@ -1,11 +1,11 @@ 'use strict'; const Fs = require('fs'); -const Markdown = require('markdown'); const Mustache = require('mustache'); const Ncp = require('ncp'); const Path = require('path'); const Rimraf = require('rimraf'); +const Showdown = require('showdown'); const Util = require('util'); const internals = { @@ -126,8 +126,9 @@ module.exports = class Blog { const postContent = await internals.fs.readFile(postContentPath, { encoding: 'utf8' }); internals.debuglog('Parsing markdown'); + const parser = new Showdown.Converter(); posts.push({ - html: Markdown.markdown.toHTML(postContent), + html: parser.makeHtml(postContent), id: i + 1 }); } |