From bdae3c3a72487981438e863c705df5d94aef35d9 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Wed, 9 Mar 2022 23:06:03 +0000 Subject: [PATCH] chore: remove unused styles parameter 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 #121. The default `ALLOWED_STYLES` in the underlying library is `[]`. Related: https://github.com/pypa/readme_renderer/pull/114#discussion_r218405013 Signed-off-by: Mike Fiedler --- readme_renderer/clean.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/readme_renderer/clean.py b/readme_renderer/clean.py index 190f423..99fe80c 100644 --- a/readme_renderer/clean.py +++ b/readme_renderer/clean.py @@ -59,9 +59,6 @@ "input": ["type", "checked", "disabled"], } -ALLOWED_STYLES = [ -] - class DisabledCheckboxInputsFilter: def __init__(self, source): @@ -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.