Commit 92f0421665adb2185d90062cf58393742112c5bb
Handle feed id in npm author
cel committed on 6/18/2017, 6:20:16 PMParent: a420cffdfbe0457bb07b9aff2778745929295f88
Files changed
lib/render.js | changed |
lib/render.js | ||
---|---|---|
@@ -351,14 +351,19 @@ | ||
351 | 351 … | if (!author) return |
352 | 352 … | var url = u.ifString(author.url) |
353 | 353 … | var email = u.ifString(author.email) |
354 | 354 … | var name = u.ifString(author.name) |
355 … | + var title | |
356 … | + if (!url && u.isRef(name)) url = name, name = null | |
355 | 357 … | if (!url && !email) return name || JSON.stringify(author) |
356 | 358 … | if (!url && email) url = 'mailto:' + email, email = null |
357 | 359 … | if (!name && email) name = email, email = null |
358 | - if (!name && url) name = url | |
360 … | + var feed = u.isRef(url) && url[0] === '@' && url | |
361 … | + if (feed && name) title = this.app.getNameSync(feed) | |
362 … | + if (feed && !name) name = this.app.getNameSync(feed) // TODO: async | |
363 … | + if (url && !name) name = url | |
359 | 364 … | var secondaryLink = email && h('a', {href: this.toUrl('mailto:' + email)}, email) |
360 | 365 … | return [ |
361 | - h('a', {href: this.toUrl(url)}, name), | |
366 … | + h('a', {href: this.toUrl(url), title: title}, name), | |
362 | 367 … | secondaryLink ? [' (', secondaryLink, ')'] : '' |
363 | 368 … | ] |
364 | 369 … | } |
Built with git-ssb-web