From 2805ecbfca3c9a8c26c77ed5d2961fa108c94ece Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 30 Dec 2022 15:20:42 +0200 Subject: [PATCH] improve fishylinks_regex --- files/helpers/regex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/regex.py b/files/helpers/regex.py index e0fe9a695..9ad76172f 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -36,7 +36,7 @@ title_regex = re.compile("[^\w ]", flags=re.A) controversial_regex = re.compile('["> ](https:\/\/old\.reddit\.com/r/[a-zA-Z0-9_]{3,20}\/comments\/[\w\-.#&/=\?@%+]{5,250})["< ]', flags=re.A) -fishylinks_regex = re.compile("https?://\S+", flags=re.A) +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)