Fix #51. Using another symbol for cut text to avoid HTML parsing error in Telegram API.
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Alexey Skobkin 2023-07-02 23:07:09 +03:00
parent e66c5a7306
commit e25842708a
No known key found for this signature in database
GPG key ID: 5D5CEF6F221278E7

View file

@ -177,7 +177,7 @@ class Notifier:
sanitized_description = self.__sanitize_html(item.description) sanitized_description = self.__sanitize_html(item.description)
if len(sanitized_description) > (self.MESSAGE_LENGTH_LIMIT - len(header)): if len(sanitized_description) > (self.MESSAGE_LENGTH_LIMIT - len(header)):
cut = '<...>' cut = '[...]'
trim_index = self.MESSAGE_LENGTH_LIMIT - len(header) - len(cut) - 1 trim_index = self.MESSAGE_LENGTH_LIMIT - len(header) - len(cut) - 1
sanitized_description = sanitized_description[:trim_index] + cut sanitized_description = sanitized_description[:trim_index] + cut