From 9080d084e50e997c437c9eda54abb035efaee812 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 5 Aug 2023 17:21:05 +0300 Subject: [PATCH] Revert "Use single line breaks for markdown in comments (#177)" This reverts commit 7812bfb47d14f20f972cb971cc955a55634b0082. --- files/assets/js/markdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/assets/js/markdown.js b/files/assets/js/markdown.js index 8bb783637..c385442f5 100644 --- a/files/assets/js/markdown.js +++ b/files/assets/js/markdown.js @@ -1,5 +1,4 @@ marked.use({ - breaks: true, extensions: [ { name: 'mention', @@ -95,6 +94,8 @@ function markdown(t) { } } + if (!input.includes('```') && !input.includes('
'))
+		input = input.replace(/\n/g, '\n\n')
 	input = input.replace(/\|\|(.*?)\|\|/g, '$1')
 	input = input.replace(/(\n|^)>([^ >][^\n]*)/g, '$1\>$2')
 	input = input.replace(/((\s|^)[0-9]+)\. /g, '$1\\. ')