allow details tags

pull/1/head
Ben Lubar 3 years ago
parent e540f7b784
commit 73155f399b
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
  1. 3
      lemoncurry/jinja2/bleach.py
  2. 3
      lemoncurry/templatetags/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',),
}

@ -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',),
}

Loading…
Cancel
Save