W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2002

Re: Suspected bug in htmltidy

From: Liam Quinn <liam@htmlhelp.com>
Date: Mon, 10 Jun 2002 17:49:24 -0400 (EDT)
To: John M Collins <jmc@xisl.com>
cc: <html-tidy@w3.org>
Message-ID: <Pine.LNX.4.33L2.0206101746000.14093-100000@localhost.localdomain>

On Sun, 9 Jun 2002, John M Collins wrote:

> I think it gives spurious warnings about "Missing <li>" and inserts
> spurious ones if you use "</li>" with nested lists.
>
> Consider (this is mangled from an auto-generated index):
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
> <html>
> <head>
> <title>Contents</title>
> <link href="TxtMan.css" rel="stylesheet" type="text/css">
> </head>
> <body class="ind">
> <ol>
> <li>First</li>
> <ol>
> <li>Part A</li>
> <li>Part B</li>
> </ol>
> <li>Second</li>
> <ol>
> <li>Part A</li>
> <li>Part B</li>
> </ol>
> </ol>
> </body>
> </html>
>
> Htmltidy bleats about "missing <li>" at the two marked "<ol>"s and
> inserts unwanted "<li>"s in front. All is OK if you skip the "</li>"s.

An OL element can only contain LI elements directly, not other OL
elements.  You need to structure your list like this:

<ol>
  <li>First
    <ol>
      <li>Part A</li>
      <li>Part B</li>
    </ol>
  </li>
  <li>Second
    <ol>
      <li>Part A</li>
      <li>Part B</li>
    </ol>
  </li>
</ol>

-- 
Liam Quinn
Received on Monday, 10 June 2002 17:49:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:52 GMT