fix markdown link for citations

This commit is contained in:
derpystuff 2024-04-23 13:38:57 +02:00
parent 29d7e91c98
commit b8db606fe8

View file

@ -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}`
}