* @param int course id * @param string text to be filtered */ function tidy_filter($courseid, $text) { /// Configuration for tidy. Feel free to tune for your needs, e.g. to allow /// proprietary markup. $tidyoptions = array( 'output-xhtml' => true, 'show-body-only' => true, 'tidy-mark' => false, 'drop-proprietary-attributes' => true, 'drop-font-tags' => true, 'drop-empty-paras' => true, 'indent' => true, 'quiet' => true, ); /// Do a quick check using strpos to avoid unnecessary work if (strpos($text, '<') === false) { return $text; } /// If enabled: run tidy over the entire string if (function_exists('tidy_repair_string')){ $text = tidy_repair_string($text, $tidyoptions, 'utf8'); } return $text; } ?>