+if (extension_loaded('tidy') && (isset($Settings['clean_html']) && $Settings['clean_html']==true)) {
+ $tidyxhtml = false;
+ if($Settings['output_type']=="html") {
+ $tidyxhtml = false; }
+ if($Settings['output_type']=="xhtml") {
+ $tidyxhtml = true; }
+ if($Settings['output_type']!="html" && $Settings['output_type']!="xhtml") {
+ $tidyxhtml = false; }
+ $config = array(
+ 'indent' => true,
+ 'clean' => true,
+ 'output-xhtml' => $tidyxhtml,
+ 'show-body-only' => true,
+ 'wrap' => 0);
+ $output = tidy_parse_string($output, $config, 'UTF8');
+ $output ->cleanRepair(); }