[BUG?] TD inline content not accepted with strict doctype

Hello TidyFolks,

The following HTML code:

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
  <html>
  <head>
  <title>X</title>
  </head>
  <body>
  <table>
  <tr>
  <td>Some text.</td>
  </tr>
  </table>
  </body>
  </html>

...validates as strict HTML 4.01, according to the W3C validator.  However, 
Tidy 4-Aug-00 complains:

  line 17 column 1 - Warning: html doctype doesn't match content
  t.html: Doctype given is "-//W3C//DTD HTML 4.01//EN"
  t.html: Document content looks like HTML 3.2

...and will tidy the resulting output by replacing the doctype with one for 
HTML 3.2.  In order to convince Tidy that this is valid HTML 4.01 Strict, 
one must place "Some text" in a paragraph element:

  <td><p>Some text.</p></td>

This apparently is required by code in the "ParseBlock" routine of 
"parser.c", specifically lines 661-666:

  /*
    HTML4 strict doesn't allow mixed content for
    elements with %block; as their content model
  */
    lexer->versions &= ~VERS_HTML40_STRICT;
    continue;

Is Tidy wrong here, or is the W3C validator?  It appears to me that Tidy is 
in error, as the TD element is not %block but rather %flow:

  <!ELEMENT (TH|TD) - O (%flow;)* -- table header cell, table data cell-->

where %flow is:

  <!ENTITY % flow "%block; | %inline;">

So the inline content should be acceptable in HTML 4.01 strict.

                                      -- Dave

Received on Monday, 1 January 2001 20:03:04 UTC