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:
Fred Drake 2001-09-04 16:26:03 +00:00
parent a0ca3d611e
commit 7cf613dc77
2 changed files with 17 additions and 37 deletions

View file

@ -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", "<")])])