RTEditor/src/main/java/com/onegravity/rteditor/converter/ConverterHtmlToSpanned.java
private void endList(boolean orderedList) {
        if (!mParagraphStyles.isEmpty()) {
            AccumulatedParagraphStyle style = mParagraphStyles.peek();
            ParagraphType type = style.getType();

            if ((orderedList && (type.isNumbering() || type == ParagraphType.INDENTATION_OL)) ||
                    (!orderedList && (type.isBullet() || type == ParagraphType.INDENTATION_UL))) {

                // the end tag matches the current style
                int indent = style.getRelativeIndent();
                if (indent > 1) {
                    style.setRelativeIndent(indent - 1);
                    style.setAbsoluteIndent(style.getAbsoluteIndent() - 1);
                } else {
                    mParagraphStyles.pop();
                }

            } else {

                // the end tag doesn't match the current style
                mParagraphStyles.pop();
                endList(orderedList);    // find the next matching style

            }
        }
    }
private void endList(boolean orderedList) {
        if (!mParagraphStyles.isEmpty()) {
            AccumulatedParagraphStyle style = mParagraphStyles.peek();
            ParagraphType type = style.getType();

            if ((orderedList && (type.isNumbering() || type == ParagraphType.INDENTATION_OL)) ||
                    (!orderedList && (type.isBullet() || type == ParagraphType.INDENTATION_UL))) {

                // the end tag matches the current style
                int indent = style.getRelativeIndent();
                if (indent > 1) {
                    style.setRelativeIndent(indent - 1);
                    style.setAbsoluteIndent(style.getAbsoluteIndent() - 1);
                } else {
                    mParagraphStyles.pop();
                }

            } else {

                // the end tag doesn't match the current style
                mParagraphStyles.pop();
                endList(orderedList);    // find the next matching style

            }
        }
    }
private void endList ( boolean orderedList ) { if ( ! mParagraphStyles . isEmpty ( ) ) { AccumulatedParagraphStyle style = mParagraphStyles . peek ( ) ; ParagraphType type = style . getType ( ) ; if ( ( orderedList && ( type . isNumbering ( ) || type == ParagraphType . INDENTATION_OL ) ) || ( ! orderedList && ( type . isBullet ( ) || type == ParagraphType . INDENTATION_UL ) ) ) { // the end tag matches the current style int indent = style . getRelativeIndent ( ) ; if ( indent > 1 ) { style . setRelativeIndent ( indent - 1 ) ; style . setAbsoluteIndent ( style . getAbsoluteIndent ( ) - 1 ) ; } else { mParagraphStyles . pop ( ) ; } } else { // the end tag doesn't match the current style mParagraphStyles . pop ( ) ; endList ( orderedList ) ; // find the next matching style } } }
Handles OL and UL end tags
Handles OL and UL end tags