I need to show the first 100 characters of an HTML text, which means, I have to pick the first 100 characters that are not tags and then close any open tags leaving a balanced HTML. Is there any library that can do it? Or is there any trivial way to do it that I am missing?
The text is originally written in Textile which can and does contain HTML, so I figured I am better off turning it to fully HTML first and then processing, but if something can do it at the Textile level, I'm happy too.