def externallify_url(attrs, new=False):
    p = urlparse(attrs['href'])
    if p.netloc.lower() not in Config.DOMAINS:
        # attrs['rel'] = 'nofollow'
        attrs['target'] = '_blank'
        attrs['class'] = 'link-external'
    else:
        attrs.pop('target', None)
    return attrs
Open external urls in new tab.
dataset/ETHPy150Open brijeshb42/yapper/yapper/utilities/md.py/externallify_url