2008/12/25 Danny B. Wikipedia.Danny.B@email.cz:
I have reverted both revisions in r45021 and r45022 because it caused massive invalidity of pages.
The id attribute in XHTML is defined as /[A-Za-z][A-Za-z0-9:_.-]*/ [1][2]- and that's exactly why we use <a name="..."> in cases where the following <h#> tag doesn't have id because of these restrictions. The name attribute is of NMTOKEN [3] thus allows to begin with non-alpha character.
[1] http://www.w3.org/TR/html401/types.html#type-name [2] http://www.w3.org/TR/xhtml1/#C_8 [3] http://www.w3.org/TR/2000/WD-xml-2e-20000814#NT-Nmtoken
As your own link [1] says, names in HTML4 are already only allowed to begin with a letter. See also your own link [2]: "the type of the name attribute has been changed to NMTOKEN. This attribute is constrained such that it can only have the same values as type ID". Anything that's valid in an a element's name attribute in XHTML 1 is valid as an XML ID.
Note that all section names are passed through Sanitizer::escapeId() right now. They should be passed with the Sanitizer::NONE option (that's poorly named, isn't it?) to prepend an "x" if they don't start with a letter, but currently they aren't, I guess for backward compatibility. That could probably be changed without much harm (add the flag to line 3618 in Parser.php).
What page, specifically, exhibited a regression in standards compliance, and why do you think that it was actually a regression? Did new validator failures occur? I ran a test page through a validator:
http://validator.w3.org/check?uri=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FUser%3ASimetrical%2FAnchor_name_test&charset=(detect+automatically)&doctype=Inline&group=0
The validator also says (emphasis added) "id *AND NAME* attributes must begin with a letter, not a digit."