in reply to Perl HTML::Tidy

did you read all the good stuff in https://metacpan.org/pod/HTML::Tidy ?

You will probably want to run tidyp -help-config for the list of options supported by tidyp.