diff options
author | Leonard Richardson <leonardr@segfault.org> | 2012-06-30 10:43:47 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2012-06-30 10:43:47 -0400 |
commit | 7a47c96f352aafcae4ad280e4d3d8456b53d7ffe (patch) | |
tree | 15413efa4810c902b4d3cc5222e905fd6abc8627 /bs4/testing.py | |
parent | 093ec128d5732b02e75df2566c7db2c6e381d766 (diff) |
Fixed an html5lib tree builder crash which happened when html5lib
moved a tag with a multivalued attribute from one part of the tree to
another. [bug=1019603]
Diffstat (limited to 'bs4/testing.py')
-rw-r--r-- | bs4/testing.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py index 5a84b0b..51f7e22 100644 --- a/bs4/testing.py +++ b/bs4/testing.py @@ -202,6 +202,14 @@ class HTMLTreeBuilderSmokeTest(object): "<tbody><tr><td>Bar</td></tr></tbody>" "<tfoot><tr><td>Baz</td></tr></tfoot></table>") + def test_deeply_nested_multivalued_attribute(self): + # html5lib can set the attributes of the same tag many times + # as it rearranges the tree. This has caused problems with + # multivalued attributes. + markup = '<table><div><div class="css"></div></div></table>' + soup = self.soup(markup) + self.assertEqual(["css"], soup.div.div['class']) + def test_angle_brackets_in_attribute_values_are_escaped(self): self.assertSoupEquals('<a b="<a>"></a>', '<a b="<a>"></a>') |