1
Feh. Can't get around PRE tags, but adding this above the default line works well. It eliminates line breaks around HTML tags.
//Remove white space between HTML tags and a preceding or following new line.
//(And the new line itself.)
$text = preg_replace("/(<.*?>)s*[rn]s*/","$1", $text);
$text = preg_replace("/s*[rn]s*(<.*?>)/","$1", $text);