Opened 14 years ago
Last modified 2 years ago
#17520 new enhancement
cite element used incorrectly
Reported by: | holizz | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch needs-refresh |
Focuses: | Cc: |
Description
Here's what the HTML5 specification says about the cite element:
The cite element represents the title of a work (e.g. a book, a paper, an essay, a poem, a score, a song, a script, a film, a TV show, a game, a sculpture, a painting, a theatre production, a play, an opera, a musical, an exhibition, a legal case report, etc). […]
A person's name is not the title of a work — even if people call that person a piece of work — and the element must therefore not be used to mark up people's names. (In some cases, the b element might be appropriate for names; e.g. in a gossip article where the names of famous people are keywords rendered with a different style to draw attention to them. In other cases, if an element is really needed, the span element can be used.)
The element is used plugins/hello.php correctly to mark up the title "Hello, Dolly". But many more places it is used incorrectly to mark up an author's name.
The obvious fix would be to replace all but the one correct instance of the cite element with spans with an appropriate class.
Attachments (1)
Change History (12)
#2
@
14 years ago
According to the HTML 4.01 spec (XHTML 1.0 doesn't define any elements - it relies on HTML4 for that):
CITE:
Contains a citation or a reference to other sources.
http://www.w3.org/TR/html4/struct/text.html#edef-CITE
I wouldn't consider a person's name to fit that definition, though it's not as specific about names as the HTML5 spec.
And cite does appear several places outside of wp-admin.
#4
@
13 years ago
Some of these cite tags were immediately stripped out just after being defined anyway, in other places I double checked with firebug to make sure all styles are maintained
#6
@
13 years ago
- Component changed from General to Administration
- Milestone changed from Awaiting Review to 3.3
It's HTML5 time.
#10
@
2 years ago
- Component changed from Administration to General
- Milestone set to Future Release
Looks like the milestone was removed on this one, so re-adding.
Looks like there are 6 occurrences of <cite>
in core itself today and 9 occurrences across 5 default themes.
4 tags are found within wp-admin/includes
should be able to get changed without much ripple effect. The <cite>
tags within wp_widget_rss_output()
, Walker_Comment::comment()
, and the default themes will be more difficult because they could cause display issues with themes or child themes for bundled themes.
One way this could be addressed is by using the html5
feature of add_theme_support()
/current_theme_supports()
to allow theme authors to opt into the switch. I don't love requiring themes to opt-in to the correct behavior, but another backwards compatible approach is not yet coming to mind.
According to the working draft for HTML5 you are correct about cite. However, that's for HTML5 and the WordPress admin doctype is XHTML 1.0 Transitional.
It seems to me that we're fine until we switch wp-admin to HTML5. I could see possibly fixing the one occurrence of this in twentyeleven, but even then it doesn't seem like this is a bug.