#NEWLINE# def _process_list_item( self , cap , bull ) : #NEWLINE# #INDENT# cap = self . grammar . list_item . findall ( cap ) #NEWLINE# _next = False #NEWLINE# length = len ( cap ) #NEWLINE# for i in range ( length ) : #NEWLINE# #INDENT# item = cap [ i ] [ 0 ] #NEWLINE# space = len ( item ) #NEWLINE# item = self . grammar . list_bullet . sub ( '' , item ) #NEWLINE# if ( '\n ' in item ) : #NEWLINE# #INDENT# space = ( space - len ( item ) ) #NEWLINE# pattern = re . compile ( ( '^ {1,%d}' % space ) , flags = re . M ) #NEWLINE# item = pattern . sub ( '' , item ) #NEWLINE# #UNINDENT# loose = _next #NEWLINE# if ( ( not loose ) and re . search ( '\\n\\n(?!\\s*$)' , item ) ) : #NEWLINE# #INDENT# loose = True #NEWLINE# #UNINDENT# rest = len ( item ) #NEWLINE# if ( ( i != ( length - 1 ) ) and rest ) : #NEWLINE# #INDENT# _next = ( item [ ( rest - 1 ) ] == '\n' ) #NEWLINE# if ( not loose ) : #NEWLINE# #INDENT# loose = _next #NEWLINE# #UNINDENT# #UNINDENT# if loose : #NEWLINE# #INDENT# self . renderer . loose_item_start ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . renderer . list_item_start ( ) #NEWLINE# #UNINDENT# self . read ( item , self . list_rules ) #NEWLINE# self . renderer . list_item_end ( )