diff --git a/src/python/html_filter.py b/src/python/html_filter.py index 4269ec3d..3738ff9d 100644 --- a/src/python/html_filter.py +++ b/src/python/html_filter.py @@ -13,9 +13,9 @@ class MarkdownRenderer(mistune.Renderer): class HtmlFilter: link_regexes = [re.compile(r, re.IGNORECASE) for r in [ - (r"(?P[a-zA-Z\d]+://(?P[a-z\d._-]+)" + (r"(?P[a-zA-Z\d]+://(?P[a-z\d._-]+(?:\:\d+)?)" r"(?:/[/\-_.,a-z\d%&?;=~]*)?(?:\([/\-_.,a-z\d%&?;=~]*\))?)"), - r"mailto:(?P[a-z0-9._-]+@(?P[a-z0-9_.-]+[a-z]))", + r"mailto:(?P[a-z0-9._-]+@(?P[a-z0-9_.-]+[a-z](?:\:\d+)?))", r"tel:(?P[0-9+-]+)(?P)", r"(?Pmagnet:\?xt=urn:[a-z0-9]+:.+)(?P)", ]]