mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
[markdown] provide hints to prevent line breaks in pill components
This commit is contained in:
parent
7c4e952b2f
commit
2bb389ad93
1 changed files with 7 additions and 7 deletions
|
@ -40,7 +40,7 @@ module.exports.iconAsEmojiObject = function(icon){
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a favicon image via google s2
|
* Creates a favicon image via Google s2
|
||||||
* @param {string} url Url
|
* @param {string} url Url
|
||||||
* @param {Number} size Favicon Size
|
* @param {Number} size Favicon Size
|
||||||
* @returns {string} Favicon URL
|
* @returns {string} Favicon URL
|
||||||
|
@ -122,30 +122,30 @@ module.exports.stringwrapPreserveWords = function(content = "", length, newlines
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.pill = function(content = ""){
|
module.exports.pill = function(content = ""){
|
||||||
return " **` " + _escapeCodeblock(content) + " `**"
|
return " **` " + _escapeCodeblock(content).replace(/ /g, " ") + " `**"
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.smallPill = function(content = ""){
|
module.exports.smallPill = function(content = ""){
|
||||||
return " ` " + _escapeCodeblock(content) + " `"
|
return " ` " + _escapeCodeblock(content).replace(/ /g, " ") + " `"
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.iconPill = function(icon, content = ""){
|
module.exports.iconPill = function(icon, content = ""){
|
||||||
return _icon(icon) + " **` " + _escapeCodeblock(content) + " `**"
|
return _icon(icon) + " **` " + _escapeCodeblock(content).replace(/ /g, " ") + " `**"
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.smallIconPill = function(icon, content = ""){
|
module.exports.smallIconPill = function(icon, content = ""){
|
||||||
return _icon(icon) + " ` " + _escapeCodeblock(content) + " `"
|
return _icon(icon) + " ` " + _escapeCodeblock(content).replace(/ /g, " ") + " `"
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.iconLinkPill = function(icon, url, content = "", tooltip = ""){
|
module.exports.iconLinkPill = function(icon, url, content = "", tooltip = ""){
|
||||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||||
if(content) return `${_icon(icon)} [**\` ${_escapeCodeblock(content)} \`**](${url.replace(/\)/g, '\\)')}${tooltip})`
|
if(content) return `${_icon(icon)} [**\` ${_escapeCodeblock(content).replace(/ /g, " ")} \`**](${url.replace(/\)/g, '\\)')}${tooltip})`
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.linkPill = function(url, content = "", tooltip = ""){
|
module.exports.linkPill = function(url, content = "", tooltip = ""){
|
||||||
if(tooltip.length) tooltip = ` '${tooltip}'`
|
if(tooltip.length) tooltip = ` '${tooltip}'`
|
||||||
if(content) return `[**\` ${_escapeCodeblock(content)} \`**](${url.replace(/\)/g, '\\)')}${tooltip})`
|
if(content) return `[**\` ${_escapeCodeblock(content).replace(/ /g, " ")} \`**](${url.replace(/\)/g, '\\)')}${tooltip})`
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue