def img(text):
    """http://spam.png等の画像URLを、imgタグに置換する.

    Bootstrap4に合わせたタグです

    >>> img('[filter img]https://torina.top/a.png[end]')
    '<a href="https://torina.top/a.png" target="_blank" rel="nofollow">\
    <img src="https://torina.top/a.png" class="img-fluid"/></a>'

    """
    text = text.replace('<br />', '\n')
    text = text.replace('[filter img]', '').replace('[end]', '')
    tag = (
        '<a href="{0}" target="_blank" rel="nofollow"><img src="{0}" '
        'class="img-fluid"/></a>'
    ).format(text)
    return tag