HtmlPurifier - keeps removing my tables - what is the right config?

265 views
Skip to first unread message

Curtis Newton

unread,
Sep 5, 2019, 6:52:00 AM9/5/19
to htmlpurifier

Hello,

I have a table that keeps beeing removed by html purifier the content is an email that needs to be populated

<table>
<thead>
    <th>fieldA</th>
    <th>fieldB</th>
    <th>fieldC</th>
    <th>fieldD</th>
</thead>
<tbody>
<!--[[[order_list]]]-->     
</tbody>
</table>

where < ! - - [[[order_list]]] - - > is replaced at runtime, but htmlpurifier keeps removing my table (the comments are there for ckeditor, otherwise it gets removed)

I tried to disable the AutoFormat.RemoveEmpty :

 $config = \HTMLPurifier_Config::createDefault();
 $config->set('AutoFormat.RemoveEmpty', false);
 Validator::$purifier = new \HTMLPurifier($config);
 $val=Validator::$purifier->purify($data);

it does not work at all, the table yet gets removed

how can I fix this ?

thanks

Reply all
Reply to author
Forward
0 new messages