-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This cleans up some API weirdness where BleachSanitizerFilter subclasses html5lib's sanitizer filter and sets allowed_elements to something entirely different than html5lib's sanitizer filter's allowed_elements is. The formers is a list of strings. The latter is a frozenset of (namespace, element) tuples. This fixes that by changing the BleachSanitizerFilter code to use allowed_tags everywhere. This eliminates the API confusion. While doing this, I changed ALLOWED_TAGS to be a frozenset, changed allowed_tags to take a set of strings rather than a list of strings, and renamed strip_disallowed_elements to strip_disallowed_tags to be consistent with naming. I also changed the __init__ for BleachSanitizerFilter so it no longer calls the html5lib sanitizer filter __init__ which kicks up the deprecation warning.
- Loading branch information
Showing
3 changed files
with
57 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters