Welcome! » Log In » Create A New Profile

Stop placing elements on single line

Posted by jd 
jd
Stop placing elements on single line
May 06, 2016 03:12PM

Hi,

I have a tiny little issue with this great library. I have this source html:

<ul>
    <li>xyz</li>
    <li>xyz</li>
    <li>xyz</li>
</ul>

<ol>
    <li>xyz</li>
    <li>xyz</li>
    <li>xyz</li>
</ol>

<img src="http://example.com/image.jpg" alt="Image" />

but HTML PURIFIER returns the given code in this form:

<ul><li>xyz</li>
    <li>xyz</li>
    <li>xyz</li>
</ul><ol><li>xyz</li>
    <li>xyz</li>
    <li>xyz</li>
</ol><img src="http://example.com/image.jpg" alt="Image" />

My configuration is this:

$config = \HTMLPurifier_Config::createDefault();
$config->set(&#039;HTML.Allowed&#039;, &#039;p,h2,h3,h4,h5,h6,strong,em,u,strike,a[href],ul,ol,li,img[src|alt]&#039;);

Can I forbid HTML PURIFIER to distord the code and keep it as it was given?

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