From: Erik Johnson Date: Mon, 19 Mar 2018 19:17:35 +0000 (-0500) Subject: Fix cases where filter input is not a Markup type X-Git-Tag: 2.11.0~122^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e937c8a0de02bbbb5f19f9a65e0f2f9a0ffb6446;p=thirdparty%2Fjinja.git Fix cases where filter input is not a Markup type The previous commit assumes that the filter will always be a Markup type, which is not correct. --- diff --git a/jinja2/filters.py b/jinja2/filters.py index 79505fbe..ab02ca3c 100644 --- a/jinja2/filters.py +++ b/jinja2/filters.py @@ -567,8 +567,12 @@ def do_indent( rv += u'\n' + u'\n'.join( indention + line if line else line for line in lines ) - # Unescape any strings that were escaped due to concatenation - rv = Markup(rv.unescape()) + try: + # Unescape any strings that were escaped due to concatenation + rv = Markup(rv.unescape()) + except AttributeError: + # s was not a Markup instance + pass if first: rv = indention + rv