Skip to content

Commit

Permalink
chore: remove unused styles parameter
Browse files Browse the repository at this point in the history
Surfaced via `mypy`, recommended adding a type to the empty list.

The list was originally empty back in 0.1.0.

Instead of adding a type, remove the constant, and the code that uses it
from `clean()` - as it was partially reverted in pypa#121.

The default `ALLOWED_STYLES` in the underlying library is `[]`.

Related: pypa#114 (comment)

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
  • Loading branch information
miketheman committed Mar 9, 2022
1 parent a0903b1 commit bdae3c3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions readme_renderer/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
"input": ["type", "checked", "disabled"],
}

ALLOWED_STYLES = [
]


class DisabledCheckboxInputsFilter:
def __init__(self, source):
Expand Down Expand Up @@ -89,19 +86,16 @@ def __getattr__(self, name):
return getattr(self.source, name)


def clean(html, tags=None, attributes=None, styles=None):
def clean(html, tags=None, attributes=None):
if tags is None:
tags = ALLOWED_TAGS
if attributes is None:
attributes = ALLOWED_ATTRIBUTES
if styles is None:
styles = ALLOWED_STYLES

# Clean the output using Bleach
cleaner = bleach.sanitizer.Cleaner(
tags=tags,
attributes=attributes,
styles=styles,
filters=[
# Bleach Linkify makes it easy to modify links, however, we will
# not be using it to create additional links.
Expand Down

0 comments on commit bdae3c3

Please sign in to comment.