Skip to content
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

Inline code has collapsed whitespace #83550

Closed
mgeisler opened this issue Mar 27, 2021 · 2 comments · Fixed by #83645
Closed

Inline code has collapsed whitespace #83550

mgeisler opened this issue Mar 27, 2021 · 2 comments · Fixed by #83645
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@mgeisler
Copy link
Contributor

Code

When documenting the handling of whitespace in the textwrap crate, I noticed that whitespace is collapsed in inline code. That is,

`"   foo   "`

is rendered the same as

`" foo "`

Test it with

$ cargo new --lib whitespace && cd whitespace && echo '//! `"   foo   "`' > src/lib.rs && cargo doc --open

Version it worked on

It worked on Rust 1.50:

image

Version with regression

It stopped working on Rust 1.51. I tracked down the change to #81558, which removed white-space: pre-wrap from the CSS. The page now looks like this:

image

@pickfire
Copy link
Contributor

Note that a fix here could potentially create a regression for ascii art on mobile. Need to double check the vec page.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 27, 2021
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Mar 27, 2021
@camelid
Copy link
Member

camelid commented Mar 28, 2021

Assigning P-high and removing I-prioritize as discussed in the prioritization working group.

@rustbot label: +P-high -I-prioritize

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Mar 28, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 29, 2021
Wrap non-pre code blocks

Fix rust-lang#83550 regression

```
$ cargo new --lib whitespace && cd whitespace && echo '//! `"   foo   "`' > src/lib.rs && cargo doc --open
```

Before

![](https://user-images.githubusercontent.com/89623/112713498-c0dfc200-8ed5-11eb-8c57-efdf26372e74.png)

After

![](https://user-images.githubusercontent.com/89623/112713538-f08eca00-8ed5-11eb-8a98-675179f60ae2.png)

r? `@GuillaumeGomez`
cc `@mgeisler`
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 30, 2021
Wrap non-pre code blocks

Fix rust-lang#83550 regression

```
$ cargo new --lib whitespace && cd whitespace && echo '//! `"   foo   "`' > src/lib.rs && cargo doc --open
```

Before

![](https://user-images.githubusercontent.com/89623/112713498-c0dfc200-8ed5-11eb-8c57-efdf26372e74.png)

After

![](https://user-images.githubusercontent.com/89623/112713538-f08eca00-8ed5-11eb-8a98-675179f60ae2.png)

r? ``@GuillaumeGomez``
cc ``@mgeisler``
@bors bors closed this as completed in 7d21972 Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants