'Get level of indent based on list level.'

def get_level(self, parent, block):

    m = self.INDENT_RE.match(block)
    if m:
        indent_level = (len(m.group(1)) / markdown.TAB_LENGTH)
    else:
        indent_level = 0
    if self.parser.state.isstate('list'):
        level = 1
    else:
        level = 0
    while (indent_level > level):
        child = self.lastChild(parent)
        if (child and ((child.tag in self.LIST_TYPES) or (child.tag in self.ITEM_TYPES))):
            if (child.tag in self.LIST_TYPES):
                level += 1
            parent = child
        else:
            break
    return (level, parent)
