Index: django/django/template/__init__.py
===================================================================
--- django/django/template/__init__.py	(revision 8335)
+++ django/django/template/__init__.py	(working copy)
@@ -253,7 +253,7 @@
                 var_node = self.create_variable_node(filter_expression)
                 self.extend_nodelist(nodelist, var_node,token)
             elif token.token_type == TOKEN_BLOCK:
-                if token.contents in parse_until:
+                if token.contents.split()[0] in parse_until:
                     # put token back on token list so calling code knows why it terminated
                     self.prepend_token(token)
                     return nodelist
