From 269157a8f40dfdac082f39befd69f170263d2ce1 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Tue, 7 May 2013 08:19:02 -0400 Subject: Now that lxml's segfault on invalid doctype has been fixed, fix a corresponding problem on the Beautiful Soup end that was previously invisible. [bug=984936] --- bs4/testing.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bs4/testing.py') diff --git a/bs4/testing.py b/bs4/testing.py index c9307d3..ed71d3b 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -81,6 +81,11 @@ class HTMLTreeBuilderSmokeTest(object): self.assertDoctypeHandled( 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"') + def test_empty_doctype(self): + soup = self.soup("") + doctype = soup.contents[0] + self.assertEqual("", doctype.strip()) + def test_public_doctype_with_url(self): doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"' self.assertDoctypeHandled(doctype) -- cgit v1.2.3