diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-02-13 18:28:46 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-02-13 18:28:46 (GMT) |
commit | 5e4d9087046b9e70b76a86b7fb3fc0ad91452abc (patch) | |
tree | c83950fe76ad0b0d9100ce8442a5c4d9c0da1356 | |
parent | 1fd648212e68b83a8bbd7fb628ee2607a5b3a69d (diff) | |
parent | e31ddedb0e5d0151cd4d7821365690ba9d22386d (diff) | |
download | cpython-5e4d9087046b9e70b76a86b7fb3fc0ad91452abc.zip cpython-5e4d9087046b9e70b76a86b7fb3fc0ad91452abc.tar.gz cpython-5e4d9087046b9e70b76a86b7fb3fc0ad91452abc.tar.bz2 |
Merge the indexfix and comments clean up.
-rw-r--r-- | Lib/html/parser.py | 3 | ||||
-rw-r--r-- | Lib/test/test_htmlparser.py | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/html/parser.py b/Lib/html/parser.py index 9db8ab5..aa31fbc 100644 --- a/Lib/html/parser.py +++ b/Lib/html/parser.py @@ -270,12 +270,13 @@ class HTMLParser(_markupbase.ParserBase): if rawdata[i:i+2] != '<!': self.error('unexpected call to parse_html_declaration()') if rawdata[i:i+4] == '<!--': + # this case is actually already handled in goahead() return self.parse_comment(i) elif rawdata[i:i+3] == '<![': return self.parse_marked_section(i) elif rawdata[i:i+9].lower() == '<!doctype': # find the closing > - gtpos = rawdata.find('>', 9) + gtpos = rawdata.find('>', i+9) if gtpos == -1: return -1 self.handle_decl(rawdata[i+2:gtpos]) diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py index 1da2ce4..e2b09a9 100644 --- a/Lib/test/test_htmlparser.py +++ b/Lib/test/test_htmlparser.py @@ -393,7 +393,6 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase): self._run_check("<!DOCTYPE foo $ >", [('decl', 'DOCTYPE foo $ ')]) def test_illegal_declarations(self): - # XXX this might be wrong self._run_check('<!spacer type="block" height="25">', [('comment', 'spacer type="block" height="25"')]) |