(attrs, new=False)
return attrs
Helper function used when linkifying with bleach.
Helper function used when linkifying with bleach.
Helper function used when linkifying with bleach .
def top_level_only(attrs, new=False):
    '''
    Helper function used when linkifying with bleach.
    '''
    if not new:
        return attrs
    text = attrs['_text']
    if not text.startswith(('http:', 'https:')):
        return None
    return attrs
def top_level_only ( attrs , new = False ) : if not new : return attrs text = attrs [ '_text' ] if not text . startswith ( ( 'http:' , 'https:' ) ) : return None return attrs