Skip to content

Commit 18a7102

Browse files
committed
Have only one set of allowed elements/attributes for the sanitizer
1 parent c4dd677 commit 18a7102

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

html5lib/filters/sanitizer.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
__all__ = ["Filter"]
1212

1313

14-
acceptable_elements = frozenset((
14+
allowed_elements = frozenset((
1515
(namespaces['html'], 'a'),
1616
(namespaces['html'], 'abbr'),
1717
(namespaces['html'], 'acronym'),
@@ -175,7 +175,7 @@
175175
(namespaces['svg'], 'use'),
176176
))
177177

178-
acceptable_attributes = frozenset((
178+
allowed_attributes = frozenset((
179179
# HTML attributes
180180
(None, 'abbr'),
181181
(None, 'accept'),
@@ -552,7 +552,7 @@
552552
(None, 'use')
553553
))
554554

555-
acceptable_css_properties = frozenset((
555+
allowed_css_properties = frozenset((
556556
'azimuth',
557557
'background-color',
558558
'border-bottom-color',
@@ -601,7 +601,7 @@
601601
'width',
602602
))
603603

604-
acceptable_css_keywords = frozenset((
604+
allowed_css_keywords = frozenset((
605605
'auto',
606606
'aqua',
607607
'black',
@@ -643,7 +643,7 @@
643643
'yellow',
644644
))
645645

646-
acceptable_svg_properties = frozenset((
646+
allowed_svg_properties = frozenset((
647647
'fill',
648648
'fill-opacity',
649649
'fill-rule',
@@ -654,7 +654,7 @@
654654
'stroke-opacity',
655655
))
656656

657-
acceptable_protocols = frozenset((
657+
allowed_protocols = frozenset((
658658
'ed2k',
659659
'ftp',
660660
'http',
@@ -680,7 +680,7 @@
680680
'data',
681681
))
682682

683-
acceptable_content_types = frozenset((
683+
allowed_content_types = frozenset((
684684
'image/png',
685685
'image/jpeg',
686686
'image/gif',
@@ -689,14 +689,6 @@
689689
'text/plain',
690690
))
691691

692-
allowed_elements = acceptable_elements
693-
allowed_attributes = acceptable_attributes
694-
allowed_css_properties = acceptable_css_properties
695-
allowed_css_keywords = acceptable_css_keywords
696-
allowed_svg_properties = acceptable_svg_properties
697-
allowed_protocols = acceptable_protocols
698-
allowed_content_types = acceptable_content_types
699-
700692

701693
data_content_type = re.compile(r'''
702694
^

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy