From 55523adbf7bcea503b162787c7f3b13a6cdd4a9c Mon Sep 17 00:00:00 2001 From: Robert Helewka Date: Sun, 10 May 2026 08:19:15 -0400 Subject: [PATCH] fix(library): use {% comment %} for multi-line template comments Django's `{# #}` syntax only supports single-line comments; multi-line blocks were rendering as literal text in the search and library detail templates. Replace them with `{% comment %}...{% endcomment %}` blocks and add a note explaining the distinction. --- .../templates/library/library_detail.html | 13 ++++++++----- .../library/templates/library/search.html | 18 +++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/mnemosyne/library/templates/library/library_detail.html b/mnemosyne/library/templates/library/library_detail.html index 470dc7c..2f81567 100644 --- a/mnemosyne/library/templates/library/library_detail.html +++ b/mnemosyne/library/templates/library/library_detail.html @@ -146,11 +146,14 @@ {% if results_reranked.reranker_used %} {{ results_reranked.reranker_model|default:"on" }} {% else %} - {# The A/B page always requests rerank=True, so a - negative here is always a skip with a reason — - surface the reason in a tooltip so the user - knows *why* the B side fell back to fusion - order. #} + {% comment %} + The A/B page always requests rerank=True, so a + negative here is always a skip with a reason — + surface the reason in a tooltip so the user + knows *why* the B side fell back to fusion order. + Django's ``{# #}`` comment is single-line only; + multi-line blocks must use ``{% comment %}``. + {% endcomment %} unavailable diff --git a/mnemosyne/library/templates/library/search.html b/mnemosyne/library/templates/library/search.html index b7e6b62..b079b6f 100644 --- a/mnemosyne/library/templates/library/search.html +++ b/mnemosyne/library/templates/library/search.html @@ -81,13 +81,17 @@
Re-ranked
- {# Three-state indicator: - - Yes: re-ranker ran successfully - - Skipped (+ tooltip): re-rank was requested but the - pipeline bailed — badge colour is a warning so the - user knows something didn't work - - Off: user unchecked the re-rank box - #} + {% comment %} + Three-state indicator: + - Yes: re-ranker ran successfully + - Skipped (+ tooltip): re-rank was requested but the + pipeline bailed — badge colour is a warning so the + user knows something didn't work + - Off: user unchecked the re-rank box + Note: Django's ``{# #}`` comment is single-line only; + multi-line blocks must use ``{% comment %}`` or they + render as literal text. + {% endcomment %} {% if results.reranker_used %} Yes {% elif results.reranker_skip_reason %}