def prunecomments(blocks):
    """Remove comments."""
    i = 0
    while i < len(blocks):
        b = blocks[i]
        if b[b'type'] == b'paragraph' and (b[b'lines'][0].startswith(b'.. '
            ) or b[b'lines'] == [b'..']):
            del blocks[i]
            if i < len(blocks) and blocks[i][b'type'] == b'margin':
                del blocks[i]
        else:
            i += 1
    return blocks
