fix search 500

This commit is contained in:
Your Name 2021-12-21 00:09:37 -05:00
parent 76367a85d0
commit 8c90ff3a03

View file

@ -10,8 +10,4 @@ register = template.Library()
@register.filter
@stringfilter
def highlight(text, search):
to_be_replaced_words = set(re.findall(search, text, flags=re.IGNORECASE))
for word in to_be_replaced_words:
text = text.replace(word, f'<span class="highlight">{word}</span>')
return mark_safe(text)
return mark_safe(text.replace(search, f'<span class="highlight">{search}</span>')) # TODO better query words match