I previously made a truncate helper for Rails that handles HTML gracefully: doesn’t split inside HTML entities, doesn’t orphan end-tags and so on.
Truncating like this on the server-side is great in contexts where you don’t want to show the full text as well, such as in an index of items.
Another common case for truncation is “more”/”less” links: you want to show the full text, such as a user’s presentation, but for layout reasons a truncated snippet should be shown first, with a “more” link to disclose the rest. A “less” link gives you the snippet again.
So I rolled my own truncator, inspired by my Rails helper. It’s a jQuery plugin.
Enjoy, and please report bugs/improvements. Some parts could definitely do with prettying up.