From 991921744807a02f36feaeb9ece9dd519915a886 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Fri, 18 Oct 2013 13:03:06 -0400 Subject: Fixed yet another problem that caused the html5lib tree builder to create a disconnected parse tree. [bug=1237763] --- bs4/testing.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bs4/testing.py') 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 = """ + + foo + +""" + 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 -- cgit v1.2.3