Fix and improve do_truncate
Before adoption: this commit came in with the history the project adopted, so no landing records it.
- Ensure that the requested max length be at least as long as the requested `end` value (e.g. 3 in the case of '...'). Fixes #539 - Add `leeway` parameter so that strings that just barely miss the requested max length cutoff can still be spared from unwanted truncation. Default value is 5. - No longer append a space before appending `end` under any circumstances. Adding whitespace before ellipsis punctuation in English is grammatically incorrect.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+18 added−14 removed
- tests:+4 added−4 removed
- other:+14 added−10 removed