Fix search

This commit is contained in:
Joakim Hellsén 2022-12-12 16:33:22 +01:00
commit ec49fe15fa
No known key found for this signature in database
GPG key ID: 01FD861E3DAC09AC
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ def add_span_with_slice(highlighted_string: HighlightedString) -> str:
str: The string with added <span> tags. str: The string with added <span> tags.
""" """
# TODO: We are looping through the highlights and only using the last one. We should use all of them. # TODO: We are looping through the highlights and only using the last one. We should use all of them.
before_span, span_part, after_span = "" before_span, span_part, after_span = "", "", ""
for txt_slice in highlighted_string.highlights: for txt_slice in highlighted_string.highlights:
before_span: str = f"{highlighted_string.value[: txt_slice.start]}" before_span: str = f"{highlighted_string.value[: txt_slice.start]}"

View file

@ -4,7 +4,7 @@
<div class="p-2 border border-dark text-muted"> <div class="p-2 border border-dark text-muted">
Your search for "{{ query }}" returned {{ search_amount.total }} results. Your search for "{{ query }}" returned {{ search_amount.total }} results.
</div> </div>
<div class="p-2 border border-dark text-muted> <div class="p-2 border border-dark text-muted">
{{ search_html | safe }} {{ search_html | safe }}
</div> </div>
{% endblock %} {% endblock %}