Ticket #17632 (new defect (bug))

Opened 9 months ago

Last modified 3 months ago

HTML 5 Validation issues (theme independent)

Reported by: amirhabibi Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version: 3.1.3
Severity: normal Keywords: has-patch
Cc: lynne.pope@…

Description

Wordpress often adds the rel attribute to links.

For example rel="category" or rel="attachment" etc...

Apparently these keywords are not allowed in html 5 :

 http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#linkTypes

So the validation fails :-/

These attributes are a bit hardcoded. You can use regex in filters or javascript solutions to remove them, but this is not a good solution.

I think this problem is now a bug, if you consider the importance of code validation.

Attachments

17632.patch Download (618 bytes) - added by SergeyBiryukov 6 months ago.

Change History

  • Keywords close added

Does the value of the rel attribute actually have anything to do with validation? The list of existing rel values on the Microformats site does not appear to form part of the HTML 5 spec but acts as a de-facto list, from what I can see. Please correct me if I am wrong.

On a different note, the HTML 5 spec is a  long way from being final. Definitely not a good idea to go pre-emptively changing things in core yet.

I understand that html5 is not final, but having control over the hardcoded keywords would be nice and will make wordpress validate in html5 without custom fuctions...

  • Keywords needs-patch added; close removed

This issue probably shouldn't be titled "HTML5 Validation" because it relates to ALL validation.

Neither category or attachment are valid microformats, no matter whether you use HTML or XHTML. They never have been. Where WordPress outputs rel="category" it should be rel="tag". While there is currently no microformat for attachments there is case to be made for changing this to rel="enclosure".

rel="enclosure" is still just a draft but its already in use and likely to be approved. It's already recognised in the Atom Syndication Format ( http://www.ietf.org/rfc/rfc4287.txt).

  • Cc lynne.pope@… added
  • Version changed from 3.1.3 to 3.2.1

In HTML5, the tag element is allowed as a rel property (see  http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#linkTypes ) so it should be rel="tag" and the word category should be removed. This should fix this validation issue.

  • Keywords has-patch added; needs-patch removed
  • Version changed from 3.2.1 to 3.1.3

Related: [2164], [4790]

17632.patch Download removes rel="category", leaving rel="tag".

comment:7 follow-up: ↓ 8   nacin3 months ago

Shouldn't categories be rel="tag" then? Categories are a valid taxonomy classification.

comment:8 in reply to: ↑ 7   SergeyBiryukov3 months ago

Replying to nacin:

Shouldn't categories be rel="tag" then?

That's what the patch does.

As "tag" represents taxonomy basically, dropping "category" sounds great. If anyone objects, perhaps at least a filter?

Note: See TracTickets for help on using tickets.