From 84f0d6190a6acbf0f8a753d78f749a50b2c7f401 Mon Sep 17 00:00:00 2001 From: Nick80835 <24271245+Nick80835@users.noreply.github.com> Date: Thu, 6 Mar 2025 12:35:40 -0500 Subject: [PATCH] Make URL regex match everything except ] Hopefully this is the last time I touch this. --- telethon/extensions/markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/extensions/markdown.py b/telethon/extensions/markdown.py index b69195ee..4dbbe397 100644 --- a/telethon/extensions/markdown.py +++ b/telethon/extensions/markdown.py @@ -22,7 +22,7 @@ DEFAULT_DELIMITERS = { '```': MessageEntityPre } -DEFAULT_URL_RE = re.compile(r'\[([\s\S]*?)\]\(([\s\S]*?)\)') +DEFAULT_URL_RE = re.compile(r'\[([^]]*?)\]\(([\s\S]*?)\)') DEFAULT_URL_FORMAT = '[{0}]({1})'