This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients nowasky.jr, vstinner
Date 2020-09-09.13:57:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1599659866.22.0.0213769977095.issue41748@roundup.psfhosted.org>
In-reply-to
Content
HTML 5.2 specification says
https://www.w3.org/TR/html52/syntax.html#elements-attributes

"Attribute names must consist of one or more characters other than the space characters, U+0000 NULL, U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+003E GREATER-THAN SIGN (>), U+002F SOLIDUS (/), and U+003D EQUALS SIGN (=) characters, the control characters, and any characters that are not defined by Unicode."

It is confirmed in the "12.2 Parsing HTML documents" section of the "HTML Living Standard":
"""
12.2.5.33 Attribute name state

Consume the next input character:

U+0009 CHARACTER TABULATION (tab)
U+000A LINE FEED (LF)
U+000C FORM FEED (FF)
U+0020 SPACE
U+002F SOLIDUS (/)
U+003E GREATER-THAN SIGN (>)
EOF
    Reconsume in the after attribute name state.
U+003D EQUALS SIGN (=)
    Switch to the before attribute value state.
ASCII upper alpha
    Append the lowercase version of the current input character (add 0x0020 to the character's code point) to the current attribute's name.
U+0000 NULL
    This is an unexpected-null-character parse error. Append a U+FFFD REPLACEMENT CHARACTER character to the current attribute's name.
U+0022 QUOTATION MARK (")
U+0027 APOSTROPHE (')
U+003C LESS-THAN SIGN (<)
    This is an unexpected-character-in-attribute-name parse error. Treat it as per the "anything else" entry below.
Anything else
    Append the current input character to the current attribute's name.
"""
https://html.spec.whatwg.org/multipage/parsing.html#attribute-name-state

I understand that "," *is* a legit character in a HTML attribute name. So "a," and ",a" *are* valid HTML attribute names. Do I understand correctly?
History
Date User Action Args
2020-09-09 13:57:46vstinnersetrecipients: + vstinner, nowasky.jr
2020-09-09 13:57:46vstinnersetmessageid: <1599659866.22.0.0213769977095.issue41748@roundup.psfhosted.org>
2020-09-09 13:57:46vstinnerlinkissue41748 messages
2020-09-09 13:57:45vstinnercreate