summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-07-02 16:11:06 +0800
committerWu Cheng-Han2016-07-02 16:11:06 +0800
commit458d07dde7f8317f44a0f4d46b5b7d96d03ba9bd (patch)
tree3134c038c4d5d8cb3f3d585baff40b7f9f8363be
parentd39f1fc70084ad5b7c40a03657e5ff8d03cc7944 (diff)
Update to change server-side pre-rendering engine from marked to markdown-it
-rw-r--r--lib/models/note.js4
-rw-r--r--package.json2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/models/note.js b/lib/models/note.js
index db0493b2..f9a8ec61 100644
--- a/lib/models/note.js
+++ b/lib/models/note.js
@@ -4,7 +4,7 @@
var fs = require('fs');
var path = require('path');
var LZString = require('lz-string');
-var marked = require('marked');
+var md = require('markdown-it')();
var metaMarked = require('meta-marked');
var cheerio = require('cheerio');
var shortId = require('shortid');
@@ -200,7 +200,7 @@ module.exports = function (sequelize, DataTypes) {
if (meta && meta.title && (typeof meta.title == "string" || typeof meta.title == "number")) {
title = meta.title;
} else {
- var $ = cheerio.load(marked(body));
+ var $ = cheerio.load(md.render(body));
var h1s = $("h1");
if (h1s.length > 0 && h1s.first().text().split('\n').length == 1)
title = h1s.first().text();
diff --git a/package.json b/package.json
index 8aeae0ee..91755b20 100644
--- a/package.json
+++ b/package.json
@@ -25,8 +25,8 @@
"imgur": "^0.1.7",
"jsdom-nogyp": "^0.8.3",
"lz-string": "1.4.4",
+ "markdown-it": "^7.0.0",
"markdown-pdf": "^7.0.0",
- "marked": "^0.3.5",
"meta-marked": "^0.4.1",
"method-override": "^2.3.6",
"moment": "^2.13.0",