fix textContent for nodes that do not have children

fixes #483