diff --git a/labscore/utils/markdown.js b/labscore/utils/markdown.js index 28f7f0d..d86a48d 100644 --- a/labscore/utils/markdown.js +++ b/labscore/utils/markdown.js @@ -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 {Number} size Favicon Size * @returns {string} Favicon URL @@ -122,30 +122,30 @@ module.exports.stringwrapPreserveWords = function(content = "", length, newlines } module.exports.pill = function(content = ""){ - return " **` " + _escapeCodeblock(content) + "  `**" + return " **` " + _escapeCodeblock(content).replace(/ /g, " ") + "  `**" } module.exports.smallPill = function(content = ""){ - return " ` " + _escapeCodeblock(content) + " `" + return " ` " + _escapeCodeblock(content).replace(/ /g, " ") + " `" } module.exports.iconPill = function(icon, content = ""){ - return _icon(icon) + "  **` " + _escapeCodeblock(content) + "  `**" + return _icon(icon) + "  **` " + _escapeCodeblock(content).replace(/ /g, " ") + "  `**" } 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 = ""){ 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 } module.exports.linkPill = function(url, content = "", 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 }