aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/render-msg.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index e25d1b7..51db2a7 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -1062,9 +1062,23 @@ RenderMsg.prototype.npmPublish = function (cb) {
RenderMsg.prototype.npmPackages = function (cb) {
var self = this
+ var done = multicb({pluck: 1, spread: true})
+ var elCb = done()
+ function renderIdLink(id) {
+ return [h('a', {href: self.toUrl(id)}, truncate(id, 8)), ' ']
+ }
self.render.npmPackageMentions(self.c.mentions, function (err, el) {
if (err) return cb(err)
- self.wrap(el, cb)
+ self.wrap(h('div', [
+ el,
+ Array.isArray(self.c.dependencyBranch) ? h('div',
+ 'dependencies via: ', self.c.dependencyBranch.map(renderIdLink)
+ ) : '',
+ Array.isArray(self.c.versionBranch) ? h('div',
+ 'previous versions: ', self.c.versionBranch.map(renderIdLink)
+ ) : ''
+ ]), elCb)
+ return done(cb)
})
}