diff --git a/lib/response.js b/lib/response.js index a3c988f..d1e5e15 100644 --- a/lib/response.js +++ b/lib/response.js @@ -145,6 +145,8 @@ function responseHackMD (res, note) { function newNote (req, res, next) { var owner = null + var body = req.body ? req.body : '' + body = body.replace(/[\r]/g, '') if (req.isAuthenticated()) { owner = req.user.id } else if (!config.allowAnonymous) { @@ -153,7 +155,7 @@ function newNote (req, res, next) { models.Note.create({ ownerId: owner, alias: req.alias ? req.alias : null, - content: req.body ? req.body : '' + content: body }).then(function (note) { return res.redirect(config.serverURL + '/' + models.Note.encodeNoteId(note.id)) }).catch(function (err) {