From: John Runyon Date: Fri, 16 Feb 2024 21:30:29 +0000 (-0700) Subject: urls - work better with (some) punctuation around the url X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/7429451ec6af152f453cecdad6f3c3742b3fecea urls - work better with (some) punctuation around the url --- diff --git a/modules/urls.py b/modules/urls.py index c1e2705..24e69a0 100644 --- a/modules/urls.py +++ b/modules/urls.py @@ -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