mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
escape ` in highlights
This commit is contained in:
parent
8d795cf919
commit
e37e086f77
1 changed files with 7 additions and 7 deletions
|
@ -6,7 +6,7 @@ module.exports.icon = function(icon){
|
|||
}
|
||||
|
||||
module.exports.highlight = function(content){
|
||||
return "`" + content + "`"
|
||||
return "`" + content.replace(/`/g, 'ˋ') + "`"
|
||||
}
|
||||
|
||||
module.exports.codeblock = function(type, content){
|
||||
|
@ -25,32 +25,32 @@ module.exports.timestamp = function(time, flag = "t"){
|
|||
}
|
||||
|
||||
module.exports.pill = function(content){
|
||||
return " **` " + content + " `**"
|
||||
return " **` " + content.replace(/`/g, 'ˋ') + " `**"
|
||||
}
|
||||
|
||||
module.exports.smallPill = function(content){
|
||||
return " ` " + content + " `"
|
||||
return " ` " + content.replace(/`/g, 'ˋ') + " `"
|
||||
}
|
||||
|
||||
module.exports.iconPill = function(icon, content){
|
||||
if(!REDESIGN_ICONS[icon]) icon = "question"
|
||||
return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " **` " + content + " `**"
|
||||
return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " **` " + content.replace(/`/g, 'ˋ') + " `**"
|
||||
}
|
||||
|
||||
module.exports.smallIconPill = function(icon, content){
|
||||
if(!REDESIGN_ICONS[icon]) icon = "question"
|
||||
return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " ` " + content + " `"
|
||||
return REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:') + " ` " + content.replace(/`/g, 'ˋ') + " `"
|
||||
}
|
||||
|
||||
module.exports.iconLinkPill = function(icon, url, content, tooltip = ""){
|
||||
if(!REDESIGN_ICONS[icon]) icon = "question"
|
||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||
if(content) return `${REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content} \`**](${url}${tooltip})`
|
||||
if(content) return `${REDESIGN_ICONS[icon].replace(/:[a-z1-9_]*:/, ':i:')} [**\` ${content.replace(/`/g, 'ˋ')} \`**](${url}${tooltip})`
|
||||
return url
|
||||
}
|
||||
module.exports.linkPill = function(url, content, tooltip = ""){
|
||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||
if(content) return `[**\` ${content} \`**](${url}${tooltip})`
|
||||
if(content) return `[**\` ${content.replace(/`/g, 'ˋ')} \`**](${url}${tooltip})`
|
||||
return url
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue