Fix markdown URL parsing using character index instead offset

This commit is contained in:
Lonami Exo 2017-10-30 11:15:53 +01:00
parent 0a14aa1bc6
commit 82cac4836c

View File

@ -134,7 +134,7 @@ def parse(message, delimiters=None, url_re=None):
emoji_len = sum(emojiness(c) for c in url_match.group(1))
result.append((
offset,
i + emoji_len,
offset + emoji_len,
(Mode.URL, url_match.group(2))
))
i += len(url_match.group(1))