about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lints.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-01-19 19:26:59 +0100
committerGitHub <noreply@github.com>2024-01-19 19:26:59 +0100
commitcad609d9e3a33cfef1727dcb0682e05f1f036afa (patch)
tree18b1d84de02824f9b515eefefea87e187b6cccfc /compiler/rustc_pattern_analysis/src/lints.rs
parent64461dab0185a3c42be7ceb0038a7574f0f062d8 (diff)
parentbf4a20cfca442f211932e181a27baa070e3062cd (diff)
downloadrust-cad609d9e3a33cfef1727dcb0682e05f1f036afa.tar.gz
rust-cad609d9e3a33cfef1727dcb0682e05f1f036afa.zip
Rollup merge of #117662 - GuillaumeGomez:links-in-headings, r=notriddle
[rustdoc] Allows links in headings

Reopening of https://github.com/rust-lang/rust/pull/94360.

# Explanations

Rustdoc currently doesn't follow the markdown spec on headings: we don't allow links in them. So instead of having headings linking to themselves, this PR generates an anchor on the left side like this:

![image](https://github.com/rust-lang/rust/assets/3050060/a118a7e9-5ef8-4d07-914f-46defc3245c3)

<details>
<summary>previous version</summary>

![image](https://github.com/rust-lang/rust/assets/3050060/c34fa844-9cd4-47dc-bb51-b37f5f66afee)

</details>

Having the anchor always displayed allows for mobile devices users to be able to have a link to the anchor. The different color used for the anchor itself is the same as links so people notice when looking at it that they can click on it.

You can test it [here](https://rustdoc.crud.net/imperio/links-in-headings/std/index.html).

cc `@camelid`
r? `@notriddle`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lints.rs')
0 files changed, 0 insertions, 0 deletions