html5lib tree builder can build a disconnected tree
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Originally reported here: http://
This only happens using the html5lib treebuilder.
Minimal markup that causes the problem:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://
<head>
</head>
<body>
</body>
</html>
When immediately preceded by a doctype (or, presumably, another comment, since html5lib turns the doctype into a comment) , the comment is parsed but not connected to the rest of the tree.
The underlying cause is Element.
Changed in beautifulsoup: | |
status: | Fix Committed → Fix Released |
"When immediately preceded by a doctype (or, presumably, another comment, since html5lib turns the doctype into a comment) , the comment"
should be
"When immediately preceded by a declaration (or, presumably, a comment, since html5lib turns the declaration into a comment) , the doctype"