This is a plugin designed to cleanup bad HTML as well as (if enabled) format code using PHP's Tidy library or DOMDocument. It will also add extra input to post output if configured. The options are all at /wp-admin/options-general.php?page=tidyoutput assuming you have a standard WordPress installation.
Please report any issues at https://github.com/curquhart/wp-tidyoutput.