michaelrsweet / htmldoc

HTML Conversion Software
https://www.msweet.org/htmldoc
GNU General Public License v2.0
206 stars 46 forks source link

Table row without closing tag no longer rendered correctly #494

Closed howff closed 6 months ago

howff commented 1 year ago

HTML table rows without a closing tag </tr> are no longer rendered correctly. I tried with --no-strict but it made no difference. No dangling errors are reported with --strict anyway. Previous versions of htmldoc worked fine.

michaelrsweet commented 1 year ago

What version of HTMLDOC did you use previously?

howff commented 1 year ago

Sorry the machine I used to use has been wiped so I can't find out which version but it's safe to say it would have been several years ago (possibly 2014-2016).

michaelrsweet commented 1 year ago

Ok well please provide a sample html file that isn’t converting properly and I’ll look at it.

howff commented 1 year ago

Here's two tables, one works and the other doesn't

<html><head><title>Title</title></head><body>
        <h1>Table is rendered incorrectly</h1>
        <table>
            <tr>
                <th>Heading 1
                <th>Heading 2
            <tr>
                <td>Col 1
                <td>Col 2
        </table>
        <h1>Table is OK because &lt;/tr&gt;</h1>
        <table>
            <tr>
                <th>Heading 1
                <th>Heading 2
            </tr>
            <tr>
                <td>Col 1
                <td>Col 2
            </tr>
        </table>
    </body>
</html>
michaelrsweet commented 1 year ago

OK, thanks I've reproduced the issue. This might have changed between some 1.8.x release and the current one - might be a regression from a fix (2c47d1f88765bbfc77dffa5b885fbc3f386a3ddb) I made a little over 4 years ago,

michaelrsweet commented 6 months ago

[master c897072] Fix handling of missing close TRs (Issue #494)

howff commented 6 months ago

Thanks very much :-)