The problem happens when the second whitespace node is reparented into the <table> tag. object_was_parsed() looks through the new parent's .contents to find where exactly the new node ended up, but it uses .index(), which does a comparison based on the == operator. In this case there are two identical whitespace nodes, and object_was_parsed() chooses the wrong one, putting the tree in an inconsistent state.
This is fixed in revision 409. I changed object_was_parsed() to start from the right side of the list (where it's more likely the reparented node will show up) and to do a comparison based on the is operator rather than ==.
The problem happens when the second whitespace node is reparented into the <table> tag. object_was_parsed() looks through the new parent's .contents to find where exactly the new node ended up, but it uses .index(), which does a comparison based on the == operator. In this case there are two identical whitespace nodes, and object_was_parsed() chooses the wrong one, putting the tree in an inconsistent state.
This is fixed in revision 409. I changed object_was_parsed() to start from the right side of the list (where it's more likely the reparented node will show up) and to do a comparison based on the is operator rather than ==.