diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 9c593aa85d9..899c4383986 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1943,13 +1943,8 @@ in src-script.js and main.js
pixels to avoid overflowing the topbar when the user sets a bigger
font size. */
font-size: 24px;
- }
-
- .mobile-topbar h2 a {
- display: block;
- text-overflow: ellipsis;
- overflow: hidden;
white-space: nowrap;
+ text-overflow: ellipsis;
}
.mobile-topbar .logo-container > img {
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index b46701b55ea..b26efb75ff6 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -45,7 +45,7 @@ function setMobileTopbar() {
const mobileTitle = document.createElement("h2");
mobileTitle.className = "location";
if (hasClass(document.querySelector(".rustdoc"), "crate")) {
- mobileTitle.innerText = `Crate ${window.currentCrate}`;
+ mobileTitle.innerHTML = `Crate ${window.currentCrate}`;
} else if (locationTitle) {
mobileTitle.innerHTML = locationTitle.innerHTML;
}