summaryrefslogtreecommitdiff
path: root/bs4/tests/test_html5lib.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2012-08-21 09:13:11 -0400
committerLeonard Richardson <leonardr@segfault.org>2012-08-21 09:13:11 -0400
commit1bdebd326cec9699cd18f040a32a79b8b925eb84 (patch)
treec33860d35fc43f81af423703130fbd7c68505c20 /bs4/tests/test_html5lib.py
parentd95ac0003965b4c70157d456fce4d5f1e03ab2d6 (diff)
Fixed a problem with the html5lib builder not handling comments correctly.
Diffstat (limited to 'bs4/tests/test_html5lib.py')
-rw-r--r--bs4/tests/test_html5lib.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bs4/tests/test_html5lib.py b/bs4/tests/test_html5lib.py
index f195f7d..0e1c1d8 100644
--- a/bs4/tests/test_html5lib.py
+++ b/bs4/tests/test_html5lib.py
@@ -56,3 +56,17 @@ class HTML5LibBuilderSmokeTest(SoupTest, HTML5TreeBuilderSmokeTest):
"<table><thead><tr><td>Foo</td></tr></thead>"
"<tbody><tr><td>Bar</td></tr></tbody>"
"<tfoot><tr><td>Baz</td></tr></tfoot></table>")
+
+ def test_xml_declaration_followed_by_doctype(self):
+ markup = '''<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html>
+ <head>
+ </head>
+ <body>
+ <p>foo</p>
+ </body>
+</html>'''
+ soup = self.soup(markup)
+ # Verify that we can reach the <p> tag; this means the tree is connected.
+ self.assertEquals("<p>foo</p>", soup.p.encode())