From 28ade7d7f9e1c8e35de713a04303538140e22ea9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 13 Nov 2014 12:00:59 -0500 Subject: use plain html and \n ->
formatting on docs --- server/lib/util.js | 4 +++- server/lib/views/index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/lib/util.js b/server/lib/util.js index 791d3e2..0a71cb7 100644 --- a/server/lib/util.js +++ b/server/lib/util.js @@ -30,7 +30,9 @@ util.capitalizeWord = function (s) { util.escapeRegExp = function (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") } - +util.htmlize = function(s) { + return ("

" + s.replace(/\n/g,"

") + "

").replace(/

<\/p>/, "
") +} util.cleanQuery = function (query) { var update = _.extend({}, query); diff --git a/server/lib/views/index.js b/server/lib/views/index.js index 6e3b449..b3a15c2 100644 --- a/server/lib/views/index.js +++ b/server/lib/views/index.js @@ -130,7 +130,7 @@ var views = module.exports = { } res.render('docs', { doc: doc, - content: marked(doc.body), + content: util.htmlize(doc.body), isNew: false }) }) -- cgit v1.2.3-70-g09d2