mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-10-30 14:17:40 +00:00
tgram:// and discord:// - Small fix for line breaks
This commit is contained in:
@@ -104,7 +104,8 @@ def apply_service_tweaks(url, n_body, n_title, requested_output_format):
|
|||||||
# @todo re-use an existing library we have already imported to strip all non-allowed tags
|
# @todo re-use an existing library we have already imported to strip all non-allowed tags
|
||||||
n_body = n_body.replace('<br>', '\n')
|
n_body = n_body.replace('<br>', '\n')
|
||||||
n_body = n_body.replace('</br>', '\n')
|
n_body = n_body.replace('</br>', '\n')
|
||||||
|
n_body = n_body.replace(CUSTOM_LINEBREAK_PLACEHOLDER, '\n')
|
||||||
|
|
||||||
# Use strikethrough for removed content, bold for added content
|
# Use strikethrough for removed content, bold for added content
|
||||||
n_body = n_body.replace(REMOVED_PLACEMARKER_OPEN, '<s>')
|
n_body = n_body.replace(REMOVED_PLACEMARKER_OPEN, '<s>')
|
||||||
n_body = n_body.replace(REMOVED_PLACEMARKER_CLOSED, '</s>')
|
n_body = n_body.replace(REMOVED_PLACEMARKER_CLOSED, '</s>')
|
||||||
@@ -128,6 +129,7 @@ def apply_service_tweaks(url, n_body, n_title, requested_output_format):
|
|||||||
# Discord doesn't support HTML, replace <br> with newlines
|
# Discord doesn't support HTML, replace <br> with newlines
|
||||||
n_body = n_body.strip().replace('<br>', '\n')
|
n_body = n_body.strip().replace('<br>', '\n')
|
||||||
n_body = n_body.replace('</br>', '\n')
|
n_body = n_body.replace('</br>', '\n')
|
||||||
|
n_body = n_body.replace(CUSTOM_LINEBREAK_PLACEHOLDER, '\n')
|
||||||
|
|
||||||
# Don't replace placeholders or truncate here - let the custom Discord plugin handle it
|
# Don't replace placeholders or truncate here - let the custom Discord plugin handle it
|
||||||
# The plugin will use embeds (6000 char limit across all embeds) if placeholders are present,
|
# The plugin will use embeds (6000 char limit across all embeds) if placeholders are present,
|
||||||
|
|||||||
Reference in New Issue
Block a user