aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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, ')'] : ''
]
}