aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-11-18 22:22:54 -0500
committerRapptz <[email protected]>2019-11-18 22:22:54 -0500
commita238c6178a8a07a4ab54059e7b6a2499b4dbbb52 (patch)
tree6cc1ccc17004708f117005cb1202c58a602c0d94
parentDocument that PartialEmoji.name can be None (diff)
downloaddiscord.py-a238c6178a8a07a4ab54059e7b6a2499b4dbbb52.tar.xz
discord.py-a238c6178a8a07a4ab54059e7b6a2499b4dbbb52.zip
Update regex to fetch URLs to match the official client.
Fixes #2420.
-rw-r--r--discord/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/utils.py b/discord/utils.py
index a3162a8a..4da46fcd 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<url>(?:https?|steam)://(?:-\.)?(?:[^\s/?\.#-]+\.?)+(?:/[^\s]*)?)'
+ url_regex = r'(?P<url><[^: >]+:\/[^ >]+>|(?:https?|steam):\/\/[^\s<]+[^<.,:;\"\'\]\s])'
def replacement(match):
groupdict = match.groupdict()
is_url = groupdict.get('url')