'Remove a tab from the front of each line of the given text.'

def detab(self, text):

    newtext = []
    lines = text.split('\n')
    for line in lines:
        if line.startswith(('    ' * markdown.TAB_LENGTH)):
            newtext.append(line[markdown.TAB_LENGTH:])
        elif (not line.strip()):
            newtext.append('')
        else:
            break
    return ('\n'.join(newtext), '\n'.join(lines[len(newtext):]))
