html5lib tree builder sometimes creates tags with no next_element
Bug #1182089 reported by
Leonard Richardson
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Discussion:
https:/
Since the html5lib tree builder constantly rearranges the tree as it builds it, bugs like this are annoyingly common.
Changed in beautifulsoup: | |
status: | New → Fix Committed |
Changed in beautifulsoup: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Minimal case that makes it obvious there's a problem:
--- string. next_element
from bs4 import BeautifulSoup
data = """
<html>
<h2>
foo</h2>
<p></p>
</html>
"""
soup = BeautifulSoup(data, 'html5lib')
print soup.h2.
print soup.p
---
The newline and the text within the <h2> tag are both essential to reproducing the problem.