Browse code

Take previous jinja2 blocks into account in splitter when we see quotes

Previously, split_args() was not taking print/block/comment depth into account
when splitting things, meaning that if there was a quote character inside an
un-quoted variable (ie. {{ foo | some_filter(' ') }}), it was incorrectly
splitting on the quotes instead of continuing to append to the previous param.

Fixes #13630

James Cammarata authored on 2016/03/29 04:43:43
Showing 1 changed files
... ...
@@ -204,7 +204,7 @@ def split_args(args):
204 204
             # to the end of the list, since we'll tack on more to it later
205 205
             # otherwise, if we're inside any jinja2 block, inside quotes, or we were
206 206
             # inside quotes (but aren't now) concat this token to the last param
207
-            if inside_quotes and not was_inside_quotes:
207
+            if inside_quotes and not was_inside_quotes and not(print_depth or block_depth or comment_depth):
208 208
                 params.append(token)
209 209
                 appended = True
210 210
             elif print_depth or block_depth or comment_depth or inside_quotes or was_inside_quotes: