Commit e7106661871a2d26bccc7ced98ca979b420058e8
Skip empty lines when computing message title
ex. %4hnehXeMCIB6GI/d/NiLC5QgAVAPeXXqHBoBp+qdkKQ=.sha256cel committed on 11/28/2016, 8:27:03 PM
Parent: 6c505e91d10a2efe2b0990a27d611c3ff8382007
Files changed
modules_basic/message-name.js | changed |
modules_basic/message-name.js | |||
---|---|---|---|
@@ -1,10 +1,10 @@ | |||
1 | 1 … | ||
2 | 2 … | var sbot_get = require('../plugs').first(exports.sbot_get = []) | |
3 | 3 … | ||
4 | 4 … | function title (s) { | |
5 | - var m = /^[^\n]{0,40}/.exec(s) | ||
6 | - return m && (m[0].length == 40 ? m[0]+'...' : m[0]) | ||
5 … | + var m = /^\n*([^\n]{0,40})/.exec(s) | ||
6 … | + return m && (m[1].length == 40 ? m[1]+'...' : m[1]) | ||
7 | 7 … | } | |
8 | 8 … | ||
9 | 9 … | exports.message_name = function (id, cb) { | |
10 | 10 … | sbot_get(id, function (err, value) { |
Built with git-ssb-web