about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-02-03 14:15:23 -0800
committerGitHub <noreply@github.com>2023-02-03 14:15:23 -0800
commitf7210b3bedd04bbc5674fadf878a56cde38ed85b (patch)
treea168bd96161489926b603f2e5b666deeb1e4a133 /src/librustdoc/html/static/css/rustdoc.css
parent1594b58ce78b772aeb4bc8913f7f0c6ea3e0fcc7 (diff)
parent784665d4ce59c5239791f1f96fa2137e47ca1817 (diff)
downloadrust-f7210b3bedd04bbc5674fadf878a56cde38ed85b.tar.gz
rust-f7210b3bedd04bbc5674fadf878a56cde38ed85b.zip
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
Replace nbsp in all rustdoc code blocks

Based on #106125 by `@dtolnay` — this PR fixes the line wrapping bug.

Fixes #106098. This makes code copyable from rustdoc rendered documentation into a Rust source file.
Diffstat (limited to 'src/librustdoc/html/static/css/rustdoc.css')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index ee988090ca3..a1e91118303 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -184,6 +184,7 @@ h4.code-header {
 	font-weight: 600;
 	margin: 0;
 	padding: 0;
+	white-space: pre-wrap;
 }
 
 #crate-search,
@@ -642,6 +643,7 @@ pre, .rustdoc.source .example-wrap {
 .fn .where,
 .where.fmt-newline {
 	display: block;
+	white-space: pre-wrap;
 	font-size: 0.875rem;
 }