W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2001

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

From: J. David Bryan <dbryan@bcpl.net>
Date: Mon, 1 Jan 2001 19:55:12 -0500 (EST)
Message-Id: <200101020055.TAA04466@mail.bcpl.net>
To: HTML Tidy List <html-tidy@w3.org>
Hello TidyFolks,

The following HTML code:

  <td>Some text.</td>

...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;

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:49 UTC