fix normalize-text-nodes, patch by Andy Chambers