diff options
author | Leonard Richardson <leonardr@segfault.org> | 2016-12-19 18:43:56 -0500 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2016-12-19 18:43:56 -0500 |
commit | 234baf054be09c9d63e6ab55dc5e5ed542fe0139 (patch) | |
tree | 7f1215a1566b8fb2f4ad11d92017a10fde6e82c0 /bs4/tests/test_html5lib.py | |
parent | d6e8f7a6f52685f22562a285ea23ada6819bb685 (diff) |
Fixed yet another problem that caused the html5lib tree builder to
Diffstat (limited to 'bs4/tests/test_html5lib.py')
-rw-r--r-- | bs4/tests/test_html5lib.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bs4/tests/test_html5lib.py b/bs4/tests/test_html5lib.py index 8e3cba6..2eb41b3 100644 --- a/bs4/tests/test_html5lib.py +++ b/bs4/tests/test_html5lib.py @@ -95,6 +95,23 @@ class HTML5LibBuilderSmokeTest(SoupTest, HTML5TreeBuilderSmokeTest): assert space1.next_element is tbody1 assert tbody2.next_element is space2 + def test_reparented_markup_containing_children(self): + markup = '<div><a>aftermath<p><noscript>target</noscript>aftermath</a></p></div>' + soup = self.soup(markup) + noscript = soup.noscript + self.assertEqual("target", noscript.next_element) + target = soup.find(string='target') + + # The 'aftermath' string was duplicated; we want the second one. + final_aftermath = soup.find_all(string='aftermath')[-1] + import pdb; pdb.set_trace() + + # The <noscript> tag was moved beneath a copy of the <a> tag, + # but the 'target' string within is still connected to the + # (second) 'aftermath' string. + self.assertEqual(final_aftermath, target.next_element) + self.assertEqual(target, final_aftermath.previous_element) + def test_processing_instruction(self): """Processing instructions become comments.""" markup = b"""<?PITarget PIContent?>""" |