From 7812bfb47d14f20f972cb971cc955a55634b0082 Mon Sep 17 00:00:00 2001 From: vasya Date: Sat, 5 Aug 2023 01:49:07 +0000 Subject: [PATCH] Use single line breaks for markdown in comments (#177) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes #144. Instead of double newlines (reddit spacing 🤮), this will allow single newlines to be used. Tested locally. Co-authored-by: vasya Reviewed-on: https://fsdfsd.net/rDrama/rDrama/pulls/177 Co-authored-by: vasya Co-committed-by: vasya --- files/assets/js/markdown.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/assets/js/markdown.js b/files/assets/js/markdown.js index 5c633a6bcf..c98eab4e02 100644 --- a/files/assets/js/markdown.js +++ b/files/assets/js/markdown.js @@ -1,4 +1,5 @@ marked.use({ + breaks: true, extensions: [ { name: 'mention', @@ -93,8 +94,6 @@ 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\\. ')