From ede3575fb2e77387ac94f29ca0837cfb8590c4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 6 May 2019 16:56:25 +0200 Subject: [PATCH] misc: mark text cell content as safe (#32823) --- combo/data/models.py | 2 +- combo/public/templates/combo/text-cell.html | 2 +- tests/templates-1/combo/cells/foobar/text-cell.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/combo/data/models.py b/combo/data/models.py index 03198fb3..f0692cd9 100644 --- a/combo/data/models.py +++ b/combo/data/models.py @@ -768,7 +768,7 @@ class TextCell(CellBase): return 'href="%s"' % url text = re.sub(r'src="(.*?)"', sub_src, text) text = re.sub(r'href="(.*?)"', sub_href, text) - extra_context['text'] = text + extra_context['text'] = mark_safe(text) return extra_context diff --git a/combo/public/templates/combo/text-cell.html b/combo/public/templates/combo/text-cell.html index 12fef1d6..9a97ea50 100644 --- a/combo/public/templates/combo/text-cell.html +++ b/combo/public/templates/combo/text-cell.html @@ -1,3 +1,3 @@ {% block cell-content %} -{{text|safe}} +{{text}} {% endblock %} diff --git a/tests/templates-1/combo/cells/foobar/text-cell.html b/tests/templates-1/combo/cells/foobar/text-cell.html index 8d5d5464..2a97d065 100644 --- a/tests/templates-1/combo/cells/foobar/text-cell.html +++ b/tests/templates-1/combo/cells/foobar/text-cell.html @@ -1 +1 @@ -
{{cell.text|safe}}
+
{{text}}