Fix c4e07cf, md parsing adding unfinished entity at wrong offset

This commit is contained in:
Lonami Exo 2017-11-16 19:07:53 +01:00
parent 4ddbc78699
commit e5deaf5db8

View File

@ -117,7 +117,10 @@ def parse(message, delimiters=None, url_re=None):
# We may have found some a delimiter but not its ending pair.
# If this is the case, we want to insert the delimiter character back.
if current is not None:
message = \
message[:current.offset] + end_delimiter + message[current.offset:]
message = (
message[:2 * current.offset]
+ end_delimiter
+ message[2 * current.offset:]
)
return message.decode('utf-16le'), result