From 53b7b865150fd3b0c028754c70d5f08aa82f8612 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Sun, 29 Oct 2017 19:35:57 +1100 Subject: [PATCH] Whoops, allow images in bleached content --- lemoncurry/templatetags/bleach.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lemoncurry/templatetags/bleach.py b/lemoncurry/templatetags/bleach.py index 9c0eb05..589bd2f 100644 --- a/lemoncurry/templatetags/bleach.py +++ b/lemoncurry/templatetags/bleach.py @@ -5,10 +5,11 @@ from django.utils.safestring import mark_safe from bleach.sanitizer import Cleaner, ALLOWED_TAGS from bleach.linkifier import LinkifyFilter -tags = ['code', 'p'] +tags = ['code', 'p', 'img'] tags.extend(ALLOWED_TAGS) attributes = { - 'a': ('href', 'title', 'class') + 'a': ('href', 'title', 'class'), + 'img': ('alt', 'src', 'title'), } register = template.Library()