CHtmlPurifier, enable comments

I tried to enable comments in a CHtmlPurifier object (which are disabled by default), but it’s not working:


$p = new CHtmlPurifier();

$p->options = array('HTML.AllowedComments'=>array(true));

any ideas?

Guess you are after:




$p->options = array('HTML.AllowedCommentsRegexp'=> '/.*/');



Since HTML.AllowedComments can be only used for something like:




$p->options = array('HTML.AllowedComments'=> array('<!-- pagebreak -->'));



Great, this is exactly what I was looking for!

This worked:




$p->options = array('HTML.AllowedCommentsRegexp'=> '/.*/');



But this didn’t work (I put first a <!-- pagebreak --> comment in the text):




$p->options = array('HTML.AllowedComments'=> array('<!-- pagebreak -->'));



I think the Html Purifier manual says you should do this:




$p->options = array('HTML.AllowedComments'=> array(' pagebreak '));



you almost hit the mark! This worked (without spaces):


$p->options = array('HTML.AllowedComments'=> array('pagebreak'));