diff options
author | Leonard Richardson <leonardr@segfault.org> | 2018-07-15 08:27:40 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2018-07-15 08:27:40 -0400 |
commit | 15038b22ea020ea79928af2831c4b1dff869bcd4 (patch) | |
tree | 9b1104a2a07a14aaa7e522b3f3cf88ace387206f /bs4/tests/test_htmlparser.py | |
parent | a0457769bbdc682569dd41a48ae5acb1f21481cb (diff) |
Stop data loss when encountering an empty numeric entity, and
possibly in other cases. Thanks to tos.kamiya for the fix. [bug=1698503]
Diffstat (limited to 'bs4/tests/test_htmlparser.py')
-rw-r--r-- | bs4/tests/test_htmlparser.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bs4/tests/test_htmlparser.py b/bs4/tests/test_htmlparser.py index c13d59f..0381c7d 100644 --- a/bs4/tests/test_htmlparser.py +++ b/bs4/tests/test_htmlparser.py @@ -34,6 +34,11 @@ class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest): self.assertSoupEquals('<br></br><br></br><br></br>', "<br/><br/><br/>") self.assertSoupEquals('</br></br></br>', "") + def test_empty_element(self): + # This verifies that any buffered data present when the parser + # finishes working is handled. + self.assertSoupEquals("foo &# bar", "foo &# bar") + class TestHTMLParserSubclass(SoupTest): def test_error(self): |