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

Commitb7cce84

Browse files
committed
Remove trailing whitespace (fixes#18).
1 parentcaec8e9 commitb7cce84

36 files changed

+460
-460
lines changed

‎html5lib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__importabsolute_import,division,unicode_literals
22

3-
"""
3+
"""
44
HTML parsing library based on the WHATWG "HTML5"
55
specification. The parser is designed to be compatible with existing
66
HTML found in the wild and implements well-defined error recovery that
@@ -10,7 +10,7 @@
1010
1111
import html5lib
1212
f = open("my_document.html")
13-
tree = html5lib.parse(f)
13+
tree = html5lib.parse(f)
1414
"""
1515
__version__="0.95-dev"
1616
from .html5parserimportHTMLParser,parse,parseFragment

‎html5lib/constants.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
EOF=None
77

88
E= {
9-
"null-character":
9+
"null-character":
1010
_("Null character in input stream, replaced with U+FFFD."),
11-
"invalid-codepoint":
11+
"invalid-codepoint":
1212
_("Invalid codepoint in stream."),
1313
"incorrectly-placed-solidus":
1414
_("Solidus (/) incorrectly placed in tag."),
@@ -378,7 +378,7 @@
378378
(namespaces["html"],"iframe"),
379379
# Note that image is commented out in the spec as "this isn't an
380380
# element that can end up on the stack, so it doesn't matter,"
381-
(namespaces["html"],"image"),
381+
(namespaces["html"],"image"),
382382
(namespaces["html"],"img"),
383383
(namespaces["html"],"input"),
384384
(namespaces["html"],"isindex"),
@@ -3069,7 +3069,7 @@
30693069
"ParseError":7
30703070
}
30713071

3072-
tagTokenTypes=frozenset((tokenTypes["StartTag"],tokenTypes["EndTag"],
3072+
tagTokenTypes=frozenset((tokenTypes["StartTag"],tokenTypes["EndTag"],
30733073
tokenTypes["EmptyTag"]))
30743074

30753075

‎html5lib/filters/optionaltags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __iter__(self):
1616
forprevious,token,nextinself.slider():
1717
type=token["type"]
1818
iftype=="StartTag":
19-
if (token["data"]or
19+
if (token["data"]or
2020
notself.is_optional_start(token["name"],previous,next)):
2121
yieldtoken
2222
eliftype=="EndTag":
@@ -123,10 +123,10 @@ def is_optional_end(self, tagname, next):
123123
# there is no more content in the parent element.
124124
iftypein ("StartTag","EmptyTag"):
125125
returnnext["name"]in ('address','article','aside',
126-
'blockquote','datagrid','dialog',
126+
'blockquote','datagrid','dialog',
127127
'dir','div','dl','fieldset','footer',
128128
'form','h1','h2','h3','h4','h5','h6',
129-
'header','hr','menu','nav','ol',
129+
'header','hr','menu','nav','ol',
130130
'p','pre','section','table','ul')
131131
else:
132132
returntype=="EndTag"ortypeisNone

‎html5lib/html5parser.py

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

‎html5lib/ihatexml.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
letter=" | ".join([baseChar,ideographic])
1919

20-
#Without the
21-
name=" | ".join([letter,digit,".","-","_",combiningCharacter,
20+
#Without the
21+
name=" | ".join([letter,digit,".","-","_",combiningCharacter,
2222
extender])
2323
nameFirst=" | ".join([letter,"_"])
2424

@@ -40,7 +40,7 @@ def charStringToList(chars):
4040
break
4141
ifnotfoundMatch:
4242
assertlen(item)==1
43-
43+
4444
rv.append([ord(item)]*2)
4545
rv=normaliseCharList(rv)
4646
returnrv
@@ -62,7 +62,7 @@ def normaliseCharList(charList):
6262

6363
#We don't really support characters above the BMP :(
6464
max_unicode=int("FFFF",16)
65-
65+
6666
defmissingRanges(charList):
6767
rv= []
6868
ifcharList[0]!=0:
@@ -103,8 +103,8 @@ def escapeRegexp(string):
103103

104104
classInfosetFilter(object):
105105
replacementRegexp=re.compile(r"U[\dA-F]{5,5}")
106-
def__init__(self,replaceChars=None,
107-
dropXmlnsLocalName=False,
106+
def__init__(self,replaceChars=None,
107+
dropXmlnsLocalName=False,
108108
dropXmlnsAttrNs=False,
109109
preventDoubleDashComments=False,
110110
preventDashAtCommentEnd=False,
@@ -124,7 +124,7 @@ def coerceAttribute(self, name, namespace=None):
124124
ifself.dropXmlnsLocalNameandname.startswith("xmlns:"):
125125
warnings.warn("Attributes cannot begin with xmlns",DataLossWarning)
126126
returnNone
127-
elif (self.dropXmlnsAttrNsand
127+
elif (self.dropXmlnsAttrNsand
128128
namespace=="http://www.w3.org/2000/xmlns/"):
129129
warnings.warn("Attributes cannot be in the xml namespace",DataLossWarning)
130130
returnNone
@@ -140,7 +140,7 @@ def coerceComment(self, data):
140140
warnings.warn("Comments cannot contain adjacent dashes",DataLossWarning)
141141
data=data.replace("--","- -")
142142
returndata
143-
143+
144144
defcoerceCharacters(self,data):
145145
ifself.replaceFormFeedCharacters:
146146
foriinrange(data.count("\x0C")):
@@ -166,7 +166,7 @@ def toXmlName(self, name):
166166
replacement=self.getReplacementCharacter(char)
167167
nameRestOutput=nameRestOutput.replace(char,replacement)
168168
returnnameFirstOutput+nameRestOutput
169-
169+
170170
defgetReplacementCharacter(self,char):
171171
ifcharinself.replaceCache:
172172
replacement=self.replaceCache[char]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp