def render_with_filter(markup_filter, lines):
    try:
        if formatter:
            return mark_safe(formatter("\n".join(lines), filter_name=markup_filter))
        else:
            raise TemplateSyntaxError(
                "In order to use this templatetag you need django-markup, docutils and markdown installed")
    except ValueError as exc:
        output = "<p>Warning: %s</p>" % exc
        return output + value
dataset/ETHPy150Open danirus/django-comments-xtd/django_comments_xtd/templatetags/comments_xtd.py/render_with_filter/original