From a28c79ba87fca686a7e11e76f7f895ea61b530d6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 22 Mar 2023 16:08:02 +0200 Subject: [PATCH] make R/ and U/ and H/ work (for phone posters) --- files/helpers/regex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/helpers/regex.py b/files/helpers/regex.py index ab431853d..c37030576 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -43,8 +43,8 @@ controversial_regex = re.compile('["> ](https:\/\/old\.reddit\.com/r/[a-zA-Z0-9_ fishylinks_regex = re.compile("(https?:\/\/)?[\w\-.#&/=\?@%;+,:]{2,10}\.[\w\-.#&/=\?@%;+,:]{2,250}", flags=re.A) spoiler_regex = re.compile('\|\|(.+?)\|\|(?!([^<]*<\/(code|pre|a)>|[^`]*`))', 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})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A) +reddit_regex = re.compile('(^|\s|

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

)\/?([hH]\/(\w|-){3,25})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A) strikethrough_regex = re.compile('(^|\s|>)~{1,2}([^~]+)~{1,2}(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A)