Merge branch 'master' of https://github.com/pyrogram/pyrogram
This commit is contained in:
commit
084db0cea3
@ -175,10 +175,7 @@ class HTML:
|
||||
entities_offsets.append((start_tag, start,))
|
||||
entities_offsets.append((end_tag, end,))
|
||||
|
||||
# sorting by offset (desc)
|
||||
entities_offsets.sort(key=lambda x: -x[1])
|
||||
|
||||
for entity, offset in entities_offsets:
|
||||
for entity, offset in reversed(entities_offsets):
|
||||
text = text[:offset] + entity + text[offset:]
|
||||
|
||||
return utils.remove_surrogates(text)
|
||||
|
Loading…
Reference in New Issue
Block a user