From 1d3ec449191f077ed68587558d06afcbe82cb17c Mon Sep 17 00:00:00 2001 From: Maze Date: Sun, 2 May 2021 14:17:04 +0200 Subject: [PATCH] Allow apostrophe in URL regex Apostrophe is a valid URL character. Example: https://en.wikipedia.org/wiki/Benford's_law --- src/backend/html_markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/html_markdown.py b/src/backend/html_markdown.py index 6176d1b2..b7234d69 100644 --- a/src/backend/html_markdown.py +++ b/src/backend/html_markdown.py @@ -151,7 +151,7 @@ class HTMLProcessor: if isinstance(r, str) else r for r in [ # Normal :// URLs (r"(?P[a-z\d]+://(?P[a-z\d._-]+(?:\:\d+)?)" - r"(?:/[/\-.,\w#%&?:;=~!$*+^@]*)?(?:\([/\-_.,a-z\d#%&?;=~]*\))?)"), + r"(?:/[/\-.,\w#%&?:;=~!$*+^@']*)?(?:\([/\-_.,a-z\d#%&?;=~]*\))?)"), # mailto: and tel: r"mailto:(?P[a-z0-9._-]+@(?P[a-z0-9.:-]*[a-z\d]))",