Improve string truncation behavior for strings truncated in a very long word
Summary:
Ref T13151. See PHI654. When truncating strings like package names in the form "X: YYYYYYYYYYYY", we currently render "X...".
A better rendering in this case is "X: YYYYYY...", where we chop the long word in the middle.
Tweak the logic a bit to handle this case better.
This will support improving the display behavior of long package names in the table of contents view.
Test Plan: Added/modified unit tests, got a clean result.
Reviewers: amckinley
Reviewed By: amckinley
Maniphest Tasks: T13151
Differential Revision: https://secure.phabricator.com/D19477