mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
HTMLParser is allowed to be more strict than sgmllib, so let's not
change their basic behavior: When parsing something that cannot possibly be valid in either HTML or XHTML, raise an exception.
This commit is contained in:
parent
a0ca3d611e
commit
7cf613dc77
2 changed files with 17 additions and 37 deletions
|
@ -203,12 +203,7 @@ DOCTYPE html [
|
|||
])
|
||||
|
||||
def test_illegal_declarations(self):
|
||||
s = 'abc<!spacer type="block" height="25">def'
|
||||
self._run_check(s, [
|
||||
("data", "abc"),
|
||||
("unknown decl", 'spacer type="block" height="25"'),
|
||||
("data", "def"),
|
||||
])
|
||||
self._parse_error('<!spacer type="block" height="25">')
|
||||
|
||||
def test_starttag_end_boundary(self):
|
||||
self._run_check("""<a b='<'>""", [("starttag", "a", [("b", "<")])])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue