html5lib tree builder sometimes creates tags with no next_element

Bug #1182089 reported by Leonard Richardson
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Beautiful Soup
Fix Released
Undecided
Unassigned

Bug Description

Discussion:

https://groups.google.com/d/topic/beautifulsoup/fwgw0XJaf0o/discussion

Since the html5lib tree builder constantly rearranges the tree as it builds it, bugs like this are annoyingly common.

Revision history for this message
Leonard Richardson (leonardr) wrote :

Minimal case that makes it obvious there's a problem:

---
from bs4 import BeautifulSoup
data = """
<html>
<h2>
foo</h2>
<p></p>
</html>
"""
soup = BeautifulSoup(data, 'html5lib')
print soup.h2.string.next_element
print soup.p
---

The newline and the text within the <h2> tag are both essential to reproducing the problem.

Changed in beautifulsoup:
status: New → Fix Committed
Changed in beautifulsoup:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.