mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 18:46:40 +00:00
Fix c4e07cf
, md parsing adding unfinished entity at wrong offset
This commit is contained in:
parent
4ddbc78699
commit
e5deaf5db8
@ -117,7 +117,10 @@ def parse(message, delimiters=None, url_re=None):
|
|||||||
# We may have found some a delimiter but not its ending pair.
|
# 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 this is the case, we want to insert the delimiter character back.
|
||||||
if current is not None:
|
if current is not None:
|
||||||
message = \
|
message = (
|
||||||
message[:current.offset] + end_delimiter + message[current.offset:]
|
message[:2 * current.offset]
|
||||||
|
+ end_delimiter
|
||||||
|
+ message[2 * current.offset:]
|
||||||
|
)
|
||||||
|
|
||||||
return message.decode('utf-16le'), result
|
return message.decode('utf-16le'), result
|
||||||
|
Loading…
Reference in New Issue
Block a user