Clamp a string to DESCRIPTION_MAX_LENGTH characters, appending
an ellipsis when truncation actually happens. Does not break words if
avoidable — a trailing partial word is trimmed back to the previous
space first.
Parameters
text: string
Raw description text
Returns string
Truncated description with trailing ellipsis when clipped
Clamp a string to DESCRIPTION_MAX_LENGTH characters, appending an ellipsis when truncation actually happens. Does not break words if avoidable — a trailing partial word is trimmed back to the previous space first.