Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prospector and fix some bugs #218

Merged
merged 27 commits into from
May 20, 2016
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c64bfca
Get rid of mutable default arguments
gsnedders Dec 3, 2015
c1c16ce
Avoid noisiness from pylint and the parser's set patterns
gsnedders Dec 4, 2015
2c3b64b
add pep8/flake8 config to get something useful happening with them
gsnedders May 20, 2016
8238648
Fix all the files outside of html5lib to flake8 cleanly
gsnedders May 20, 2016
de6bcf2
Fix incorrectly hidden flake8 errors
gsnedders May 20, 2016
0bd31c4
Get rid of type()-based type-check
gsnedders May 20, 2016
d440a83
Silence pytest unused-variable warnings
gsnedders May 20, 2016
5c1d8e2
Remove duplicate entry from constants.replacementCharacters
gsnedders May 20, 2016
1b86ccb
Remove gratuitious argument in sanitizer
gsnedders May 20, 2016
82d623b
Silence redefined-variable-type
gsnedders May 20, 2016
a017b88
Silence unused-argument
gsnedders May 20, 2016
e5d395c
Silence wrong-import-position
gsnedders May 20, 2016
b64df28
Change which way around we overwrite this for clarity's sake
gsnedders May 20, 2016
df0b2ba
Remove unused import
gsnedders May 20, 2016
742715d
Fix invalid_unicode_re on platforms supporting lone surrogates
gsnedders May 20, 2016
cd74ec7
Fix comment
gsnedders May 20, 2016
15e126f
Silence eval-used
gsnedders May 20, 2016
bfc278a
Silence bare-except
gsnedders May 20, 2016
b46fcdf
Silence too-many-nested-blocks
gsnedders May 20, 2016
6945bc4
Silence not-callable
gsnedders May 20, 2016
0c290e0
Kill long-dead finalText code
gsnedders May 20, 2016
da099dc
Silence a buggily output non-parent-init-called
gsnedders May 20, 2016
97427de
Fix indentation
gsnedders May 20, 2016
2afe09b
Make this in practice unreachable code work on Py2
gsnedders May 20, 2016
c0df867
Silence arguments-differ
gsnedders May 20, 2016
5dce4f2
Silence protected-access
gsnedders May 20, 2016
a2b8c11
Add prospector/pylint config for the sake of Landscape.
gsnedders Dec 4, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove gratuitious argument in sanitizer
  • Loading branch information
gsnedders committed May 20, 2016
commit 1b86ccbeec08069d1a40cd22d0dcc8492bdd789a
9 changes: 5 additions & 4 deletions html5lib/filters/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,15 +765,15 @@ def sanitize_token(self, token):
if ((namespace, name) in self.allowed_elements or
(namespace is None and
(namespaces["html"], name) in self.allowed_elements)):
return self.allowed_token(token, token_type)
return self.allowed_token(token)
else:
return self.disallowed_token(token, token_type)
return self.disallowed_token(token)
elif token_type == "Comment":
pass
else:
return token

def allowed_token(self, token, token_type):
def allowed_token(self, token):
if "data" in token:
attrs = token["data"]
attr_names = set(attrs.keys())
Expand Down Expand Up @@ -823,7 +823,8 @@ def allowed_token(self, token, token_type):
token["data"] = attrs
return token

def disallowed_token(self, token, token_type):
def disallowed_token(self, token):
token_type = token["type"]
if token_type == "EndTag":
token["data"] = "</%s>" % token["name"]
elif token["data"]:
Expand Down