I'm receiving some HTML with an arbitrary number of tags that I need to truncate in order to fit within 25 characters, however I don't want to leave any open tags.
For example, if I receive blah blah blah <a href="#">supercalifragilistic</a>
I need to truncate it to something like blah blah blah <a href="#">superc...</a>
rather than blah blah blah <a href="#">supercal...
My best thoughts right now are to use javascript to strip and then reapply the tags after truncation, or to put it all in a div and hide overflow. Not sure what the best option is or if there's an even simpler one.
Thanks!