summaryrefslogtreecommitdiff
path: root/bs4/tests/test_html5lib.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-15 10:25:56 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-15 10:25:56 -0500
commit6675b6b04bb3228bdca3fe70d1c632c7e180fc31 (patch)
treeffc6e4a48947f7070eed982591ba79b1e13f6ed3 /bs4/tests/test_html5lib.py
parent8d0d071f41c59b16e9f4cf361cf08c3359cce05a (diff)
Tested improvements to html5lib treebuilder.
Diffstat (limited to 'bs4/tests/test_html5lib.py')
-rw-r--r--bs4/tests/test_html5lib.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/bs4/tests/test_html5lib.py b/bs4/tests/test_html5lib.py
index 5b1d1e4..d257392 100644
--- a/bs4/tests/test_html5lib.py
+++ b/bs4/tests/test_html5lib.py
@@ -104,6 +104,27 @@ class TestHTML5BuilderInvalidMarkup(TestLXMLBuilderInvalidMarkup):
self.assertSoupEquals("<table><div>Foo</div></table>",
"<div>Foo</div><table></table>")
+ def test_unclosed_a_tag(self):
+ # n.b. the whitespace is important here.
+ markup = """<div id="1">
+ <a href="foo">
+</div>
+<div id="2">
+ <div id="3">
+ <a href="bar"></a>
+ </div>
+</div>"""
+
+ expect = """<div id="1">
+ <a href="foo">
+</a></div><a href="foo">
+</a><div id="2"><a href="foo">
+ </a><div id="3"><a href="foo">
+ </a><a href="bar"></a>
+ </div>
+</div>"""
+ self.assertSoupEquals(markup, expect)
+
def test_incorrectly_nested_tables(self):
self.assertSoupEquals(
'<table><tr><table><tr id="nested">',