[wp-trac] [WordPress Trac] #6592: IDs must begin with a letter in
HTML/XHTML, but _wp_unfiltered_html_comment does not.
WordPress Trac
wp-trac at lists.automattic.com
Fri Apr 4 20:46:51 GMT 2008
#6592: IDs must begin with a letter in HTML/XHTML, but _wp_unfiltered_html_comment
does not.
-----------------------+----------------------------------------------------
Reporter: guillep2k | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.7
Component: General | Version: 2.5
Severity: normal | Keywords:
-----------------------+----------------------------------------------------
The comments section uses a hidden field with name
_wp_unfiltered_html_comment. Although the W3C validator doesn't mark it as
an error, XHTML/HTML IDs must begin with a letter (we can say even the W3C
validator is not perfect!).
The HTML specification, at section 6.2
(http://www.w3.org/TR/html401/types.html#type-id), clearly states that all
IDs must start with a letter. For XHTML you have to dig a little deeper:
at section 4.10 (http://www.w3.org/TR/xhtml1/#h-4.10) it says "in XHTML
1.0 the id attribute is defined to be of type ID"; then in XML
specification you must follow the ID type (http://www.w3.org/TR/2000/REC-
xml-20001006#id) to "Names and Tokens" (http://www.w3.org/TR/2000/REC-
xml-20001006#NT-Name), where it says "[5] Name ::= (Letter | '_' | ':')
(NameChar?)*", ruling out IDs starting with underscores. Therefore, I
think that the _wp_unfiltered_html_comment id breaks XHTML validity. In
any case, changing it "to be 100% sure" wouldn't hurt. ;) The affected
files are only two: wp-comments-post.php:38 and comment-template.php:610
(as of version 2.5).
--
Ticket URL: <http://trac.wordpress.org/ticket/6592>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list