Replace offset with match.start() to allow custom regex

This commit is contained in:
Lonami Exo 2018-04-03 13:46:54 +02:00
parent a1448f3da8
commit eabaa3854a

View File

@ -81,7 +81,7 @@ def parse(message, delimiters=None, url_re=None):
))
result.append(MessageEntityTextUrl(
offset=i, length=len(url_match.group(1)),
offset=url_match.start(), length=len(url_match.group(1)),
url=_del_surrogate(url_match.group(2))
))
i += len(url_match.group(1))