From eade830580a16b2792fa592db3fbe6fc4a12473b Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 16 Nov 2017 10:55:49 -0500 Subject: Fix handling long titles %yZznzSZY8SSRf8e0GNlWOdDwRqYkO4CZX4Pinezm9uA=.sha256 --- lib/markdown-inline.js | 4 ++-- lib/render-msg.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') 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)) -- cgit v1.2.3