aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
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) {