def ends_with_blank_line(block):
    """
    Returns true if block ends with a blank line, descending if needed
    into lists and sublists.    
    
    """
    if block.last_line_blank:
        return True
    if block.t in ['List', 'ListItem'] and block.children:
        return ends_with_blank_line(block.children[-1])
    else:
        return False