]> jfr.im git - erebus.git/commitdiff
urls - work better with (some) punctuation around the url
authorJohn Runyon <redacted>
Fri, 16 Feb 2024 21:30:29 +0000 (14:30 -0700)
committerJohn Runyon <redacted>
Fri, 16 Feb 2024 21:30:29 +0000 (14:30 -0700)
modules/urls.py

index c1e27055a8ead6cd53f3a4a64e3768ab2d152e4a..24e69a0689ddee0a90d4aab6e73942e0391bd317 100644 (file)
@@ -336,7 +336,7 @@ def goturl(url):
        return ''.join(output)
 
 url_regex = (
-       re.compile(r'https?://(?:[^/\s.]+\.)+[^/\s.]+(?:/\S+)?'),
+       re.compile(r'https?://(?:[^/\s.]+\.)+[a-z0-9-]+(?:/[^\s\]>)}]+)?', re.I),
 )
 other_regexes = (
        (lambda x: '', (re.compile(r"""https?://(?:www\.)?(?:twitter|x)\.com/""", re.I),)), # skip twitter