Is it possible for a RegEx to clean up whitespace in HTML?
For example:
<p><b>foo</b> <i>bar</i></p>
<p>foo</p> <p>bar</p>
On the first line, the space between the closing b and opening i tag is valid (although it could be a ), however on the second line it is whitespace that I wish to clean up as it shouldn't have any semantic value.
Perhaps this would be better solved with DOM traversal?