aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-06-18 08:20:16 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-06-18 08:20:16 -1000
commit92f0421665adb2185d90062cf58393742112c5bb (patch)
tree5bb5e355ad657c9cdfafe6df8bdc98e1bc8917de /lib
parenta420cffdfbe0457bb07b9aff2778745929295f88 (diff)
downloadpatchfoo-92f0421665adb2185d90062cf58393742112c5bb.tar.gz
patchfoo-92f0421665adb2185d90062cf58393742112c5bb.zip
Handle feed id in npm author
Diffstat (limited to 'lib')
-rw-r--r--lib/render.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/render.js b/lib/render.js
index 2aef6b4..441ee8a 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -352,13 +352,18 @@ Render.prototype.npmAuthorLink = function (author) {
var url = u.ifString(author.url)
var email = u.ifString(author.email)
var name = u.ifString(author.name)
+ var title
+ if (!url && u.isRef(name)) url = name, name = null
if (!url && !email) return name || JSON.stringify(author)
if (!url && email) url = 'mailto:' + email, email = null
if (!name && email) name = email, email = null
- if (!name && url) name = url
+ var feed = u.isRef(url) && url[0] === '@' && url
+ if (feed && name) title = this.app.getNameSync(feed)
+ if (feed && !name) name = this.app.getNameSync(feed) // TODO: async
+ if (url && !name) name = url
var secondaryLink = email && h('a', {href: this.toUrl('mailto:' + email)}, email)
return [
- h('a', {href: this.toUrl(url)}, name),
+ h('a', {href: this.toUrl(url), title: title}, name),
secondaryLink ? [' (', secondaryLink, ')'] : ''
]
}