Browse Source

Update regex to fetch URLs to match the official client.

Fixes #2420.
feature/ext-tasks
Rapptz 5 years ago
parent
commit
a238c6178a
  1. 2
      discord/utils.py

2
discord/utils.py

@ -438,7 +438,7 @@ def escape_markdown(text, *, as_needed=False, ignore_links=True):
""" """
if not as_needed: 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): def replacement(match):
groupdict = match.groupdict() groupdict = match.groupdict()
is_url = groupdict.get('url') is_url = groupdict.get('url')

Loading…
Cancel
Save