From 860044fba8bd24142421f13bd8a8467c9e3a530c Mon Sep 17 00:00:00 2001 From: fatchan Date: Sat, 4 May 2019 16:30:00 +0000 Subject: [PATCH] Add 'detected' markdown --- helpers/markdown.js | 7 +++++++ 1 file changed, 7 insertions(+) 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; }