protected boolean isLegalEmphOrStrongClosePos ( ) { Object lastItem = peek ( ) ; if ( StrongEmphSuperNode . class . equals ( lastItem . getClass ( ) ) ) { List < Node > children = ( ( StrongEmphSuperNode ) lastItem ) . getChildren ( ) ; if ( children . size ( ) < 1 ) return true ; lastItem = children . get ( children . size ( ) - 1 ) ; Class < ? > lastClass = lastItem . getClass ( ) ; if ( TextNode . class . equals ( lastClass ) ) return ! ( ( TextNode ) lastItem ) . getText ( ) . endsWith ( " " ) ; if ( SimpleNode . class . equals ( lastClass ) ) return ! ( ( SimpleNode ) lastItem ) . getType ( ) . equals ( SimpleNode . Type . Linebreak ) ; } return true ; }
This method checks if the last parsed character or sequence is a valid prefix for a closing char for an emph or strong sequence .