]> jfr.im git - erebus.git/blobdiff - modules/urls.py
urls - work better with (some) punctuation around the url
[erebus.git] / 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