Validate the HTML. I believe html tidy is being integrated into upcoming releases of PHP. Until then, install a tidy binary on your server, run the input through tidy to fix common user idiocy, and post the result.
Tidy is available from tidy.sourceforge.net.
I wrote the following awhile back to brute-force user input through tidy. Since tidy makes the input into a complete HTML document, and I only want the snippet, I pluck it out of the tidyized data using a regular expression.
function validate($input)
{
$input = stripslashes($input);
$input = ereg_replace("\r\n\r\n", "\n<p>", $input);
$input = str_replace('\n','<p>',$input);
$input = "<p>$input";
$input = strip_tags($input,'<blockquote><a><b><i><img><br><u><p><em>');
$temp = tempnam('/tmp','foo');
$tf = fopen($temp, 'w');
fwrite($tf, $input);
fclose($tf);
$input = `/usr/local/bin/tidy -indent $temp`;
ereg('(<body>)(.*)(<\/body>)', $input, $matches);
$input = $matches[2];
unlink($temp);
return addslashes($input);
}