From cba02b9e4b5088719b897494f15981cb2f8e14b2 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 1 Jul 2022 01:01:10 +0200 Subject: [PATCH] fix issue with code blocks --- files/helpers/sanitize.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index cd81c9652..5589d276a 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -335,7 +335,8 @@ def sanitize(sanitized, edit=False): if bans: abort(403, description=f"Remove the banned domains {bans} and try again!") - sanitized = sanitized.replace('\n','') + if '
' not in sanitized:
+		sanitized = sanitized.replace('\n','')
 
 	if len(sanitized) > 5000:
 		sanitized = showmore_regex.sub(r'\1

\2
', sanitized)