mirror of
https://github.com/storytold/designcraft.git
synced 2026-12-05 21:43:12 -05:00
Part 1: `dot_break` in crates/compose/src/breaker.rs now allows a break after a dot only with at least three letters right before it and two right after it. A ligature counts the further letters it covers, so a short ending set as one glyph, such as ".fi", still counts as two. "e.g.", "U.S.A.", "Ph.D." and decimals now stay whole, and "visit example.org/x1" still breaks after "example.". Both composers use this rule. I extended the existing web-address test to check that those three abbreviations stay whole in both composers. With the old rule restored it fails by splitting "e.g.", and with the new rule it passes. `cargo fmt --all --check`, clippy on designcraft-compose with `-D warnings`, `cargo test -p designcraft-compose` (510 passed, 1 ignored) and `cargo xtask layers` pass. The rule only counts letters, so it has two limits. A dot with too few letters beside it, such as the one after "co" in "bbc.co.uk", is no longer a break point. An unspaced abbreviation with enough letters on each side, such as "rer.nat.", can still break. The pull request description still says a letter on each side is enough.