Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix #146; fix all pep8 1.5.4 failures#147

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gsnedders merged 1 commit intohtml5lib:masterfromgsnedders:pep8-fixes-1.5.4
Apr 9, 2014
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
3 changes: 1 addition & 2 deletionshtml5lib/html5parser.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1216,8 +1216,7 @@ def startTagIsIndex(self, token):
attributes["name"] = "isindex"
self.processStartTag(impliedTagToken("input", "StartTag",
attributes=attributes,
selfClosing=
token["selfClosing"]))
selfClosing=token["selfClosing"]))
self.processEndTag(impliedTagToken("label"))
self.processStartTag(impliedTagToken("hr", "StartTag"))
self.processEndTag(impliedTagToken("form"))
Expand Down
2 changes: 1 addition & 1 deletionhtml5lib/sanitizer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -245,7 +245,7 @@ def sanitize_css(self, style):
elif prop.split('-')[0].lower() in ['background', 'border', 'margin',
'padding']:
for keyword in value.split():
ifnotkeyword in self.acceptable_css_keywords and \
if keyword not in self.acceptable_css_keywords and \
not re.match("^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$", keyword):
break
else:
Expand Down
4 changes: 2 additions & 2 deletionshtml5lib/serializer/htmlserializer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@
v = utils.surrogatePairToCodepoint(v)
else:
v = ord(v)
ifnot v in encode_entity_map or k.islower():
ifv not in encode_entity_map or k.islower():
# prefer < over < and similarly for &, >, etc.
encode_entity_map[v] = k

Expand DownExpand Up@@ -291,7 +291,7 @@ def serialize(self, treewalker, encoding=None):
elif type == "Entity":
name = token["name"]
key = name + ";"
ifnotkey in entities:
if key not in entities:
self.serializeError(_("Entity %s not recognized" % name))
if self.resolve_entities and key not in xmlEntities:
data = entities[key]
Expand Down
6 changes: 3 additions & 3 deletionshtml5lib/tests/test_tokenizer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,8 +68,8 @@ def processParseError(self, token):
def concatenateCharacterTokens(tokens):
outputTokens = []
for token in tokens:
ifnot"ParseError" in token and token[0] == "Character":
if (outputTokens andnot"ParseError" in outputTokens[-1] and
if "ParseError" not in token and token[0] == "Character":
if (outputTokens and "ParseError" not in outputTokens[-1] and
outputTokens[-1][0] == "Character"):
outputTokens[-1][1] += token[1]
else:
Expand DownExpand Up@@ -112,7 +112,7 @@ def tokensMatch(expectedTokens, receivedTokens, ignoreErrorOrder,
# Sort the tokens into two groups; non-parse errors and parse errors
tokens = {"expected": [[], []], "received": [[], []]}
for tokenType, tokenList in zip(list(tokens.keys()),
(expectedTokens, receivedTokens)):
(expectedTokens, receivedTokens)):
for token in tokenList:
if token != "ParseError":
tokens[tokenType][0].append(token)
Expand Down
2 changes: 1 addition & 1 deletionhtml5lib/treebuilders/dom.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,7 +158,7 @@ def insertText(self, data, parent=None):
else:
# HACK: allow text nodes as children of the document node
if hasattr(self.dom, '_child_node_types'):
ifnotNode.TEXT_NODE in self.dom._child_node_types:
if Node.TEXT_NODE not in self.dom._child_node_types:
self.dom._child_node_types = list(self.dom._child_node_types)
self.dom._child_node_types.append(Node.TEXT_NODE)
self.dom.appendChild(self.dom.createTextNode(data))
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp