Skip to content

Commit 7c1ff73

Browse files
committed
Remove SafeText from url so it can be escaped
1 parent 6418dc1 commit 7c1ff73

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

blog/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from django.utils import timezone
99
from django.utils.cache import _generate_cache_header_key
1010
from django.utils.formats import date_format
11-
from django.utils.html import format_html
1211
from django.utils.translation import gettext_lazy as _
1312
from django_hosts.resolvers import get_host, reverse, reverse_host
1413
from docutils.core import publish_parts
@@ -74,7 +73,7 @@ def img(self, url, alt_text):
7473
CF = type(self)
7574
return {
7675
CF.REST: f".. image:: {url}\n :alt: {alt_text}",
77-
CF.HTML: format_html('<img src="{}" alt="{}">', url, alt_text),
76+
CF.HTML: f'<img src="{url}" alt="{alt_text}">',
7877
CF.MARKDOWN: f"![{alt_text}]({url})",
7978
}[self]
8079

0 commit comments

Comments
 (0)