def remove_parenthesis(string):
    """Remove parentheses and text within them.
    For nested parentheses, removes the whole thing.
    """
    ret = ''
    skip1c = 0
    skip2c = 0
    for i in string:
        if i == '[':
            skip1c += 1
        elif i == '(':
            skip2c += 1
        elif i == ']' and skip1c > 0:
            skip1c -= 1
        elif i == ')' and skip2c > 0:
            skip2c -= 1
        elif skip1c == 0 and skip2c == 0:
            ret += i
    return ret