aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-05 16:05:05 -0500
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-05 16:05:05 -0500
commit267d7001b4c4a08f5c26cd75f6a156cf974c739f (patch)
treeb7e6df3b747dd97cb9afee2a1eec9275b53e9b87 /lib
parentda7282dead4b8b9f339428aedbf0d882c5663dce (diff)
downloadpatchfoo-267d7001b4c4a08f5c26cd75f6a156cf974c739f.tar.gz
patchfoo-267d7001b4c4a08f5c26cd75f6a156cf974c739f.zip
Rewrite Patchwork links
Diffstat (limited to 'lib')
-rw-r--r--lib/render.js6
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