summaryrefslogtreecommitdiff
path: root/bs4/testing.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2015-06-23 22:28:11 -0400
committerLeonard Richardson <leonardr@segfault.org>2015-06-23 22:28:11 -0400
commit8debf2223c681551659dc52eb570be0e0140c003 (patch)
tree346d4a6ff238a6c207f97158eb82fdb8f72814af /bs4/testing.py
parent3541d3382be957274fec29a699595dd7a348c390 (diff)
downloadbeautifulsoup4-8debf2223c681551659dc52eb570be0e0140c003.tar.gz
Got a hacky fix for the latest html5lib problem.
Diffstat (limited to 'bs4/testing.py')
-rw-r--r--bs4/testing.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py
index a85ecd6..dfaa047 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -286,6 +286,24 @@ Hello, world!
soup = self.soup(content)
self.assertNotEqual(None, soup.html.body)
+ def test_multiple_copies_of_a_tag(self):
+ "Prevent recurrence of a bug in the html5lib treebuilder."
+ content = """<!DOCTYPE html>
+<html>
+ <body>
+ <article id="a" >
+ <div><a href="1"></div>
+ <footer>
+ <a href="2"></a>
+ </footer>
+ </article>
+ </body>
+</html>
+"""
+ soup = self.soup(content)
+ [x for x in soup.article.descendants]
+
+
def test_basic_namespaces(self):
"""Parsers don't need to *understand* namespaces, but at the
very least they should not choke on namespaces or lose