Allow apostrophe in URL regex

Apostrophe is a valid URL character.
Example: https://en.wikipedia.org/wiki/Benford's_law
This commit is contained in:
Maze 2021-05-02 14:17:04 +02:00 committed by miruka
parent 884d22938b
commit 1d3ec44919

View File

@ -151,7 +151,7 @@ class HTMLProcessor:
if isinstance(r, str) else r for r in [ if isinstance(r, str) else r for r in [
# Normal :// URLs # Normal :// URLs
(r"(?P<body>[a-z\d]+://(?P<host>[a-z\d._-]+(?:\:\d+)?)" (r"(?P<body>[a-z\d]+://(?P<host>[a-z\d._-]+(?:\:\d+)?)"
r"(?:/[/\-.,\w#%&?:;=~!$*+^@]*)?(?:\([/\-_.,a-z\d#%&?;=~]*\))?)"), r"(?:/[/\-.,\w#%&?:;=~!$*+^@']*)?(?:\([/\-_.,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]))",