Skip to content

Commit

Permalink
Fix item-info display
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 18, 2022
1 parent 86c6ebe commit fe6956b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,10 @@ fn short_item_info(
message.push_str(&format!(": {}", html.into_string()));
}
extra_info.push(format!(
"<div class=\"stab deprecated\"><span class=\"emoji\">👎</span> {}</div>",
"<div class=\"stab deprecated\">\
<span class=\"emoji\">👎</span>\
<span>{}</span>\
</div>",
message,
));
}
Expand All @@ -582,8 +585,9 @@ fn short_item_info(
.filter(|stab| stab.feature != sym::rustc_private)
.map(|stab| (stab.level, stab.feature))
{
let mut message =
"<span class=\"emoji\">🔬</span> This is a nightly-only experimental API.".to_owned();
let mut message = "<span class=\"emoji\">🔬</span>\
<span>This is a nightly-only experimental API."
.to_owned();

let mut feature = format!("<code>{}</code>", Escape(feature.as_str()));
if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, issue) {
Expand All @@ -594,7 +598,7 @@ fn short_item_info(
));
}

message.push_str(&format!(" ({})", feature));
message.push_str(&format!(" ({})</span>", feature));

extra_info.push(format!("<div class=\"stab unstable\">{}</div>", message));
}
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ so that we can apply CSS-filters to change the arrow color in themes */

.stab .emoji {
font-size: 1.25rem;
margin-right: 0.3rem;
}

/* Black one-pixel outline around emoji shapes */
Expand Down

0 comments on commit fe6956b

Please sign in to comment.