-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Replace nbsp in all rustdoc code blocks #106125
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
Conversation
r? @notriddle (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @Folyd, @jsha |
Please run |
cc @hsivonen |
@@ -182,6 +182,7 @@ h4.code-header { | |||
font-weight: 600; | |||
margin: 0; | |||
padding: 0; | |||
white-space: pre; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what we want?
With the old setup, code headers were allowed to wrap, and there are GUI tests for it. in the notable traits popup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are supposed to indeed.
The job Click to see the possible cause of the failure (guessed by this bot)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it to someone else to work out what to do about notable traits popup.
Copying code from those is a less common thing so maybe it's not so bad for notable traits popups to continue using nbsp. I still think the non-popup rendered APIs should never use nbsp.
…umeGomez Replace nbsp in all rustdoc code blocks Based on rust-lang#106125 by `@dtolnay` — this PR fixes the line wrapping bug. Fixes rust-lang#106098. This makes code copyable from rustdoc rendered documentation into a Rust source file.
Fixes #106098. This makes code copyable from rustdoc rendered documentation into a Rust source file.
Tested by building the docs of
syn
and scanning for any missing indentation.white-space: pre
makes consecutive spaces not collapse into one, and makes linebreaks not get inserted, exactly what was doing.