Skip to content

Commit 1b86ccb

Browse files
committed
Remove gratuitious argument in sanitizer
1 parent 5c1d8e2 commit 1b86ccb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

html5lib/filters/sanitizer.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,15 +765,15 @@ def sanitize_token(self, token):
765765
if ((namespace, name) in self.allowed_elements or
766766
(namespace is None and
767767
(namespaces["html"], name) in self.allowed_elements)):
768-
return self.allowed_token(token, token_type)
768+
return self.allowed_token(token)
769769
else:
770-
return self.disallowed_token(token, token_type)
770+
return self.disallowed_token(token)
771771
elif token_type == "Comment":
772772
pass
773773
else:
774774
return token
775775

776-
def allowed_token(self, token, token_type):
776+
def allowed_token(self, token):
777777
if "data" in token:
778778
attrs = token["data"]
779779
attr_names = set(attrs.keys())
@@ -823,7 +823,8 @@ def allowed_token(self, token, token_type):
823823
token["data"] = attrs
824824
return token
825825

826-
def disallowed_token(self, token, token_type):
826+
def disallowed_token(self, token):
827+
token_type = token["type"]
827828
if token_type == "EndTag":
828829
token["data"] = "</%s>" % token["name"]
829830
elif token["data"]:

0 commit comments

Comments
 (0)