Tidy Request

Three requests for the Best Program in the World(tm):

1)  If there is no ALT attribute for an image, have Tidy put in an 'alt=""'.
(Note: this might cause some people problems, since they might want omitted ALTs
to be flagged by a validator as a reminder for "Whoops, you forgot to put in
alternate text".  So perhaps it should be a configurable option:
"empty-alt-attributes: yes" or some such.)

2)  I discovered this when transferring some old markup containing a client side
imagemap to XHTML.  The new XHTML had <map name="...">, but XHTML (and HTML
4.01) require ID as well, so it didn't validate.  So perhaps when Tidy sees a
NAME attribute with no corresponding ID attribute, it should insert the ID
attribute with the same value as the NAME one ...

3)  It would be nice if Tidy's clean option would take the BGCOLOR and
BACKGROUND attributes of BODY, TD, TR, TABLE and convert them to CSS classes
like it does FONT[1].  Same with BODY's TEXT, LINK, ALINK, and VLINK attributes
(eg. with '<body vlink="blue">', it deletes the attribute and inserts "a:visited
{ color: blue }" into the embedded CSS).  (Those who care excessively about 'how
it looks on old browsers' may want to keep *some* presentational HTML, so
perhaps this should be done only when clean is specified *with* one of the
Strict DOCTYPEs?)

[1] Note the transitional DTD does not have a BACKGROUND attribute for TD, TR,
and TABLE, but at least for TD I have seen it used on a number of occasions
("DTD? What's a bloody DTD?" :), so perhaps Tidy should replace a BACKGROUND
attribute on *any* [x]HTML element with a CLASS="whatever" and a corresponding
CSS declaration.

/Jelks

Received on Thursday, 30 September 1999 04:02:24 UTC