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

Re: More trivial suggestions for Tidy

From: J. David Bryan <jdbryan@acm.org>
Date: Thu, 22 Feb 2001 03:37:24 -0500
Message-Id: <200102220837.f1M8bRb26827@mail.bcpl.net>
To: HTML Tidy List <html-tidy@w3.org>
On 21 Feb 2001, at 14:39, Eric Richards wrote:

> (1)  the <style> tags are not correctly indented (using -i).

There is an explicit check for the STYLE and SCRIPT start tags in 
"pprint.c" at line 1243 that prevents indenting of these elements.  I 
suspect that the reason is this note in the HTML 4.01 Specification 
(Section 6.2, CDATA):

   Although the STYLE and SCRIPT elements use CDATA for their data model,
   for these elements, CDATA must be handled differently by user agents.
   Markup and entities must be treated as raw text and passed to the
   application as is.

I would surmise that this might be to avoid turning a style rule such as:

   P { font-family: "Times New Roman", serif }


   P { font-family: "Times 
   New Roman", serif }

...when indenting.

> (2)  it would be helpful to have the name of the attribute that has an
> erroneous value (e.g. "null")....

Please give an example of what you mean.  If I have this line in a file to 
be tidied:

  <p align="fizzle">text</p>

...I get this warning from Tidy:

  line 16 column 1 - Warning: <p> unknown attribute value "fizzle"

Is this not what you want?

> (3)  list separators are sometimes a space and other times semicolons:
> what rule governs which applies ? 

I don't understand your reference to list separators.  Can you give an 

> Does (or can) summary get auto-inserted, as in <table summary=" "> so
> when you get reminded that you forgot the summary, you can just fill in
> the space. 

I'm not convinced that auto-insertion of required or recommended attributes 
is good.  Tidy flags a missing TABLE summary attribute with this comment:

  "The table summary attribute should be used to describe the table
   structure. It is very helpful for people using non-visual browsers."

Auto-inserting a meaningless (null) attribute would then suppress the 
warning, and the value might never be filled in.  I suspect Dave Raggett 
might agree, given the very strong warning associated with the "alt-text" 
option description on the HTML Tidy home page.

A better approach, rather than auto-inserting dummy attribute values, might 
be to have an option to suppress accessibility warnings.  This would have 
the advantage that the suppression could be turned off.  Conversely, once 
null attribute values were inserted, Tidy would be unable to generate 
accessibility warnings thereafter.

> Then there is height, width, as in  <img height=" " width=" "> to stop
> moving text when you first visit a web site... 

The HTML 4.01 DTD contains this comment on the LENGTH entity (used to 
specify the values of the width and height attributes):

  "nn for pixels or nn% for percentage length"

Therefore, it appears to me that a null width or height would be invalid, 
and Tidy should not generate invalid markup, even as a temporary measure 
(i.e., even subject to further author editing).

Moreover, I don't believe that this will do what you want, as the text 
"moves" because the user agent doesn't know the size of the image until 
it's retrieved.  Specifying a null width and height still won't give the 
browser the information needed to reserve space for the image in the 

                                      -- Dave Bryan
Received on Thursday, 22 February 2001 03:37:30 UTC

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