diff options
author | Leonard Richardson <leonardr@segfault.org> | 2017-05-06 21:31:10 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2017-05-06 21:31:10 -0400 |
commit | e21aa406ab7c524692e2d462e1f30a4c37b1f0fc (patch) | |
tree | 409ea0066143454155fb4bd401c66558b9fcafc8 /bs4/testing.py | |
parent | a8a9224b7f97e882cc8ec712323d8b86631e42e9 (diff) | |
download | beautifulsoup4-e21aa406ab7c524692e2d462e1f30a4c37b1f0fc.tar.gz |
Improved the handling of empty-element tags like <br> when using the
html.parser parser. [bug=1676935]
Diffstat (limited to 'bs4/testing.py')
-rw-r--r-- | bs4/testing.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py index 9d89de7..40ccac6 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -342,6 +342,13 @@ Hello, world! self.assertEqual("p", soup.p.name) self.assertConnectedness(soup) + def test_empty_element_tags(self): + """Verify consistent handling of empty-element tags, + no matter how they come in through the markup. + """ + self.assertSoupEquals('<br/><br/><br/>', "<br/><br/><br/>") + self.assertSoupEquals('<br /><br /><br />', "<br/><br/><br/>") + def test_head_tag_between_head_and_body(self): "Prevent recurrence of a bug in the html5lib treebuilder." content = """<html><head></head> |