Skip to content

Commit 6681550

Browse files
committed
added missing parameter for token_type
1 parent 496e69f commit 6681550

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

html5lib/sanitizer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,15 @@ def sanitize_token(self, token):
168168
if token_type in (tokenTypes["StartTag"], tokenTypes["EndTag"],
169169
tokenTypes["EmptyTag"]):
170170
if token["name"] in self.allowed_elements:
171-
return self.allowed_token(token)
171+
return self.allowed_token(token, token_type)
172172
else:
173-
return self.unallowed_token(token)
173+
return self.unallowed_token(token, token_type)
174174
elif token_type == tokenTypes["Comment"]:
175175
pass
176176
else:
177177
return token
178178

179-
def allowed_token(self, token):
179+
def allowed_token(self, token, token_type):
180180
if "data" in token:
181181
attrs = dict([(name,val) for name,val in
182182
token["data"][::-1]
@@ -206,7 +206,7 @@ def allowed_token(self, token):
206206
token["data"] = [[name,val] for name,val in list(attrs.items())]
207207
return token
208208

209-
def unallowed_token(self, token):
209+
def unallowed_token(self, token, token_type):
210210
if token_type == tokenTypes["EndTag"]:
211211
token["data"] = "</%s>" % token["name"]
212212
elif token["data"]:

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