htmlpurifier不允许css重要的decleration

时间:2016-01-22 22:37:19

标签: php html css htmlpurifier

我有以下div。

<div align="center" style="MARGIN-LEFT: 0pt  !important; DISPLAY: block  !important; MARGIN-RIGHT: 0pt  !important; TEXT-INDENT: 0pt  !important"><font style="FONT-SIZE: 10pt  !important; FONT-FAMILY: times new roman  !important; FONT-WEIGHT: bold  !important; DISPLAY: inline  !important">UNITED STATES<font style="FONT-FAMILY: times new roman  !important; DISPLAY: inline  !important">&nbsp;</font></font></div>

用htmlpurifier清理后,删除了重要的声明。 htmlpurifier如何允许它?

我的配置:

$config = HTMLPurifier_Config::createDefault();
$config->set('CSS.Trusted', 'HTML 4.01 Transitional'); 
$purifier = new HTMLPurifier($config);

1 个答案:

答案 0 :(得分:1)

您可以使用CSS.AllowImportant