diff --git a/helpers/markdown.js b/helpers/markdown.js index 36c1d41e..9164a733 100644 --- a/helpers/markdown.js +++ b/helpers/markdown.js @@ -8,6 +8,7 @@ const Posts = require(__dirname+'/../db/posts.js') , italicRegex = /__(.+)__/gm , linkRegex = /https?\:\/\/[^\s]+/g , spoilerRegex = /\|\|(.+)\|\|/gm + , detectedRegex = /(\(\(\(.+\)\)\))/gm , codeRegex = /^```\s([\s\S]+)\s```/gm; module.exports = (board, thread, text) => { @@ -47,10 +48,16 @@ module.exports = (board, thread, text) => { return `${spoiler}`; }); + //code text = text.replace(codeRegex, (match, code) => { return `${code.trim()}`; }); + //detected + text = text.replace(detectedRegex, (match, detected) => { + return `${detected}`; + }); + return text; }