-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rustdoc] Merge <code>
tags into one whenever possible
#136308
base: master
Are you sure you want to change the base?
Conversation
The "A <Stream a> stuff." does not seem to get rid of extra spacing yet... for me on firefox if that matters.
The |
I'm not convinced that this is a good solution? Other markdown implementations don't merge consecutive code blocks, the resulting source is noisy with
The alternative, |
Obviously yes. A whitespace is a character on its own and should not be merged if not part of a code. And in the case you displayed, it's even worse: it's a non-
It's a case common enough when intra-doc links are used and people are generally not aware that you can simply use HTML with markdown. I agree that it's less good than using An alternative would be writing a rustdoc lint. I tend to prefer the current approach as it's invisible to the user though. |
This is the lint described at rust-lang/rust#136308 (comment) that recommends using HTML to nest links inside code.
This is the lint described at rust-lang/rust#136308 (comment) that recommends using HTML to nest links inside code.
This is the lint described at rust-lang/rust#136308 (comment) that recommends using HTML to nest links inside code.
This is the lint described at rust-lang/rust#136308 (comment) that recommends using HTML to nest links inside code.
This is the lint described at rust-lang/rust#136308 (comment) that recommends using HTML to nest links inside code.
Fixes #62867.
Fixes #83997.
When we have multiple
<code>
tags following each others, we never tried merging them into one, especially when a<code>
is inside a<a>
. This PR merges them into one<code>
, making the generated HTML shorter. And it has the nice side-effect of also making it look nicer.Before:
After:
You can test it here.
r? @notriddle