From a238c6178a8a07a4ab54059e7b6a2499b4dbbb52 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 18 Nov 2019 22:22:54 -0500 Subject: [PATCH] Update regex to fetch URLs to match the official client. Fixes #2420. --- discord/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/utils.py b/discord/utils.py index a3162a8a8..4da46fcd1 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -438,7 +438,7 @@ def escape_markdown(text, *, as_needed=False, ignore_links=True): """ if not as_needed: - url_regex = r'(?P(?:https?|steam)://(?:-\.)?(?:[^\s/?\.#-]+\.?)+(?:/[^\s]*)?)' + url_regex = r'(?P<[^: >]+:\/[^ >]+>|(?:https?|steam):\/\/[^\s<]+[^<.,:;\"\'\]\s])' def replacement(match): groupdict = match.groupdict() is_url = groupdict.get('url')