Skip to content

Commit

Permalink
Replace 'mark_safe' with 'format_html'
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeaufort committed Mar 5, 2021
1 parent c088aa8 commit d7f421d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fec/home/templatetags/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.conf import settings
from django.templatetags.static import static
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from wagtail.core.models import Page

register = template.Library()
Expand Down Expand Up @@ -71,7 +70,7 @@ def web_app_url(path):
def highlight_matches(text):
"""Replaces the highlight markers with span tags for digitalgov search results"""
highlighted_text = text.replace('\ue000', '<span class="t-highlight">').replace('\ue001', '</span>')
return mark_safe(highlighted_text)
return format_html(highlighted_text)


@register.filter(name='splitlines')
Expand Down

0 comments on commit d7f421d

Please sign in to comment.