diff --git a/changedetectionio/notification.py b/changedetectionio/notification.py index 4ee520b0f..b4c9ede2c 100644 --- a/changedetectionio/notification.py +++ b/changedetectionio/notification.py @@ -67,6 +67,11 @@ def process_notification(n_object, datastore): url += k + 'avatar_url=https://raw.githubusercontent.com/dgtlmoon/changedetection.io/master/changedetectionio/static/images/avatar-256x256.png' if url.startswith('tgram://'): + # Telegram only supports a limit subset of HTML, remove the '
' we place in. + # re https://github.com/dgtlmoon/changedetection.io/issues/555 + # @todo re-use an existing library we have already imported to strip all non-allowed tags + n_body = n_body.replace('
', '\n') + n_body = n_body.replace('
', '\n') # real limit is 4096, but minus some for extra metadata payload_max_size = 3600 body_limit = max(0, payload_max_size - len(n_title)) diff --git a/changedetectionio/templates/_common_fields.jinja b/changedetectionio/templates/_common_fields.jinja index 418abc160..e8f1bd5a1 100644 --- a/changedetectionio/templates/_common_fields.jinja +++ b/changedetectionio/templates/_common_fields.jinja @@ -14,7 +14,7 @@
  • Use AppRise URLs for notification to just about any service! Please read the notification services wiki here for important configuration notes.
  • discord:// only supports a maximum 2,000 characters of notification text, including the title.
  • tgram:// bots cant send messages to other bots, so you should specify chat ID of non-bot user.
  • - +
  • tgram:// only supports very limited HTML and can fail when extra tags are sent, read more here (or use plaintext/markdown format)