Welcome! » Log In » Create A New Profile

Broken table layout

Posted by pkuliga 
Broken table layout
January 31, 2012 10:15AM

Hello, please check this code: jsfiddle<antiaksimetdot>net/2Gjtt/

The same HTML code after purification: bit<antiaksimetdot>ly/Aj6RzP

As you can see table layout is broken. I know that this HTML code is not valid but I would like to keep table layout after purification. Is any change to fix this?

Raw HTML:

<table border="1">
    <tr>
        <td>
            <table border="1" cellspacing="0" cellpadding="0">
                <tr>
                    <th colspan="3">
                        Informacja o pasa?erach
                    </th>
                </tr>
                <td>
                    Tytu?
                </td>
                <td>
                    Imi?
                </td>
                <td>
                    Nazwisko
                </td>
                <tr>
                    <td>
                        XXX
                    </td>
                    <td>
                        XXX
                    </td>
                    <td>
                        XXX
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
Re: Broken table layout
January 31, 2012 01:26PM

Hmm, that sounds like HTML Purifier's table parsing algorithm is slightly off. What if you set %Core.LexerImpl to PH5P?

Re: Broken table layout
February 02, 2012 06:45AM

I have encountered the same problem with DOMLex as well as with DirectLex.

Re: Broken table layout
February 02, 2012 07:54AM

Yes, I want to know what happens when you use PH5P.

Re: Broken table layout
February 02, 2012 09:37AM

PH5P has solved this problem but it seems that PH5P is slower than DOMLex/DirectLex. Some of my tests works well with DOMLex/DirectLex but with PH5P I get a timeout. I cannot use this :(.

Re: Broken table layout
February 02, 2012 09:41AM

*nod* That's not too surprising. Unfortunately, there is not really much that can be done at the moment.

Re: Broken table layout
February 02, 2012 10:58AM

Ok, thanks for the response anyway. I would be glad, if you could take a look at it in the future.

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with &lt; and &gt;.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: