From 63262287520bba7cc347f60145e66eb225e546aa Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 28 Apr 2017 20:02:58 -1000 Subject: Handle about descriptions better --- lib/render-msg.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/render-msg.js b/lib/render-msg.js index 2bd98f5..f28e9de 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -362,9 +362,16 @@ RenderMsg.prototype.about = function (cb) { var img = u.linkDest(this.c.image) var done = multicb({pluck: 1, spread: true}) var elCb = done() - this.wrapMini([ - this.c.about === this.msg.value.author ? 'self-identifies' : - ['identifies ', h('a', {href: this.toUrl(this.c.about)}, truncate(this.c.about, 10))], + // if there is a description, it is likely to be multi-line + var hasDescription = this.c.description != null + var wrap = hasDescription ? this.wrap : this.wrapMini + var isSelf = this.c.about === this.msg.value.author + + wrap.call(this, [ + isSelf + ? hasDescription ? 'self-describes' : 'self-identifies' + : [hasDescription ? 'describes' : 'identifies', ' ', + h('a', {href: this.toUrl(this.c.about)}, truncate(this.c.about, 10))], ' as ', this.c.name ? [h('ins', this.c.name), ' '] : '', this.c.description ? h('div', -- cgit v1.2.3