We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e7919c commit 11a8c0fCopy full SHA for 11a8c0f
1 file changed
lib/models/note.js
@@ -13,6 +13,7 @@ var async = require('async');
13
var moment = require('moment');
14
var DiffMatchPatch = require('diff-match-patch');
15
var dmp = new DiffMatchPatch();
16
+var S = require('string');
17
18
// core
19
var config = require("../config.js");
@@ -234,7 +235,7 @@ module.exports = function (sequelize, DataTypes) {
234
235
var $ = cheerio.load(md.render(body));
236
var h1s = $("h1");
237
if (h1s.length > 0 && h1s.first().text().split('\n').length == 1)
- title = h1s.first().text();
238
+ title = S(h1s.first().text()).stripTags().s;
239
}
240
if (!title) title = "Untitled";
241
return title;
0 commit comments