Truncato is a tool for truncating HTML strings keeping a valid HTML markup WWW: https://github.com/jorgemanrubia/truncato