diff --git a/django/template/base.py b/django/template/base.py
index eacc29c..a315c05 100644
a
|
b
|
class Parser(object):
|
222 | 222 | var_node = self.create_variable_node(filter_expression) |
223 | 223 | self.extend_nodelist(nodelist, var_node,token) |
224 | 224 | elif token.token_type == TOKEN_BLOCK: |
225 | | if token.contents in parse_until: |
226 | | # put token back on token list so calling code knows why it terminated |
227 | | self.prepend_token(token) |
228 | | return nodelist |
| 225 | for value in parse_until: |
| 226 | # A parse_until value which ends in a ' ' will match any |
| 227 | # token starting with that value, otherwise an exact match |
| 228 | # is required. |
| 229 | if (value == token.contents or value.endswith(' ') |
| 230 | and token.contents.startswith(value)): |
| 231 | # Put token back on token list so calling code knows |
| 232 | # why it terminated. |
| 233 | self.prepend_token(token) |
| 234 | return nodelist |
229 | 235 | try: |
230 | 236 | command = token.contents.split()[0] |
231 | 237 | except IndexError: |