From 229cd78df08a0778bf09511fd2014f2d198dfbce Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 27 Feb 2018 14:10:02 +0100 Subject: [PATCH] Fix markdown's URL regex not acceping newlines --- telethon/extensions/markdown.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/telethon/extensions/markdown.py b/telethon/extensions/markdown.py index e1fd04b7..a5dde5c6 100644 --- a/telethon/extensions/markdown.py +++ b/telethon/extensions/markdown.py @@ -21,10 +21,7 @@ DEFAULT_DELIMITERS = { '```': MessageEntityPre } -# Regex used to match r'\[(.+?)\]\((.+?)\)' (for URLs. -DEFAULT_URL_RE = re.compile(r'\[(.+?)\]\((.+?)\)') - -# Reverse operation for DEFAULT_URL_RE. {0} for text, {1} for URL. +DEFAULT_URL_RE = re.compile(r'\[([^\]]+)\]\((.+?)\)') DEFAULT_URL_FORMAT = '[{0}]({1})'