From 267d7001b4c4a08f5c26cd75f6a156cf974c739f Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 5 Mar 2017 16:05:05 -0500 Subject: Rewrite Patchwork links --- lib/render.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3