diff options
Diffstat (limited to 'src/beautifulsoup/tests')
-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>')) + + + |