diff options
Diffstat (limited to '')
-rw-r--r-- | lib/models/note.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/models/note.js b/lib/models/note.js index 05ed04c0..5727046c 100644 --- a/lib/models/note.js +++ b/lib/models/note.js @@ -260,6 +260,9 @@ module.exports = function (sequelize, DataTypes) { if (!title) title = "Untitled"; return title; }, + generateDescription: function (markdown) { + return markdown.substr(0, 100).replace(/(?:\r\n|\r|\n)/g, ' '); + }, decodeTitle: function (title) { var decodedTitle = LZString.decompressFromBase64(title); if (decodedTitle) title = decodedTitle; |