From d0f3b5e73b44c9449f43b7381f1106dedffb3e62 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Wed, 22 Sep 2021 03:10:12 +1000 Subject: [PATCH] slight fix markdown behaviour; trim leading empty lines leaving leading whitespace on first non-empty line --- helpers/posting/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/posting/markdown.js b/helpers/posting/markdown.js index 2c3d0be0..dfd14aed 100644 --- a/helpers/posting/markdown.js +++ b/helpers/posting/markdown.js @@ -14,7 +14,7 @@ const greentextRegex = /^>((?!>\d+|>>/\w+(/\d*)?|>># , codeRegex = /(?:(?[a-z+]{1,14})\r?\n)?(?[\s\S]+)/i , includeSplitRegex = /(\[code\][\s\S]+?\[\/code\])/gm , splitRegex = /\[code\]([\s\S]+?)\[\/code\]/gm - , trimNewlineRegex = /^\s*(\r?\n)*|(\r?\n)*$/g + , trimNewlineRegex = /^(\s*\r?\n)*/g , escape = require(__dirname+'/escape.js') , { highlight, highlightAuto } = require('highlight.js') , { addCallback } = require(__dirname+'/../../redis.js')