public static CharSequence trimSpanned(final Spanned source) {
        final int length = source.length();
        int i = length;

        // loop back to the first non-whitespace character
        //noinspection StatementWithEmptyBody
        while (--i >= 0 && Character.isWhitespace(source.charAt(i))) {
            // empty
        }

        if (i < length - 1) {
            return source.subSequence(0, i + 1);
        }
        return source;
    }
When converting html to text using {@link HtmlCompat#fromHtml(String, int)} then the result often contains unwanted trailing
linebreaks (from the conversion of paragraph tags). This method removes those.
main/src/main/java/cgeo/geocaching/utils/TextUtils.java