Skip to content

XXX-undefined-error generated while recovering from a mismatched tag error #70

Open
@gsnedders

Description

@gsnedders

http://code.google.com/p/html5lib/issues/detail?id=176

Reported by eric.promislow, Feb 23, 2011

For this standalone code (Python 2.6, html5lib 0.90):

import cStringIO, html5lib, pprint

text = """
<!DOCTYPE html>
Here's a table
<table>
<caption>Stuff goes here</bogus>
<tr><td>col</td><td>another</td></tr>
</table>
"""
inputStream = cStringIO.StringIO(text)
parser = html5lib.HTMLParser()
doc = parser.parse(inputStream)
errors = parser.errors
pprint.pprint(errors)

I get this output:

[((5, 32), 'unexpected-end-tag', {'name': u'bogus'}),
 ((6, 4), 'XXX-undefined-error', {})]

Quick first look at the code, I would say that end-tags that aren't
in self.tree.openElements should be popped as part of error-recovery,
but then, I just started working with this project a few hours ago...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions