From 2f82457f5e18cae2957e52a47f486cfe5af71456 Mon Sep 17 00:00:00 2001 From: Ben Rog-Wilhelm Date: Fri, 25 Aug 2023 03:06:41 -0500 Subject: [PATCH] Fix: Two spoilers on the same line causes unintended results. --- files/helpers/config/regex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/config/regex.py b/files/helpers/config/regex.py index 2ca85395b..0c5482ba1 100644 --- a/files/helpers/config/regex.py +++ b/files/helpers/config/regex.py @@ -25,7 +25,7 @@ controversial_regex = re.compile('["> ](https:\\/\\/old\\.reddit\\.com/r/[a-zA-Z fishylinks_regex = re.compile("https?://\\S+", flags=re.A) -spoiler_regex = re.compile('''\\|\\|(.+)\\|\\|''', flags=re.A) +spoiler_regex = re.compile('''\\|\\|(.+?)\\|\\|''', flags=re.A) reddit_regex = re.compile('(^|\\s|

)\\/?((r|u)\\/(\\w|-){3,25})(?![^<]*<\\/(code|pre|a)>)', flags=re.A) sub_regex = re.compile('(^|\\s|

)\\/?(h\\/(\\w|-){3,25})', flags=re.A)