aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-28 20:02:58 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-04-29 10:48:33 -1000
commit63262287520bba7cc347f60145e66eb225e546aa (patch)
treefd9956b70e6d4aded1923bb34a51f64d9019a67d
parent165b3ff15a35e91b40ccead2dbdb0c8a894dd42c (diff)
downloadpatchfoo-63262287520bba7cc347f60145e66eb225e546aa.tar.gz
patchfoo-63262287520bba7cc347f60145e66eb225e546aa.zip
Handle about descriptions better
-rw-r--r--lib/render-msg.js13
1 files 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',