Skip to content

Commit

Permalink
Rollup merge of rust-lang#83645 - pickfire:patch-3, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
Dylan-DPC authored Mar 29, 2021
2 parents ebdc7b2 + 7d21972 commit 2eb8568
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ nav.sub {
text-overflow: ellipsis;
margin: 0;
}
.docblock-short code {
/* Wrap non-pre code blocks (`text`) but not (```text```). */
.docblock > :not(pre) > code,
.docblock-short > :not(pre) > code {
white-space: pre-wrap;
}

Expand Down

0 comments on commit 2eb8568

Please sign in to comment.