#32010 closed enhancement (invalid)
get_archives_link breaks HTML5 validation (is in XHTML)
Reported by: | conraid | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1.1 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
get_archives_link in file wp_includes/general-template.php unconditionally ends link tag with '/>' which breaks page validation for HTML5 documents, like default theme and all recent themes.
It's in XHTML syntax, with /> final.
if ('link' == $format) $link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url' />\n";
You could put a condition to choose html or xhtml, or, at this point, putting the default html.
if ('link' == $format) $link_html = "\t<link rel='archives' title='" . esc_attr( $text ) . "' href='$url'>\n";
Change History (6)
#2
follow-up:
↓ 3
@
9 years ago
If I read it properly, it actually says just the opposite:
Void elements only have a start tag; end tags must not be specified for void elements
so they CAN'T have an end tag.
#3
in reply to:
↑ 2
@
9 years ago
Replying to xavivars:
If I read it properly, it actually says just the opposite:
Void elements only have a start tag; end tags must not be specified for void elements
so they CAN'T have an end tag.
This simply means they can't have an end tag - <tag />
is valid, <tag></tag>
is not, check 8.1.2.1 Start tags
point 6 for validation of that.
In HTML5, for void elements, both "/>" and ">" are acceptable. The "/" is optional, see: http://www.w3.org/TR/html5/syntax.html#void-elements