diff options
author | Leonard Richardson <leonardr@segfault.org> | 2015-06-23 22:28:11 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2015-06-23 22:28:11 -0400 |
commit | 1023fcb63bc75a3f41ca385b655d6943d1273278 (patch) | |
tree | 551755a7bf02218c8891e643e2e05c0243075c20 /bs4/testing.py | |
parent | 81b0e7160db445f9d8fb8bf09ba306df87cac19e (diff) |
Got a hacky fix for the latest html5lib problem.
Diffstat (limited to 'bs4/testing.py')
-rw-r--r-- | bs4/testing.py | 18 |
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 |