Rollup merge of #140868 - SpecificProtagonist:rustdoc-trait-impl-code-link, r=notriddle
rustdoc: Fix links with inline code in trait impl docs Fixes #140857
This commit is contained in:
commit
981bbf4197
3 changed files with 30 additions and 1 deletions
|
|
@ -1179,8 +1179,10 @@ function preLoadCss(cssUrl) {
|
|||
|
||||
onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"), el => {
|
||||
// @ts-expect-error
|
||||
// Clicking on the summary's contents should not collapse it,
|
||||
// but links within should still fire.
|
||||
el.addEventListener("click", e => {
|
||||
if (e.target.tagName !== "SUMMARY" && e.target.tagName !== "A") {
|
||||
if (!e.target.matches("summary, a, a *")) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue