From 73155f399b59a5235a146008925f43923e314b76 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 5 May 2019 00:11:35 -0500 Subject: [PATCH] allow details tags --- lemoncurry/jinja2/bleach.py | 3 ++- lemoncurry/templatetags/bleach.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lemoncurry/jinja2/bleach.py b/lemoncurry/jinja2/bleach.py index de09c04..11f884f 100644 --- a/lemoncurry/jinja2/bleach.py +++ b/lemoncurry/jinja2/bleach.py @@ -2,10 +2,11 @@ from bleach.sanitizer import Cleaner, ALLOWED_TAGS from bleach.linkifier import LinkifyFilter from jinja2 import evalcontextfilter, Markup -TAGS = ['cite', 'code', 'p', 'pre', 'img', 'span'] +TAGS = ['cite', 'code', 'details', 'p', 'pre', 'img', 'span', 'summary'] TAGS.extend(ALLOWED_TAGS) ATTRIBUTES = { 'a': ('href', 'title', 'class'), + 'details': ('open',), 'img': ('alt', 'src', 'title'), 'span': ('class',), } diff --git a/lemoncurry/templatetags/bleach.py b/lemoncurry/templatetags/bleach.py index 8de5338..982269d 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 = ['cite', 'code', 'p', 'pre', 'img', 'span'] +tags = ['cite', 'code', 'details', 'p', 'pre', 'img', 'span', 'summary'] tags.extend(ALLOWED_TAGS) attributes = { 'a': ('href', 'title', 'class'), + 'details': ('open',), 'img': ('alt', 'src', 'title'), 'span': ('class',), }