Unconditionally match text and link text in markdown

Fixes cases where there's a nested [] in the text by matching until "](" is reached. This doesn't match newlines in URLs because that makes no sense.
This commit is contained in:
Nick80835 2025-02-01 11:20:56 -05:00 committed by Lonami
parent a2926b548f
commit 38d024312e

View File

@ -22,7 +22,7 @@ DEFAULT_DELIMITERS = {
'```': MessageEntityPre
}
DEFAULT_URL_RE = re.compile(r'\[([^\]]+)\]\(([^)]+)\)')
DEFAULT_URL_RE = re.compile(r'\[([\s\S]+)\]\((.+)\)')
DEFAULT_URL_FORMAT = '[{0}]({1})'