From 06b31831c1f92318394eff0265606d8ef86ca75d Mon Sep 17 00:00:00 2001 From: cel Date: Wed, 25 Mar 2020 20:37:03 -0400 Subject: gathering: list initial mentions --- lib/render.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/render.js') 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) { -- cgit v1.2.3