<?phpfunction smarty_outputfilter_tidyrepairhtml($source, &$smarty){ if(extension_loaded('tidy')) { tidy_parse_string($source); tidy_clean_repair(); return tidy_get_output(); } return $source;}?>