Skip to content

Commit

Permalink
Switch item-info div to span to generate valid HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 6, 2022
1 parent 201cf3d commit d48a39a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@ fn document_item_info(
) {
let item_infos = short_item_info(item, cx, parent);
if !item_infos.is_empty() {
w.write_str("<div class=\"item-info\">");
w.write_str("<span class=\"item-info\">");
for info in item_infos {
w.write_str(&info);
}
w.write_str("</div>");
w.write_str("</span>");
}
}

Expand Down Expand Up @@ -1772,7 +1772,7 @@ pub(crate) fn render_impl_summary(
let is_trait = i.inner_impl().trait_.is_some();
if is_trait {
if let Some(portability) = portability(&i.impl_item, Some(parent)) {
write!(w, "<div class=\"item-info\">{}</div>", portability);
write!(w, "<span class=\"item-info\">{}</span>", portability);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ h2.location a {
border: none;
}

.item-info {
display: block;
}

.content .item-info code {
font-size: 0.875rem;
}
Expand Down

0 comments on commit d48a39a

Please sign in to comment.