diff options
| author | Rapptz <[email protected]> | 2019-11-18 22:22:54 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-11-18 22:22:54 -0500 |
| commit | a238c6178a8a07a4ab54059e7b6a2499b4dbbb52 (patch) | |
| tree | 6cc1ccc17004708f117005cb1202c58a602c0d94 | |
| parent | Document that PartialEmoji.name can be None (diff) | |
| download | discord.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.py | 2 |
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') |