Commit 51aa20d
authored
Rollup merge of rust-lang#92801 - jsha:overflow-wrap, r=GuillaumeGomez
Enable wrapping words by default
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 rust-lang#92771
[Some related discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/wrap.20.2F.20overflow.20.2F.20scroll) and a related issue: rust-lang#92421.
Demo: https://rustdoc.crud.net/jsha/overflow-wrap/std/iter/trait.Iterator.html#method.try_find
r? ``@GuillaumeGomez``1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
| |||
446 | 452 | | |
447 | 453 | | |
448 | 454 | | |
| 455 | + | |
449 | 456 | | |
450 | 457 | | |
451 | 458 | | |
| |||
576 | 583 | | |
577 | 584 | | |
578 | 585 | | |
| 586 | + | |
579 | 587 | | |
580 | 588 | | |
581 | 589 | | |
| |||
641 | 649 | | |
642 | 650 | | |
643 | 651 | | |
| 652 | + | |
644 | 653 | | |
645 | 654 | | |
646 | 655 | | |
| |||
669 | 678 | | |
670 | 679 | | |
671 | 680 | | |
| 681 | + | |
672 | 682 | | |
673 | 683 | | |
674 | 684 | | |
| |||
1495 | 1505 | | |
1496 | 1506 | | |
1497 | 1507 | | |
| 1508 | + | |
1498 | 1509 | | |
1499 | 1510 | | |
1500 | 1511 | | |
| |||
2099 | 2110 | | |
2100 | 2111 | | |
2101 | 2112 | | |
| 2113 | + | |
2102 | 2114 | | |
2103 | 2115 | | |
2104 | 2116 | | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
2105 | 2121 | | |
2106 | 2122 | | |
2107 | 2123 | | |
| |||
0 commit comments