Ensure linefeed is present on diff view

This commit is contained in:
dgtlmoon
2025-10-27 23:21:34 +01:00
parent 6f7d3b689d
commit ea6623115a
2 changed files with 7 additions and 11 deletions
+1 -1
View File
@@ -265,9 +265,9 @@ def construct_blueprint(datastore: ChangeDetectionStore, update_q, queuedWatchMe
ignore_junk=diff_prefs.get('diff_ignoreWhitespace'),
include_equal=not diff_prefs.get('diff_changesOnly'),
word_diff=diff_prefs.get('diff_type') == 'diffWords',
context_lines=5
)
content = apply_html_color_to_body(n_body=content)
content = content.replace(CUSTOM_LINEBREAK_PLACEHOLDER, "\n")
output = render_template("diff.html",
content=content,
+6 -10
View File
@@ -18,17 +18,9 @@ def test_inscriptus():
def test_check_basic_change_detection_functionality(client, live_server, measure_memory_usage):
set_original_response()
# live_server_setup(live_server) # Setup on conftest per function
# Add our URL to the import page
res = client.post(
url_for("imports.import_page"),
data={"urls": url_for('test_endpoint', _external=True)},
follow_redirects=True
)
assert b"1 Imported" in res.data
uuid = client.application.config.get('DATASTORE').add_watch(url=url_for('test_endpoint', _external=True))
client.get(url_for("ui.form_watch_checknow"), follow_redirects=True)
wait_for_all_checks(client)
# Do this a few times.. ensures we dont accidently set the status
@@ -94,6 +86,10 @@ def test_check_basic_change_detection_functionality(client, live_server, measure
res = client.get(url_for("ui.ui_views.diff_history_page", uuid=uuid))
assert b'selected=""' in res.data, "Confirm diff history page loaded"
assert b'Which is across multiple lines' in res.data
# The linefeed should have been added ( @BR@ was replaced with a linefeed because this is htmlcolor kinda display )
assert b'Which is across multiple lines</span>\n' in res.data
# Check the [preview] pulls the right one
res = client.get(
url_for("ui.ui_views.preview_page", uuid="first"),