We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Copy Item Path
1 parent 54a0f38 commit 02f1f34Copy full SHA for 02f1f34
src/librustdoc/html/static/js/main.js
@@ -2039,7 +2039,10 @@ function preLoadCss(cssUrl) {
2039
// Most page titles are '<Item> in <path::to::module> - Rust', except
2040
// modules (which don't have the first part) and keywords/primitives
2041
// (which don't have a module path)
2042
- const [item, module] = document.title.split(" in ");
+ const titleElement = document.querySelector("title");
2043
+ const title = titleElement && titleElement.textContent ?
2044
+ titleElement.textContent.replace(" - Rust", "") : "";
2045
+ const [item, module] = title.split(" in ");
2046
const path = [item];
2047
if (module !== undefined) {
2048
path.unshift(module);
0 commit comments