Welcome! » Log In » Create A New Profile

How disable syntax repair?

Posted by KillerBee 
How disable syntax repair?
April 24, 2017 04:44AM

I have HTML5 source with (simplyfied) allowed code:

<a href="..."><div>Text</div></a>

HTMLPurifer converted this wrong to: (because its validate it as HTML4, where DIV in A was not allowed. In HTML5 its now allowed.)

<a href="..."></a><div><a href="...">Text</a></div><a href="..."></a>

How I can disable HTML4 repair in HTMLPurifier 4.9.2? libtidy is unusable with HTML5. For repairing HTML5-text I load the text in DomDocument() and after I give it to HTMLPurifier (is not the best, but only solution I found). So I don't need extra repair/validation in HTMLPurifer.

That setting not help:

$config->set('HTML.TidyLevel', 'none');

Can anybody help here?

Re: How disable syntax repair?
April 24, 2017 12:13PM

Maybe you can modify the allowed children of a tags. See http://htmlpurifier.org/docs/enduser-customize.html

Sorry, you do not have permission to post/reply in this forum.