aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-03-25 20:37:03 -0400
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-03-28 13:55:47 -0400
commit06b31831c1f92318394eff0265606d8ef86ca75d (patch)
tree799ca4c1516363b4d594394ff57294c83bf6990c /lib/render.js
parent8044862dc44f6baa725154c762e69b2dfc8c6f95 (diff)
downloadpatchfoo-06b31831c1f92318394eff0265606d8ef86ca75d.tar.gz
patchfoo-06b31831c1f92318394eff0265606d8ef86ca75d.zip
gathering: list initial mentions
Diffstat (limited to 'lib/render.js')
-rw-r--r--lib/render.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/render.js b/lib/render.js
index 36f23ba..a39ba73 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -480,6 +480,14 @@ Render.prototype.getName = function (id, cb) {
Render.prototype.getNameLink = function (id, opts, cb) {
if (!cb && typeof opts === 'function') cb = opts, opts = null
+ if (typeof id === 'object' && id !== null && typeof id.link === 'string') {
+ var link = id
+ id = link.link
+ if (typeof link.name === 'string') {
+ return cb(null, h('a', {href: self.toUrl(id)},
+ u.truncate(link.name, length)))
+ }
+ }
var length = opts && opts.length || Infinity
var self = this
self.getName(id, function (err, name) {