Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e31ddedb
Commit
e31ddedb
authored
Feb 13, 2012
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an index and clean up comments.
parent
7f728c1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
Lib/html/parser.py
Lib/html/parser.py
+2
-1
Lib/test/test_htmlparser.py
Lib/test/test_htmlparser.py
+0
-1
No files found.
Lib/html/parser.py
View file @
e31ddedb
...
@@ -270,12 +270,13 @@ class HTMLParser(_markupbase.ParserBase):
...
@@ -270,12 +270,13 @@ class HTMLParser(_markupbase.ParserBase):
if
rawdata
[
i
:
i
+
2
]
!=
'<!'
:
if
rawdata
[
i
:
i
+
2
]
!=
'<!'
:
self
.
error
(
'unexpected call to parse_html_declaration()'
)
self
.
error
(
'unexpected call to parse_html_declaration()'
)
if
rawdata
[
i
:
i
+
4
]
==
'<!--'
:
if
rawdata
[
i
:
i
+
4
]
==
'<!--'
:
# this case is actually already handled in goahead()
return
self
.
parse_comment
(
i
)
return
self
.
parse_comment
(
i
)
elif
rawdata
[
i
:
i
+
3
]
==
'<!['
:
elif
rawdata
[
i
:
i
+
3
]
==
'<!['
:
return
self
.
parse_marked_section
(
i
)
return
self
.
parse_marked_section
(
i
)
elif
rawdata
[
i
:
i
+
9
].
lower
()
==
'<!doctype'
:
elif
rawdata
[
i
:
i
+
9
].
lower
()
==
'<!doctype'
:
# find the closing >
# find the closing >
gtpos
=
rawdata
.
find
(
'>'
,
9
)
gtpos
=
rawdata
.
find
(
'>'
,
i
+
9
)
if
gtpos
==
-
1
:
if
gtpos
==
-
1
:
return
-
1
return
-
1
self
.
handle_decl
(
rawdata
[
i
+
2
:
gtpos
])
self
.
handle_decl
(
rawdata
[
i
+
2
:
gtpos
])
...
...
Lib/test/test_htmlparser.py
View file @
e31ddedb
...
@@ -393,7 +393,6 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
...
@@ -393,7 +393,6 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
self
.
_run_check
(
"<!DOCTYPE foo $ >"
,
[(
'decl'
,
'DOCTYPE foo $ '
)])
self
.
_run_check
(
"<!DOCTYPE foo $ >"
,
[(
'decl'
,
'DOCTYPE foo $ '
)])
def
test_illegal_declarations
(
self
):
def
test_illegal_declarations
(
self
):
# XXX this might be wrong
self
.
_run_check
(
'<!spacer type="block" height="25">'
,
self
.
_run_check
(
'<!spacer type="block" height="25">'
,
[(
'comment'
,
'spacer type="block" height="25"'
)])
[(
'comment'
,
'spacer type="block" height="25"'
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment