@@ -869,9 +869,9 @@ private static void endLi(Editable text, RichTextStyle style) {
869869 List l = getLast (text , List .class );
870870 if (l != null ) {
871871 if (l .mType .equals ("ol" )) {
872- setListSpanFromMark (text , l , new EditorOrderedListSpan (l .mIndex , style ));
872+ setParagraphSpanFromMark (text , l , new EditorOrderedListSpan (l .mIndex , style ));
873873 } else {
874- setListSpanFromMark (text , l , new EditorUnorderedListSpan (style ));
874+ setParagraphSpanFromMark (text , l , new EditorUnorderedListSpan (style ));
875875 }
876876 }
877877
@@ -885,18 +885,19 @@ private void startBlockquote(Editable text, Attributes attributes) {
885885
886886 private static void endBlockquote (Editable text , RichTextStyle style ) {
887887 endBlockElement (text );
888- end (text , Blockquote .class , new EditorBlockQuoteSpan (style ));
888+ Blockquote last = getLast (text , Blockquote .class );
889+ setParagraphSpanFromMark (text , last , new EditorBlockQuoteSpan (style ));
889890 }
890891
891892 private void startCodeBlock (Editable text , Attributes attributes ) {
892893 startBlockElement (text , attributes , getMarginBlockquote ());
893894 start (text , new CodeBlock ());
894- ;
895895 }
896896
897897 private static void endCodeBlock (Editable text , RichTextStyle style ) {
898898 endBlockElement (text );
899- end (text , CodeBlock .class , new EditorCodeBlockSpan (style ));
899+ CodeBlock last = getLast (text , CodeBlock .class );
900+ setParagraphSpanFromMark (text , last , new EditorCodeBlockSpan (style ));
900901 }
901902
902903 private void startHeading (Editable text , Attributes attributes , int level ) {
@@ -939,7 +940,7 @@ private static void setSpanFromMark(Spannable text, Object mark, Object... spans
939940 }
940941 }
941942
942- private static void setListSpanFromMark (Spannable text , Object mark , Object ... spans ) {
943+ private static void setParagraphSpanFromMark (Spannable text , Object mark , Object ... spans ) {
943944 int where = text .getSpanStart (mark );
944945 text .removeSpan (mark );
945946 int len = text .length ();
0 commit comments