有谁知道我应该如何配置HtmlPurifier来忽略<pre>标签内的内容?目前我有这样的事情:
require_once('HTMLPurifier.auto.php');
$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
$config->set('Attr.AllowedFrameTargets', array('_blank'));
$config->set('HTML.Trusted', true);
$config->set('HTML.SafeObject', true);
$config->set('Output.FlashCompat', true);
$config->set('Filter.Custom', array( new HTMLPurifier_Filter_SafeIframe() ));
$config->set('Attr.EnableID', true);
$def = $config->getHTMLDefinition(true);
$def->addAttribute('a', 'href*', 'URI');
$def->addAttribute('a', 'rel', 'CDATA');
$objPurifier = new HTMLPurifier($config);
return $objPurifier->purify($string);