'Required:
line -- the line of current text.
id -- the id of the current list
Return:
Nothing
Logic:
You have found the end of a paragraph definition, and have found
another paragraph definition with a list id.
If the list-id is different from the last paragraph definition,
write the string in the buffer. Close out the lists with another
method and start a new list.
If the list id is the same as the last one, check the indent on the
current paragraph definition. If it is greater than the previous one,
do not end the current list or item. Start a new list.'

def __list_after_par_def_func(self, line, id):

    last_list_id = self.__all_lists[(-1)]['id']
    if (id != last_list_id):
        self.__close_lists()
        self.__write_obj.write(self.__list_chunk)
        self.__write_start_list(id)
        self.__list_chunk = ''
    else:
        last_list_indent = self.__all_lists[(-1)]['left-indent']
        if (self.__left_indent > last_list_indent):
            self.__write_obj.write(self.__list_chunk)
            self.__write_start_list(id)
        else:
            self.__write_end_item()
            self.__write_obj.write(self.__list_chunk)
            self.__write_start_item()
        self.__list_chunk = ''
