]> git.r.bdr.sh - rbdr/blog/commitdiff
Substitute markdown for showdown
authorBen Beltran <redacted>
Mon, 3 Jul 2017 06:28:34 +0000 (01:28 -0500)
committerBen Beltran <redacted>
Mon, 3 Jul 2017 06:28:34 +0000 (01:28 -0500)
It has better support for code blocks

lib/blog.js
package.json

index 3b91943fbd87a21ce69352acce079d72f6619aea..f31234b526f7289f767bbadb04bb47134c0d9798 100644 (file)
@@ -1,11 +1,11 @@
 'use strict';
 
 const Fs = require('fs');
 '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 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 = {
 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 postContent = await internals.fs.readFile(postContentPath, { encoding: 'utf8' });
 
         internals.debuglog('Parsing markdown');
+        const parser = new Showdown.Converter();
         posts.push({
         posts.push({
-          html: Markdown.markdown.toHTML(postContent),
+          html: parser.makeHtml(postContent),
           id: i + 1
         });
       }
           id: i + 1
         });
       }
index e5303b110584c64420412231d173718bbed6ce26..4b18dbcee3f8cc5b3b9fce381feb4c8ce8b0087f 100644 (file)
   "homepage": "https://github.com/rbdr/blog#readme",
   "dependencies": {
     "getenv": "0.7.x",
   "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",
     "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",
   },
   "devDependencies": {
     "docdash": "0.4.x",