From: Ben Beltran Date: Mon, 3 Jul 2017 06:28:34 +0000 (-0500) Subject: Substitute markdown for showdown X-Git-Tag: 1.0.1~4 X-Git-Url: https://git.r.bdr.sh/rbdr/blog/commitdiff_plain/2afa1e2b3829d704dd84ad1dce3f00a6996ec4af?ds=inline;hp=eccb3cc40e104fffaa89ef62b686659458021298 Substitute markdown for showdown It has better support for code blocks --- 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 }); } diff --git a/package.json b/package.json index e5303b1..4b18dbc 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,11 @@ "homepage": "https://github.com/rbdr/blog#readme", "dependencies": { "getenv": "0.7.x", - "markdown": "0.5.x", "minimist": "1.2.x", "mustache": "2.3.x", "ncp": "2.0.x", - "rimraf": "2.6.x" + "rimraf": "2.6.x", + "showdown": "1.7.x" }, "devDependencies": { "docdash": "0.4.x",