diff options
author | ache <ache@ache.one> | 2017-10-13 01:12:12 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2017-10-13 01:12:12 +0200 |
commit | 9887efad8c679d72391fd4e35a8f13eb512f7012 (patch) | |
tree | 2435ee9f5cb077e344ae65cd7574f7fff45e1cf8 /app.js | |
parent | Accessibility fix (diff) |
Use markdown-it instead of showdown
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -1,11 +1,11 @@ 'use-strict'; -const showdown = require('showdown'); const dirTree = require('directory-tree'); const express = require('express'); const fs = require('fs'); -const converter = new showdown.Converter(); +var md = require('markdown-it')(); + const app = express(); const path = 'md'; @@ -18,12 +18,6 @@ process.on('uncaughtException', function(err) { console.error("[" + new Date() + "] > " + "Error - " + err); }); -converter.setOption('parseImgDimensions', 'true'); -converter.setOption('literalMidWordUnderscores', 'true'); -converter.setOption('literalMidWordAsterisks', 'true'); -converter.setOption('strikethrough', 'true'); -converter.setOption('tables', 'true'); -converter.setOption('tasklists', 'true'); app.use(express.static('public')); @@ -33,7 +27,7 @@ app.get('/' + path + '/*', function(req, res) { fs.readFile(url.substr(1), 'utf8', function(err, data) { if (err) return console.log(err); - res.send(converter.makeHtml(data)); + res.send(md.render(data)); }); }); |