add fix to markdown for "empty" codeblocks

This commit is contained in:
derpystuff 2023-06-23 16:00:19 +02:00
parent 2a6e54f580
commit 6cca320bd7

View file

@ -10,6 +10,7 @@ module.exports.highlight = function(content){
} }
module.exports.codeblock = function(type, content){ module.exports.codeblock = function(type, content){
if(!content.length) return "```" + type + "\n```"
return "```" + type + "\n" + content.join('\n').replace(/`/g, '`') + "\n```" return "```" + type + "\n" + content.join('\n').replace(/`/g, '`') + "\n```"
} }