From 5ddde69ac9c00d2c1ac0542d7727cbec369a0ac3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 19 Jun 2022 17:22:06 +0200 Subject: [PATCH] greentext fix --- files/helpers/const.py | 2 +- files/helpers/sanitize.py | 2 +- files/templates/util/assetcache.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 3efa30905..b8efdc00a 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -1015,6 +1015,6 @@ procoins_li = (0,2500,5000,10000,25000,50000,125000,250000) linefeeds_regex = re.compile("([^\n])\n([^\n])", flags=re.A) -greentext_regex = re.compile(">([^ ][^\n]*)", flags=re.A) +greentext_regex = re.compile("(\n|^)>([^ ][^\n]*)", flags=re.A) def make_name(*args, **kwargs): return request.base_url \ No newline at end of file diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index daaa9bcbe..b1b7cbf74 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -170,7 +170,7 @@ def sanitize(sanitized, alert=False, edit=False): if '```' not in sanitized and '
' not in sanitized:
 		sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
 
-	sanitized = greentext_regex.sub(r'\>\1', sanitized)
+	sanitized = greentext_regex.sub(r'\1\>\2', sanitized)
 
 	sanitized = image_regex.sub(r'\1![](\2)\5', sanitized)
 
diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html
index b0d03c565..012e91a0e 100644
--- a/files/templates/util/assetcache.html
+++ b/files/templates/util/assetcache.html
@@ -21,7 +21,7 @@ set CACHE_VER = {
 	'js/formatting.js': 240,
 	'js/header.js': 272,
 	'js/lottery.js': 254,
-	'js/marked.js': 261,
+	'js/marked.js': 262,
 	'js/submit.js': 262,
 	'js/userpage.js': 241,
 	'js/userpage_v.js': 245,