Skip to content

Commit e079ed7

Browse files
committed
auto merge of #17529 : nodakai/rust/rustdoc-div-in-h1, r=alexcrichton
W3C HTML5 spec states that H1 must enclose "phrasing content" which doesn't include DIV. But SPAN is OK. http://www.w3.org/TR/html5/sections.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements
2 parents 94b0aac + 6fd144c commit e079ed7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustdoc/html/render.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ impl<'a> Item<'a> {
13041304
impl<'a> fmt::Show for Item<'a> {
13051305
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
13061306
// Write the breadcrumb trail header for the top
1307-
try!(write!(fmt, "\n<h1 class='fqn'><div class='in-band'>"));
1307+
try!(write!(fmt, "\n<h1 class='fqn'><span class='in-band'>"));
13081308
match self.item.inner {
13091309
clean::ModuleItem(ref m) => if m.is_crate {
13101310
try!(write!(fmt, "Crate "));
@@ -1337,8 +1337,9 @@ impl<'a> fmt::Show for Item<'a> {
13371337
// Write stability level
13381338
try!(write!(fmt, "<wbr>{}", Stability(&self.item.stability)));
13391339

1340+
try!(write!(fmt, "</span>")); // in-band
13401341
// Links to out-of-band information, i.e. src and stability dashboard
1341-
try!(write!(fmt, "</div><div class='out-of-band'>"));
1342+
try!(write!(fmt, "<span class='out-of-band'>"));
13421343

13431344
// Write stability dashboard link
13441345
match self.item.inner {
@@ -1370,7 +1371,7 @@ impl<'a> fmt::Show for Item<'a> {
13701371
}
13711372
}
13721373

1373-
try!(write!(fmt, "</div>"));
1374+
try!(write!(fmt, "</span>")); // out-of-band
13741375

13751376
try!(write!(fmt, "</h1>\n"));
13761377

0 commit comments

Comments
 (0)