Skip to content

Tweak how the "copy path" rustdoc button works to allow some accessibility tool to work with rustdoc#155395

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
GuillaumeGomez:copy-path-with-ronga
Apr 17, 2026
Merged

Tweak how the "copy path" rustdoc button works to allow some accessibility tool to work with rustdoc#155395
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
GuillaumeGomez:copy-path-with-ronga

Conversation

@GuillaumeGomez
Copy link
Copy Markdown
Member

Fixes #155032.

It's a bit better in term of "fragility" to retrieve this information: no need to parse text anymore, just to retrieve content. However it relies on HTML. I added extra tests to ensure it won't break without notice.

cc @Enyium

r? @lolbinarycat

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 16, 2026

Some changes occurred in HTML/CSS/JS.

cc @lolbinarycat

@rustbot rustbot added the A-rustdoc-js Area: Rustdoc's JS front-end label Apr 16, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 16, 2026
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Copy Markdown
Member Author

Fixed typescript issues. The fix for some of them was so awful that I just preferred using // @ts-expect-error (casting an Element into an HTMLElement to satisfy tsc is really strange, and definitely something I don't want to do).

@GuillaumeGomez
Copy link
Copy Markdown
Member Author

@bors r=notriddle rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 16, 2026

📌 Commit 6c4ec59 has been approved by notriddle

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2026
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 16, 2026
…a, r=notriddle

Tweak how the "copy path" rustdoc button works to allow some accessibility tool to work with rustdoc

Fixes rust-lang#155032.

It's a bit better in term of "fragility" to retrieve this information: no need to parse text anymore, just to retrieve content. However it relies on HTML. I added extra tests to ensure it won't break without notice.

cc @Enyium

r? @lolbinarycat
rust-bors bot pushed a commit that referenced this pull request Apr 17, 2026
Rollup of 13 pull requests

Successful merges:

 - #152980 (c-variadic: fix implementation on `avr`)
 - #154491 (Extend `core::char`'s documentation of casing issues (and fix a rustdoc bug))
 - #155354 (Remove AttributeSafety from BUILTIN_ATTRIBUTES)
 - #154970 (rustdoc: preserve `doc(cfg)` on locally re-exported type aliases)
 - #155095 (changed the information provided by (mut x) to mut x (Fix 155030))
 - #155358 (ImproperCTypes: Move erasing_region_normalisation into helper function)
 - #155377 (tests/debuginfo/basic-stepping.rs: Remove FIXME related to ZSTs)
 - #155383 (Rearrange `rustc_ast_pretty`)
 - #155384 (triagebot: notify on diagnostic attribute changes)
 - #155386 (Use `box_new` diagnostic item for Box::new suggestions)
 - #155391 (Small refactor of `QueryJob::latch` method)
 - #155395 (Tweak how the "copy path" rustdoc button works to allow some accessibility tool to work with rustdoc)
 - #155396 (`as_ref_unchecked` docs link fix)
rust-bors bot pushed a commit that referenced this pull request Apr 17, 2026
Rollup of 19 pull requests

Successful merges:

 - #141633 (Suggest to bind `self.x` to `x` when field `x` may be in format string)
 - #152980 (c-variadic: fix implementation on `avr`)
 - #154491 (Extend `core::char`'s documentation of casing issues (and fix a rustdoc bug))
 - #155318 (Use mutable pointers for Unix path buffers)
 - #155335 (Bump bootstrap to 1.96 beta)
 - #155354 (Remove AttributeSafety from BUILTIN_ATTRIBUTES)
 - #154970 (rustdoc: preserve `doc(cfg)` on locally re-exported type aliases)
 - #155095 (changed the information provided by (mut x) to mut x (Fix 155030))
 - #155305 (Make `convert_while_ascii` unsafe)
 - #155358 (ImproperCTypes: Move erasing_region_normalisation into helper function)
 - #155377 (tests/debuginfo/basic-stepping.rs: Remove FIXME related to ZSTs)
 - #155383 (Rearrange `rustc_ast_pretty`)
 - #155384 (triagebot: notify on diagnostic attribute changes)
 - #155386 (Use `box_new` diagnostic item for Box::new suggestions)
 - #155391 (Small refactor of `QueryJob::latch` method)
 - #155395 (Tweak how the "copy path" rustdoc button works to allow some accessibility tool to work with rustdoc)
 - #155396 (`as_ref_unchecked` docs link fix)
 - #155411 (compiletest: Remove the `//@ should-ice` directive)
 - #155413 (fix: typo in `std::fs::hard_link` documentation)
@Enyium
Copy link
Copy Markdown

Enyium commented Apr 17, 2026

@GuillaumeGomez in issue:

Gonna tag you on [the PR] to confirm it looks good for your use case as well.

I'm new to this and don't have this huge repo set up locally. How can I quickly test this?

@rust-bors rust-bors bot merged commit f92c79e into rust-lang:main Apr 17, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Apr 17, 2026
Rollup merge of #155395 - GuillaumeGomez:copy-path-with-ronga, r=notriddle

Tweak how the "copy path" rustdoc button works to allow some accessibility tool to work with rustdoc

Fixes #155032.

It's a bit better in term of "fragility" to retrieve this information: no need to parse text anymore, just to retrieve content. However it relies on HTML. I added extra tests to ensure it won't break without notice.

cc @Enyium

r? @lolbinarycat
@GuillaumeGomez GuillaumeGomez deleted the copy-path-with-ronga branch April 17, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-js Area: Rustdoc's JS front-end S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy-identifier button copies extra text when accessibility software prefixes title

6 participants