private CharSequence extractSpanText(Editable output, Class kind) {
        final Object obj = getLast(output, kind);
        // start of the tag
        final int where = output.getSpanStart(obj);
        // end of the tag
        final int len = output.length();

        final CharSequence extractedSpanText = output.subSequence(where, len);
        output.delete(where, len);
        return extractedSpanText;
    }
Returns the text contained within a span and deletes it from the output string
android/modules/module_common/src/main/java/github/tornaco/android/thanos/widget/html/HtmlTagHandler.java