From b8db606fe8ccc53c9a5090a104cf436e4a0eda53 Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Tue, 23 Apr 2024 13:38:57 +0200 Subject: [PATCH] fix markdown link for citations --- labscore/utils/markdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/labscore/utils/markdown.js b/labscore/utils/markdown.js index 9c9d705..96a6123 100644 --- a/labscore/utils/markdown.js +++ b/labscore/utils/markdown.js @@ -64,6 +64,7 @@ module.exports.iconLinkPill = function(icon, url, content = "", tooltip = ""){ if(content) return `${ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content.toString().replace(/\`/g, 'ˋ')} \`**](${url.replace(/\)/g, '\\)')}${tooltip})` return url } + module.exports.linkPill = function(url, content = "", tooltip = ""){ if(tooltip.length) tooltip = ` '${tooltip}'` if(content) return `[**\` ${content.toString().replace(/\`/g, 'ˋ')} \`**](${url.replace(/\)/g, '\\)')}${tooltip})` @@ -79,7 +80,7 @@ module.exports.citation = function(number = 1, url, tooltip = ""){ if(tooltip.endsWith(' ')) tooltip = tooltip.substr(0, tooltip.length - 1) tooltip = ` '${tooltip.replace(/["*]/g, '')}'` } - return `[⁽${formatted}⁾](${url}${tooltip})` + return `[⁽${formatted}⁾](${url.replace(/\)/g, '\\)')}${tooltip})` } return `⁽${formatted}⁾` } \ No newline at end of file