Fix bug in elements with separate TEXT_NODES.

Also added the test case to example.html