From 9110e551179f40de7b323d7fd8cfcbd41bac8e8d Mon Sep 17 00:00:00 2001 From: cel Date: Wed, 20 Sep 2017 12:25:08 -1000 Subject: Make npm links more consistent --- lib/render.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/render.js') diff --git a/lib/render.js b/lib/render.js index 5a0ddaa..9a3ad42 100644 --- a/lib/render.js +++ b/lib/render.js @@ -423,10 +423,10 @@ Render.prototype.npmPackageMention = function (link, opts, cb) { var done = multicb({pluck: 1, spread: true}) var base = '/npm/' + (opts.author ? u.escapeId(link.author) + '/' : '') var pathWithAuthor = opts.withAuthor ? '/npm/' + - u.escapeId(link.author) + '/' + - (opts.name ? opts.name + '/' + - (opts.version ? opts.version + '/' + - (opts.distTag ? opts.distTag + '/' : '') : '') : '') : '' + u.escapeId(link.author) + + (opts.name ? '/' + opts.name + + (opts.version ? '/' + opts.version + + (opts.distTag ? '/' + opts.distTag + '/' : '') : '') : '') : '' self.app.getAbout(link.author, done()) self.app.getBlobState(link.link, done()) done(function (err, about, blobState) { @@ -441,11 +441,11 @@ Render.prototype.npmPackageMention = function (link, opts, cb) { title: 'package name' }, name), ' '), h('td', version ? [h('a', { - href: self.toUrl(base + name + '/' + version + '/'), + href: self.toUrl(base + name + '/' + version), title: 'package version' }, version), ' '] : ''), h('td', distTag ? [h('a', { - href: self.toUrl(base + name + '//' + distTag + '/'), + href: self.toUrl(base + name + '//' + distTag), title: 'dist-tag' }, distTag), ' '] : ''), h('td', {align: 'right'}, link.size != null ? [h('span', { -- cgit v1.2.3