From 9bd6aa4339e20703e7aef7343325d2d1f275ca86 Mon Sep 17 00:00:00 2001 From: fatchan Date: Sun, 20 Oct 2019 15:41:51 +1100 Subject: [PATCH] do links last to prevent surrounding markdown from breaking link --- helpers/posting/markdown.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helpers/posting/markdown.js b/helpers/posting/markdown.js index eb1e8506..c0ccf40f 100644 --- a/helpers/posting/markdown.js +++ b/helpers/posting/markdown.js @@ -28,11 +28,6 @@ module.exports = (text) => { return `>${greentext}`; }); - //links - text = text.replace(linkRegex, (match) => { - return `${match}`; - }); - //bold text = text.replace(boldRegex, (match, bold) => { return `${bold}`; @@ -82,6 +77,11 @@ module.exports = (text) => { //dice rolls text = text.replace(diceRegex, diceRoll); + //links + text = text.replace(linkRegex, (match) => { + return `${match}`; + }); + return text; }