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.