-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Enable wrapping words by default #92801
Conversation
Some changes occurred in HTML/CSS/JS. |
d2f03f9
to
c73a371
Compare
You can see an example of how table scrolling looks by visiting the demo at https://rustdoc.crud.net/jsha/overflow-wrap/std/collections/index.html#sequences and setting mobile (responsive) mode in Dev Tools. |
Looks like it's not limited to this PR. That's interesting! will fix. https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.step_by |
Faced with a very long word, browsers will let it overflow its box horizontally rather than break it in the middle. We essentially never want that behavior. We would rather break the word and keep it inside its horizontal limits. So we apply a default overflow-wrap: break-word/anywhere to the document as a while. In some contexts we would rather add a horizontal scrollbar (code blocks), or elide the excess text with an ellipsis (sidebar). Those still work as expected.
Fixed the bug with the theme picker. |
Can you update the online docs please? (if you already did, the bug is still there ^^') |
Have you done a hard refresh? I've updated the demo and the bug no longer reproduces on Chrome or Firefox. |
Ah indeed. Sorry I should have thought about it... Looks all good now, thanks! @bors: r+ rollup |
📌 Commit 4d5a6c9 has been approved by |
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#90498 (Clarifications in the target tier policy) - rust-lang#92164 (Implement `#[rustc_must_implement_one_of]` attribute) - rust-lang#92729 (rustc_codegen_llvm: Remove (almost) unused span parameter from many functions in metadata.rs) - rust-lang#92752 (Correct minor typos in some long error code explanations) - rust-lang#92801 (Enable wrapping words by default) - rust-lang#92825 (Rename environment variable for overriding rustc version) - rust-lang#92877 (Remove LLVMRustMarkAllFunctionsNounwind) - rust-lang#92936 (rustdoc: Remove `collect` in `html::markdown::parse`) - rust-lang#92956 (Add `log2` and `log10` to `NonZeroU*`) - rust-lang#92960 (Use `carrying_{mul|add}` in `num::bignum`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Faced with a very long word, browsers will let it overflow its
box horizontally rather than break it in the middle. We essentially
never want that behavior. We would rather break the word and keep it
inside its horizontal limits. So we apply a default overflow-wrap:
break-word/anywhere to the document as a while.
In some contexts we would rather add a horizontal scrollbar (code
blocks), or elide the excess text with an ellipsis (sidebar). Those
still work as expected.
Fixes #92771
Some related discussion and a related issue: #92421.
Demo: https://rustdoc.crud.net/jsha/overflow-wrap/std/iter/trait.Iterator.html#method.try_find
r? @GuillaumeGomez