Status: New
Owner: ----
New issue 207 by daniel.l...@gmail.com: 2 nested formatting tags causes a
TypeError
http://code.google.com/p/html5lib/issues/detail?id=207
{{{
import html5lib
from html5lib import treebuilders
s = '''<html>
<head></head>
<body>
<font><font></font></font>
</body>
</html>'''
parser =
html5lib.HTMLParser(tree=treebuilders.getTreeBuilder('beautifulsoup'))
r=parser.parse(s)
}}}
The bug appear when two formatting tags are nested.
In this way, html5lib call ''isMatchingFormattingElement'' and test
attribute length list.
{{{
def isMatchingFormattingElement(self, node1, node2):
if node1.name != node2.name or node1.namespace != node2.namespace:
return False
elif len(node1.attributes) != len(node2.attributes):
return False
else:
attributes1 = sorted(node1.attributes.items())
}}}
where nodeX.attributes are AttrList.
In my case, I fix the probleme by query the length on attributes.items().
{{{
def isMatchingFormattingElement(self, node1, node2):
if node1.name != node2.name or node1.namespace != node2.namespace:
return False
elif len(node1.attributes.items()) != len(node2.attributes.items()):
return False
else:
attributes1 = sorted(node1.attributes.items())
}}}
Maybe the problem is BeautifulSoup (3.2.1)?
--
You received this message because you are subscribed to the Google Groups
"html5lib-discuss" group.
To post to this group, send an email to html5lib-discuss@googlegroups.com.
To unsubscribe from this group, send email to
html5lib-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/html5lib-discuss?hl=en-GB.