diff --git a/apprise/plugins/NotifyTelegram.py b/apprise/plugins/NotifyTelegram.py index ecf248db..ea3c600a 100644 --- a/apprise/plugins/NotifyTelegram.py +++ b/apprise/plugins/NotifyTelegram.py @@ -547,8 +547,17 @@ class NotifyTelegram(NotifyBase): body, ) - else: # TEXT + else: # pass directly as is... payload['parse_mode'] = 'HTML' + + # Telegram strangely escapes all HTML characters for us already + # but to avoid causing issues with HTML, we escape the < and > + # characters + title = re.sub('>', '>', title, re.I) + title = re.sub('<', '<', title, re.I) + body = re.sub('>', '>', body, re.I) + body = re.sub('<', '<', body, re.I) + payload['text'] = '{}{}'.format( '{}\r\n'.format(title) if title else '', body,