Rollup merge of #137068 - tapanprakasht:fix-copy-item-path, r=aDotInTheVoid
fix(rustdoc): Fixed `Copy Item Path` in rust doc
This PR aims to address the issue reported by https://github.com/rust-lang/rust/issues/137048
Issue caused by previous changes for removing `@ts-expect-error` by this change 2ea95f8670
This commit is contained in:
commit
29e2caf7c3
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue