0
我试图禁用超链接和使用HTMLPurifier显示他们以纯文本格式,但我没有得到正确的。这里是我的代码:配置HTMLPurifier禁用超链接
$html ='<a href="http://www.localhost.com/">link</a><b>test</b>';
require_once 'include/htmlpurifier/library/HTMLPurifier.auto.php';
$Config = HTMLPurifier_Config::createDefault();
$Config->set('AutoFormat.DisplayLinkURI', true);
$purifier = new HTMLPurifier();
$html = $purifier->purify($html);
echo $html;
的电流输出为:
<a href="http://www.localhost.com/">link</a><b>test</b>
问题是什么?输出应该是:
<a>link</a> (http://www.localhost.com/)<b>test</b>