{"action":"opened","issue":{"url":"https://api.github.com/repos/html5lib/html5lib-python/issues/239","repository_url":"https://api.github.com/repos/html5lib/html5lib-python","labels_url":"https://api.github.com/repos/html5lib/html5lib-python/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/html5lib/html5lib-python/issues/239/comments","events_url":"https://api.github.com/repos/html5lib/html5lib-python/issues/239/events","html_url":"https://github.com/html5lib/html5lib-python/issues/239","id":152831206,"number":239,"title":"DOM tree builder leading to IndexError","user":{"login":"gsnedders","id":176218,"avatar_url":"https://avatars.githubusercontent.com/u/176218?v=3","gravatar_id":"","url":"https://api.github.com/users/gsnedders","html_url":"https://github.com/gsnedders","followers_url":"https://api.github.com/users/gsnedders/followers","following_url":"https://api.github.com/users/gsnedders/following{/other_user}","gists_url":"https://api.github.com/users/gsnedders/gists{/gist_id}","starred_url":"https://api.github.com/users/gsnedders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsnedders/subscriptions","organizations_url":"https://api.github.com/users/gsnedders/orgs","repos_url":"https://api.github.com/users/gsnedders/repos","events_url":"https://api.github.com/users/gsnedders/events{/privacy}","received_events_url":"https://api.github.com/users/gsnedders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-03T17:32:37Z","updated_at":"2016-05-03T17:32:37Z","closed_at":null,"body":"```\r\nimport html5lib\r\n\r\nhtml5lib.parseFragment('<math><tr><td><mo><tr>',\r\n                       container=\"td\",\r\n                       treebuilder=\"dom\")\r\n```\r\n\r\nThis causes:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"foo.py\", line 5, in <module>\r\n    treebuilder=\"dom\")\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 36, in parseFragment\r\n    return p.parseFragment(doc, container=container, encoding=encoding)\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 253, in parseFragment\r\n    self._parse(stream, True, container=container, encoding=encoding)\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 94, in _parse\r\n    self.mainLoop()\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 199, in mainLoop\r\n    new_token = phase.processStartTag(new_token)\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 480, in processStartTag\r\n    return self.startTagHandler[token[\"name\"]](token)\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 2175, in startTagTableOther\r\n    self.closeCell()\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 2161, in closeCell\r\n    self.endTagTableCell(impliedTagToken(\"td\"))\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/html5parser.py\", line 2197, in endTagTableCell\r\n    self.tree.clearActiveFormattingElements()\r\n  File \"/Users/gsnedders/Documents/my-projects/html5lib/html5lib-python/html5lib/treebuilders/_base.py\", line 228, in clearActiveFormattingElements\r\n    entry = self.activeFormattingElements.pop()\r\nIndexError: pop from empty list\r\n```"}}