We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd2819c commit 669b399Copy full SHA for 669b399
1 file changed
pyrogram/parser/html.py
@@ -233,8 +233,10 @@ def recursive(entity_i: int) -> int:
233
while i < len(entities):
234
i += recursive(i)
235
236
+ last_offset = entities_offsets[-1][1]
237
# no need to sort, but still add entities starting from the end
238
for entity, offset in reversed(entities_offsets):
- text = text[:offset] + entity + text[offset:]
239
+ text = text[:offset] + entity + html.escape(text[offset:last_offset]) + text[last_offset:]
240
+ last_offset = offset
241
242
return utils.remove_surrogates(text)
0 commit comments