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: Fri, 24 Mar 2000 11:47:13 -0600
To: html-tidy@w3.org
Message-ID: <OF807C936C.A0480931-ON8625688D.0037378B@rfdinc.com>

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 Friday, 24 March 2000 13:12:55 GMT

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