Fix search
This commit is contained in:
@ -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]}"
|
||||||
|
@ -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 %}
|
Reference in New Issue
Block a user