about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/main.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-16 01:29:09 +0000
committerbors <bors@rust-lang.org>2025-02-16 01:29:09 +0000
commit500a686ba8bb1b51df7e7f8f81d286b2e20209ff (patch)
treea7d6969c682059d906e33ff189816feb67e0b413 /src/librustdoc/html/static/js/main.js
parente72df78268bafbfe28366aa0e382713f55a491e7 (diff)
parentb3d5a770f696460c3eb513e1804a59dbb04641d9 (diff)
downloadrust-500a686ba8bb1b51df7e7f8f81d286b2e20209ff.tar.gz
rust-500a686ba8bb1b51df7e7f8f81d286b2e20209ff.zip
Auto merge of #137093 - matthiaskrgr:rollup-72j7mut, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #127581 (Fix crate name validation)
 - #136490 (Do not allow attributes on struct field rest patterns)
 - #136808 (Try to recover from path sep error in type parsing)
 - #137055 (rustdoc: Properly restore search input placeholder)
 - #137068 (fix(rustdoc): Fixed `Copy Item Path` in rust doc)
 - #137070 (Do not generate invalid links in job summaries)
 - #137074 (compiletest: add `{ignore,only}-rustc_abi-x86-sse2` directives)
 - #137076 (triagebot.toml: ping me on changes to `tests/rustdoc-json`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/html/static/js/main.js')
-rw-r--r--src/librustdoc/html/static/js/main.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index a348c6c5678..e46cc1897e9 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -2039,7 +2039,10 @@ function preLoadCss(cssUrl) {
         // Most page titles are '<Item> in <path::to::module> - Rust', except
         // modules (which don't have the first part) and keywords/primitives
         // (which don't have a module path)
-        const [item, module] = document.title.split(" in ");
+        const titleElement = document.querySelector("title");
+        const title = titleElement && titleElement.textContent ?
+                      titleElement.textContent.replace(" - Rust", "") : "";
+        const [item, module] = title.split(" in ");
         const path = [item];
         if (module !== undefined) {
             path.unshift(module);