[rustdoc] Merge <code> tags into one whenever possible#136308
[rustdoc] Merge <code> tags into one whenever possible#136308GuillaumeGomez wants to merge 3 commits intorust-lang:masterfrom
<code> tags into one whenever possible#136308Conversation
|
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.
…14121) This is the lint described at rust-lang/rust#136308 (comment) that recommends using HTML to nest links inside code. changelog: [`doc_link_code`]: warn when a link with code and a code span are back-to-back
|
We've merged the clippy lint. Since it solves the same problem, this PR isn't a complete solution, and it's not clear if any complete solution is coming, I propose we close this PR and its linked issues as not-planed. @rfcbot poll we should recommend HTML |
|
Team member @notriddle has asked teams: T-rustdoc, for consensus on:
|
|
Let's close it, no need to wait for the FCP to be over. |
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