def scan3(alines):
    """deal with indents in text lines"""
    outer_indent = [0]
    for i, aline in enumerate(alines):
        if aline.type in ['ordered', 'unordered']:
            while outer_indent[-1] >= aline.outer_indent:
                outer_indent.pop()
            outer_indent.append(aline.outer_indent)
        elif aline.type == 'text':
            while outer_indent[-1] > aline.content_start:
                outer_indent.pop()
            aline.indent = outer_indent[-1]
    return alines
