Hot to remove empty tags

Nov. 18, 2015
4:22 p.m.
Suppose I have this HTML <p>Hello <b> </b><strike>World</strike>. <em></em></p> How can I strip empty tags and tags containing only spaces to get the following output? : <p>Hello <strike>World</strike>.</p>

November 2015
11:06 a.m.
Wednesday, November 18, 2015, 19:22:13 Brijesh:
Suppose I have this HTML <p>Hello <b> </b><strike>World</strike>. <em></em></p>
How can I strip empty tags and tags containing only spaces to get the following output? : <p>Hello <strike>World</strike>.</p>
1)iterate over every tag 2)see if it's empty (=has no children and empty/whitespace .text) 3)delete if it is -- Regards, Ivan Pozdeev
3496
Age (days ago)
3497
Last active (days ago)
1 comments
2 participants
participants (2)
-
Brijesh Bittu
-
Ivan Pozdeev