mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 04:43:45 +03:00
Fix directly nested markdown entities
This commit is contained in:
parent
8e36bb4c4d
commit
05b770a93f
|
@ -90,6 +90,10 @@ def parse(message, delimiters=None, url_re=None):
|
|||
for ent in result:
|
||||
# If the end is after our start, it is affected
|
||||
if ent.offset + ent.length > i:
|
||||
# If the old start is also before ours, it is fully enclosed
|
||||
if ent.offset <= i:
|
||||
ent.length -= len(delim) * 2
|
||||
else:
|
||||
ent.length -= len(delim)
|
||||
|
||||
# Append the found entity
|
||||
|
|
Loading…
Reference in New Issue
Block a user