From 7c1ff737cfc87e84131b3a3638f12f1f09c6f53b Mon Sep 17 00:00:00 2001 From: Providence-o <97491889+Providence-o@users.noreply.github.com> Date: Mon, 22 Sep 2025 14:39:56 +0100 Subject: [PATCH] Remove SafeText from url so it can be escaped --- blog/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blog/models.py b/blog/models.py index 988c607eb..0083dd221 100644 --- a/blog/models.py +++ b/blog/models.py @@ -8,7 +8,6 @@ from django.utils import timezone from django.utils.cache import _generate_cache_header_key from django.utils.formats import date_format -from django.utils.html import format_html from django.utils.translation import gettext_lazy as _ from django_hosts.resolvers import get_host, reverse, reverse_host from docutils.core import publish_parts @@ -74,7 +73,7 @@ def img(self, url, alt_text): CF = type(self) return { CF.REST: f".. image:: {url}\n :alt: {alt_text}", - CF.HTML: format_html('{}', url, alt_text), + CF.HTML: f'{alt_text}', CF.MARKDOWN: f"![{alt_text}]({url})", }[self]