1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Merge pull request #1808 from coder2020official/master

Fix #1804
This commit is contained in:
_run 2022-11-26 20:05:00 +04:00 committed by GitHub
commit 8992db1d24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1280,7 +1280,8 @@ class Message(JsonDeserializable):
entity_string_decoded = entity_string.decode("utf-16-le") entity_string_decoded = entity_string.decode("utf-16-le")
last_occurence = html_text.rfind(entity_string_decoded) last_occurence = html_text.rfind(entity_string_decoded)
string_length = len(entity_string_decoded) string_length = len(entity_string_decoded)
html_text = html_text.replace(html_text[last_occurence:last_occurence+string_length], formatted_string) #html_text = html_text.replace(html_text[last_occurence:last_occurence+string_length], formatted_string)
html_text = html_text[:last_occurence] + formatted_string + html_text[last_occurence+string_length:]
if offset * 2 < len(utf16_text): if offset * 2 < len(utf16_text):
html_text += func(utf16_text[offset * 2:]) html_text += func(utf16_text[offset * 2:])