From 92f0421665adb2185d90062cf58393742112c5bb Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 18 Jun 2017 08:20:16 -1000 Subject: Handle feed id in npm author --- lib/render.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/render.js') 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, ')'] : '' ] } -- cgit v1.2.3