Skip to content

Commit b8249f1

Browse files
FedericoJuriotzulbertifacundobatista
authored
Update allowed HTML (#456)
Co-authored-by: Tomas Zulberti <tzulberti@gmail.com> Co-authored-by: Facundo Batista <facundo@taniquetil.com.ar>
1 parent 831967e commit b8249f1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

events/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class EventForm(CrispyFormMixin):
2525
description = SanitizedCharField(
2626
allowed_tags=settings.ALLOWED_HTML_TAGS_INPUT,
2727
allowed_attributes=settings.ALLOWED_HTML_ATTRIBUTES_INPUT,
28+
allowed_styles=settings.ALLOWED_HTML_STYLES_INPUT,
2829
strip=False, widget=SummernoteInplaceWidget())
2930

3031
start_at = forms.DateTimeField(

pyarweb/settings/base.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,15 @@
212212
'a', 'b', 'br', 'i', 'u', 'p', 'hr',
213213
'pre', 'img', 'span', 'table', 'tbody',
214214
'thead', 'tr', 'th', 'td', 'blockquote',
215-
'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
215+
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'font',
216+
'o:p', 'sup', 'sub', 'strike', 'li', 'ul',
217+
'ol', 'div',
218+
]
219+
ALLOWED_HTML_ATTRIBUTES_INPUT = [
220+
'href', 'src', 'style', 'width', 'class', 'face',
221+
]
222+
ALLOWED_HTML_STYLES_INPUT = [
223+
'text-align', 'margin-left', 'background-color',
224+
'font-size',
216225
]
217-
ALLOWED_HTML_ATTRIBUTES_INPUT = ['href', 'src', 'style', 'width', 'class']
218226
TAGGIT_CASE_INSENSITIVE = True

0 commit comments

Comments
 (0)