mirror of https://github.com/status-im/codimd.git
Update to change server-side pre-rendering engine from marked to markdown-it
This commit is contained in:
parent
d39f1fc700
commit
458d07dde7
|
@ -4,7 +4,7 @@
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var LZString = require('lz-string');
|
var LZString = require('lz-string');
|
||||||
var marked = require('marked');
|
var md = require('markdown-it')();
|
||||||
var metaMarked = require('meta-marked');
|
var metaMarked = require('meta-marked');
|
||||||
var cheerio = require('cheerio');
|
var cheerio = require('cheerio');
|
||||||
var shortId = require('shortid');
|
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")) {
|
if (meta && meta.title && (typeof meta.title == "string" || typeof meta.title == "number")) {
|
||||||
title = meta.title;
|
title = meta.title;
|
||||||
} else {
|
} else {
|
||||||
var $ = cheerio.load(marked(body));
|
var $ = cheerio.load(md.render(body));
|
||||||
var h1s = $("h1");
|
var h1s = $("h1");
|
||||||
if (h1s.length > 0 && h1s.first().text().split('\n').length == 1)
|
if (h1s.length > 0 && h1s.first().text().split('\n').length == 1)
|
||||||
title = h1s.first().text();
|
title = h1s.first().text();
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
"imgur": "^0.1.7",
|
"imgur": "^0.1.7",
|
||||||
"jsdom-nogyp": "^0.8.3",
|
"jsdom-nogyp": "^0.8.3",
|
||||||
"lz-string": "1.4.4",
|
"lz-string": "1.4.4",
|
||||||
|
"markdown-it": "^7.0.0",
|
||||||
"markdown-pdf": "^7.0.0",
|
"markdown-pdf": "^7.0.0",
|
||||||
"marked": "^0.3.5",
|
|
||||||
"meta-marked": "^0.4.1",
|
"meta-marked": "^0.4.1",
|
||||||
"method-override": "^2.3.6",
|
"method-override": "^2.3.6",
|
||||||
"moment": "^2.13.0",
|
"moment": "^2.13.0",
|
||||||
|
|
Loading…
Reference in New Issue