diff --git a/src/python/html_filter.py b/src/python/html_filter.py index ba126855..2e9f3d7d 100644 --- a/src/python/html_filter.py +++ b/src/python/html_filter.py @@ -12,8 +12,8 @@ from html_sanitizer.sanitizer import Sanitizer class HtmlFilter: link_regexes = [re.compile(r, re.IGNORECASE) for r in [ - (r"(?P.+://(?P[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?" - r"(?:\([/\-_.,a-z0-9%&?;=~]*\))?)"), + (r"(?P[a-zA-Z\d]+://(?P[a-z\d._-]+)" + r"(?:/[/\-_.,a-z\d%&?;=~]*)?(?:\([/\-_.,a-z\d%&?;=~]*\))?)"), r"mailto:(?P[a-z0-9._-]+@(?P[a-z0-9_.-]+[a-z]))", r"tel:(?P[0-9+-]+)(?P)", r"(?Pmagnet:\?xt=urn:[a-z0-9]+:.+)(?P)",