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

Suggestion: convert some attribute values to lowercase

From: Andrzej Novosiolov <anovos@rs-ukraine.kiev.ua>
Date: Tue, 22 Feb 2000 12:02:14 +0200
Message-Id: <200002221002.MAZ52143@zirafe.carrier.kiev.ua>
To: html-tidy@w3.org
Just a cosmetic change. Since Tidy by default converts tags and attributes
to lowercase, why not to convert to lowercase some attribute values which
are known to be case-insensitive, for example for align= and valign=
attributes?

Of course, it must be optional. The conversion may be added to attrs.c module,
for example:

void wstrtolower(char *s)
{
    for (; *s; s++)
      *s = (char)ToLower((uint)*s);
}

void CheckAlign(Lexer *lexer, Node *node, AttVal *attval)
{

/* ... some code skipped ... */

    else if (! (wstrcasecmp(value, "left") == 0 ||
                wstrcasecmp(value, "center") == 0 ||
                wstrcasecmp(value, "right") == 0 ||
                wstrcasecmp(value, "justify") == 0))
          ReportAttrError(lexer, node, attval->value, BAD_ATTRIBUTE_VALUE);
    else if (LowerCaseValues)
          wstrtolower(value);
}
Received on Tuesday, 22 February 2000 05:02:44 GMT

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