diff options
Diffstat (limited to 'lib/render.js')
-rw-r--r-- | lib/render.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/render.js b/lib/render.js index 573f5d8..2762484 100644 --- a/lib/render.js +++ b/lib/render.js @@ -83,7 +83,11 @@ Render.prototype.emoji = function (emoji) { Render.prototype.markdown = function (text, mentions) { var mentionsObj = this._mentions = {} if (Array.isArray(mentions)) mentions.forEach(function (link) { - if (link && link.name) mentionsObj['@' + link.name] = link.link + if (!link) return + else if (link.name) + mentionsObj['@' + link.name] = link.link + else if (link.host === 'http://localhost:7777') + mentionsObj[link.href] = link.link }) var out = marked((text || '').toString(), this.markedOpts) delete this._mentions |