What would be the best solution for creating method that would take string containing HTML and would chop off the last lets say 10% of the string but without breaking any HTML tags.
The body and header tags are not part of the HTML string.
Also the rounding should happen upwards so lats say that if the last 10% would shrink to 5% if HTML should remain in untouched than the methods should rather cut the begging of HTML and perform 15% cut which would be the begging of the tag.
I'm thinking of using Jsoup for this. The problem is that the string might not be enclosed by HTML elements. It just might be a text with couple of links in it.