diff --git a/changedetectionio/api/Watch.py b/changedetectionio/api/Watch.py index 8d31de7cf..087e4c805 100644 --- a/changedetectionio/api/Watch.py +++ b/changedetectionio/api/Watch.py @@ -12,8 +12,6 @@ import copy # Import schemas from __init__.py from . import schema, schema_create_watch, schema_update_watch, validate_openapi_request -from ..notification_service import CUSTOM_LINEBREAK_PLACEHOLDER - def validate_time_between_check_required(json_data): """ @@ -275,14 +273,14 @@ class WatchHistoryDiff(Resource): import re if 'html' in output_format: content = re.sub( - re.escape(CUSTOM_LINEBREAK_PLACEHOLDER) + r'\r?\n?', + r'\r?\n?', '
\\r\\n', content ) else: # texty types content = re.sub( - re.escape(CUSTOM_LINEBREAK_PLACEHOLDER) + r'\r?\n?', + r'\r?\n?', '\\r\\n', content ) diff --git a/changedetectionio/blueprint/ui/views.py b/changedetectionio/blueprint/ui/views.py index b7818a970..8d4a4d008 100644 --- a/changedetectionio/blueprint/ui/views.py +++ b/changedetectionio/blueprint/ui/views.py @@ -13,7 +13,6 @@ from changedetectionio.diff import ( CHANGED_INTO_PLACEMARKER_OPEN, CHANGED_INTO_PLACEMARKER_CLOSED ) from changedetectionio.notification.handler import apply_html_color_to_body -from changedetectionio.notification_service import CUSTOM_LINEBREAK_PLACEHOLDER from changedetectionio.store import ChangeDetectionStore from changedetectionio.auth_decorator import login_optionally_required from changedetectionio import html_tools, diff @@ -148,8 +147,6 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe for _ in range(min(open_count, close_count)): result = result.replace('</span>', '', 1) - # Not necessary because the CSS/HTML will lay it out by linefeed - result = result.replace(CUSTOM_LINEBREAK_PLACEHOLDER, '') return Markup(result) @views_blueprint.route("/preview/", methods=['GET']) @@ -348,7 +345,6 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe diff_cell_grid = build_diff_cell_visualizer(content) content = apply_html_color_to_body(n_body=content) - content = content.replace(CUSTOM_LINEBREAK_PLACEHOLDER, "\n") offscreen_content = render_template("diff-offscreen-options.html") output = render_template("diff.html", diff --git a/changedetectionio/diff/__init__.py b/changedetectionio/diff/__init__.py index 47416b90e..e2e9e838e 100644 --- a/changedetectionio/diff/__init__.py +++ b/changedetectionio/diff/__init__.py @@ -11,7 +11,6 @@ import diff_match_patch as dmp_module import re from .tokenizers import TOKENIZERS, tokenize_words_and_html -from ..notification_service import CUSTOM_LINEBREAK_PLACEHOLDER # Remember! gmail, outlook etc dont support