diff options
Diffstat (limited to 'server')
| -rw-r--r-- | server/lib/util.js | 4 | ||||
| -rw-r--r-- | server/lib/views/index.js | 2 |
2 files changed, 4 insertions, 2 deletions
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 ("<p>" + s.replace(/\n/g,"</p><p>") + "</p>").replace(/<p><\/p>/, "<br>") +} 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 }) }) |
