Removes end tags for some endless tags

modification to handle self closing empty or void tags