fix search 500
This commit is contained in:
parent
76367a85d0
commit
8c90ff3a03
1 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue