Update regex to fetch URLs to match the official client.

Fixes #2420.
This commit is contained in:
Rapptz 2019-11-18 22:22:54 -05:00
parent cb21159589
commit a238c6178a

View File

@ -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')