diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2010-12-29 19:08:27 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2010-12-29 19:08:27 -0500 |
commit | a8ca557241716636bca4697d4894278ed3d22ce4 (patch) | |
tree | c1b31f6d95914dae42c26f045b1e22ce3b55930a | |
parent | 484284c0c80aa749ee3050a3194d7bc99cf2916b (diff) |
Moved over a test for incorrectly nested tables.
-rw-r--r-- | src/beautifulsoup/tests/helpers.py | 6 | ||||
-rw-r--r-- | src/beautifulsoup/tests/test_html5lib.py | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/beautifulsoup/tests/helpers.py b/src/beautifulsoup/tests/helpers.py index c8189e3..20d087e 100644 --- a/src/beautifulsoup/tests/helpers.py +++ b/src/beautifulsoup/tests/helpers.py @@ -145,4 +145,10 @@ class BuilderInvalidMarkupSmokeTest(SoupTest): soup = self.soup("<table><td nowrap>foo</td></table>") self.assertEquals(soup.table.td['nowrap'], '') + def test_incorrectly_nested_tables(self): + self.assertSoupEquals( + '<table><tr><table><tr id="nested">', + '<table><tr><table><tr id="nested"></tr></table></tr></table>') + + diff --git a/src/beautifulsoup/tests/test_html5lib.py b/src/beautifulsoup/tests/test_html5lib.py index f66e750..4ffd968 100644 --- a/src/beautifulsoup/tests/test_html5lib.py +++ b/src/beautifulsoup/tests/test_html5lib.py @@ -22,3 +22,12 @@ class TestHTML5BuilderInvalidMarkup(BuilderInvalidMarkupSmokeTest): self.assertSoupEquals( '<blockquote><p><b>Foo</blockquote><p>Bar', '<blockquote><p><b>Foo</b></p></blockquote><p><b>Bar</b></p>') + + def test_incorrectly_nested_tables(self): + self.assertSoupEquals( + '<table><tr><table><tr id="nested">', + ('<table><tbody><tr></tr></tbody></table>' + '<table><tbody><tr id="nested"></tr></tbody></table>')) + + + |