Fix unfinished markdown delimiters being stripped away

This commit is contained in:
Lonami Exo 2017-11-10 11:44:27 +01:00
parent cb3f20db65
commit c4e07cff57

View File

@ -115,6 +115,9 @@ def parse(message, delimiters=None, url_re=None):
i += 2
# We may have found some a delimiter but not its ending pair.
# TODO Should probably insert such delimiter back in the string.
# 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:]
return message.decode('utf-16le'), result