Forum Moderators: open

Message Too Old, No Replies

Bug in html-tidy?

Ignores unclosed <p> and <li> in xhtml

         

Mohamed_E

8:32 pm on Mar 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tidy for Windows seems to miss unclosed <p> and <li> in xhtml:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Bug that Tidy misses</title>
</head>
<body>
<h1>Bug that Tidy misses</h1>
<p>This para is unclosed.
<ul>
<li>Unclosed list item.
</ul>
</body> </html>
validates with tidy, in spite of the unclosed <p> and <li> tags. It does pick up an unclosed <br>, though.

To me this is a major annoyance. As a command line tool it allows me to do exactly what I want, validate all or any subset of my files, etc. I have posted a bug report at SourceForge, hope it gets fixed.

The objective of this is partly to warn any other tidy users of the bug, but also to solicit help in choosing a flexible, command line based validator.

In fact, any validator that can validate multiple files without too much messing around.

g1smd

9:23 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What does [validator.w3.org...] say about that exact code?

Mohamed_E

10:46 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Below are the results of attempting to parse this document with an SGML parser.

1. Line 10, column 3: document type does not allow element "ul" here; missing one of "object", "ins", "del", "map", "button" start-tag

<ul>
^

2. Line 12, column 4: end tag for "li" omitted, but OMITTAG NO was specified

</ul>
^

3. Line 11, column 0: start tag was here (explain...).

<li>Unclose list item.
^

4. Line 13, column 6: end tag for "p" omitted, but OMITTAG NO was specified

</body> </html>
^

5. Line 9, column 0: start tag was here (explain...).

<p>This para is unclosed.
^

[edited by: tedster at 1:39 pm (utc) on Mar. 25, 2004]
[edit reason] fix scrollism [/edit]

g1smd

11:06 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yep, as expected.

You cannot have a list inside a paragraph. You have to have </p> before the <ul>. The W3C validator has the correct response.

File a bug report for the other one, for sure.

Mohamed_E

12:04 am on Mar 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



File a bug report for the other one, for sure.

I never doubted that it was a bug, I filed a bug report [sourceforge.net] immediately, was dismayed when I read that reporting omitted end tags was a feature [tidy.sf.net] that had been requested since June 2001 :(