@register.filter
def safe_html_thumbnails(value):
    return text_filter('<img(?: alt="(%(caption)s)?")? src="(%(image)s)"', value)
HTML filter that replaces all images with thumbnails, the returned string is not marked as safe.
dataset/ETHPy150Open python-thumbnails/python-thumbnails/thumbnails/templatetags/thumbnails.py/safe_html_thumbnails