aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-11-16 10:55:49 -0500
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-11-16 11:02:06 -0500
commiteade830580a16b2792fa592db3fbe6fc4a12473b (patch)
treee4719cf60b8d55c356d2f32623fed59a5255f51c
parent5a8a31c7e4523ef4de4c20e28443f9ea18961ce4 (diff)
downloadpatchfoo-eade830580a16b2792fa592db3fbe6fc4a12473b.tar.gz
patchfoo-eade830580a16b2792fa592db3fbe6fc4a12473b.zip
Fix handling long titles
%yZznzSZY8SSRf8e0GNlWOdDwRqYkO4CZX4Pinezm9uA=.sha256
-rw-r--r--lib/markdown-inline.js4
-rw-r--r--lib/render-msg.js5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/markdown-inline.js b/lib/markdown-inline.js
index 56693e5..e2d40f8 100644
--- a/lib/markdown-inline.js
+++ b/lib/markdown-inline.js
@@ -6,12 +6,12 @@ var u = require('./util')
var inlineRenderer = new marked.Renderer()
// inline renderer just spits out the text of links and images
-inlineRenderer.urltransform = function (url) { return false }
+inlineRenderer.urltransform = function (url) { return url }
inlineRenderer.link = function (href, title, text) { return unquote(shortenIfLink(text)) }
inlineRenderer.image = function (href, title, text) { return unquote(shortenIfLink(text)) }
inlineRenderer.code = function(code, lang, escaped) { return escaped ? unquote(code) : code }
inlineRenderer.blockquote = function(quote) { return unquote(quote) }
-inlineRenderer.html = function(html) { return false }
+inlineRenderer.html = function(html) { return html }
inlineRenderer.heading = function(text, level, raw) { return unquote(text)+' ' }
inlineRenderer.hr = function() { return ' --- ' }
inlineRenderer.br = function() { return ' ' }
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 6e61108..e25d1b7 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -401,8 +401,9 @@ RenderMsg.prototype.title1 = function (cb) {
else
self.app.getAbout(self.msg.key, function (err, about) {
if (err) return cb(err)
- var name = about.name || about.title || about.description
- if (name) return cb(null, name)
+ var name = about.name || about.title
+ || (about.description && mdInline(about.description))
+ if (name) return cb(null, truncate(name, 72))
self.message(function (err, el) {
if (err) return cb(err)
cb(null, '%' + title(h('div', el).textContent))