<?php function smarty_outputfilter_tidyrepairhtml($source, &$smarty) { if(extension_loaded('tidy')) { return tidy_repair_string($source); } } ?>