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
