diff options
author | Leonard Richardson <leonardr@segfault.org> | 2013-10-18 13:03:06 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2013-10-18 13:03:06 -0400 |
commit | 991921744807a02f36feaeb9ece9dd519915a886 (patch) | |
tree | b4ace80a186e011267e3a2f9e4c98dc181b5a7ca /bs4/testing.py | |
parent | 81b1a39ab4a233c4fb5fe8aa77e81cd67c44dc78 (diff) |
Fixed yet another problem that caused the html5lib tree builder to
create a disconnected parse tree. [bug=1237763]
Diffstat (limited to 'bs4/testing.py')
-rw-r--r-- | bs4/testing.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py index fd4495a..ce207cf 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -254,6 +254,16 @@ class HTMLTreeBuilderSmokeTest(object): self.assertEqual("p", soup.h2.string.next_element.name) self.assertEqual("p", soup.p.name) + def test_head_tag_between_head_and_body(self): + "Prevent recurrence of a bug in the html5lib treebuilder." + content = """<html><head></head> + <link></link> + <body>foo</body> +</html> +""" + soup = self.soup(content) + self.assertNotEqual(None, soup.html.body) + def test_basic_namespaces(self): """Parsers don't need to *understand* namespaces, but at the very least they should not choke on namespaces or lose |