Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Namespace Sensitivity; Fragment leading to IndexError #239

Copy link
Copy link
Closed
@gsnedders

Description

@gsnedders
Issue body actions
import html5lib

html5lib.parseFragment('<math><tr><td><mo><tr>',
                       container="td")

This causes:

Traceback (most recent call last):
  File "foo.py", line 5, in <module>
    treebuilder="dom")
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 36, in parseFragment
    return p.parseFragment(doc, container=container, encoding=encoding)
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 253, in parseFragment
    self._parse(stream, True, container=container, encoding=encoding)
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 94, in _parse
    self.mainLoop()
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 199, in mainLoop
    new_token = phase.processStartTag(new_token)
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 480, in processStartTag
    return self.startTagHandler[token["name"]](token)
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 2175, in startTagTableOther
    self.closeCell()
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 2161, in closeCell
    self.endTagTableCell(impliedTagToken("td"))
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py", line 2197, in endTagTableCell
    self.tree.clearActiveFormattingElements()
  File "/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/treebuilders/_base.py", line 228, in clearActiveFormattingElements
    entry = self.activeFormattingElements.pop()
IndexError: pop from empty list

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.