Correct mailto: linkifying in some special cases

adresses where the host ends with a digit or where the host is only one
character
This commit is contained in:
miruka 2020-03-24 04:08:00 -04:00
parent 0e191f11d0
commit 3dc81700c1

View File

@ -132,7 +132,7 @@ class HTMLProcessor:
r"(?:/[/\-_.,a-z\d#%&?;=~]*)?(?:\([/\-_.,a-z\d#%&?;=~]*\))?)"), r"(?:/[/\-_.,a-z\d#%&?;=~]*)?(?:\([/\-_.,a-z\d#%&?;=~]*\))?)"),
# mailto: and tel: # mailto: and tel:
r"mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9_.-]+[a-z](?:\:\d+)?))", r"mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9.-:]*[a-z\d]))",
r"tel:(?P<body>[0-9+-]+)(?P<host>)", r"tel:(?P<body>[0-9+-]+)(?P<host>)",
# magnet: # magnet: