mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
fix link markdown issue
This commit is contained in:
parent
5e62f93ae1
commit
29d7e91c98
1 changed files with 4 additions and 4 deletions
|
@ -21,8 +21,8 @@ module.exports.codeblock = function(type, content = ""){
|
|||
|
||||
module.exports.link = function(url, masked, tooltip = "", embed = false){
|
||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||
if(masked && !embed) return `[${masked}](<${url}>${tooltip})`
|
||||
if(masked && embed) return `[${masked}](${url}${tooltip})`
|
||||
if(masked && !embed) return `[${masked}](<${url.replace(/\)/g, '\\)')}>${tooltip})`
|
||||
if(masked && embed) return `[${masked}](${url.replace(/\)/g, '\\)')}${tooltip})`
|
||||
return url
|
||||
}
|
||||
|
||||
|
@ -61,12 +61,12 @@ module.exports.smallIconPill = function(icon, content = ""){
|
|||
module.exports.iconLinkPill = function(icon, url, content = "", tooltip = ""){
|
||||
if(!ICONS[icon]) icon = "question"
|
||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||
if(content) return `${ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content.toString().replace(/\`/g, 'ˋ')} \`**](${url}${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}${tooltip})`
|
||||
if(content) return `[**\` ${content.toString().replace(/\`/g, 'ˋ')} \`**](${url.replace(/\)/g, '\\)')}${tooltip})`
|
||||
return url
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue