API Text - Limit characters to closest word

This new function builds on top of the functionality in Text->LimitCharacters(), but it truncates the value to the closest complete word.

There are several advantages to this over Text->LimitCharacters eg. the ellipsis (...) is always added after a complete word as sometimes in Text->LimitCharacters it can add the ellipsis in the middle of a word, or worse, at the end of a space or other punctuation. This function also trims any whitespace/punctuation on the end before adding the ellipsis.

It gives more control especially when using a tile frontend like Isotope, where the tile height is fixed and cannot adjust to the content length.

The limitation of the function is that it strips all HTML tags out of the value, but then its only intended for showing a small snippet of the text in a restrictive layout.
A problem here is that you're assuming the content of this value is HTML. If it's plain text you'll unintentionally encode values such as.
`To write an ampersand in html use &amp;`
into
`To write an ampersand in html use &`