I am creating a site for any client (only a new layout, site already is available, and it is completed in Joomla 1.7). I have got an issue with articles, done via WYSIWYG editor by client. Why? Well, code it's pretty screwed up. You will find many empty tags, like:
<p></p> <p> </p>
as well as:
<p><span style="color: #008000;"><span style="font-size: medium;"><strong> </strong></span></span></p>
EDIT: So, solution by kitgui.com have been effective - read this wordpress plugin - http://code.google.com/p/jquery-clean/ - works like no bodies business.
You can implement some postprocessing when saving, while using Tidy class. Tidy is loaded with lots of configuration options and you will cleanup individuals empty tags with merely a couple of lines of code.
Something similar to:
<?php $html = "MESSY HTML HERE"; $tidy = tidy_parse_string($html); $tidy->cleanRepair(); echo $tidy; ?>
in the finish before saving..