Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Small formatting tweaks to named-end-blocks change from [4489]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4492 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b9677848f5ae707e52ce96c067878707015c45cd 1 parent 38f9d8d
Adrian Holovaty authored February 12, 2007
2  django/template/loader_tags.py
@@ -129,7 +129,7 @@ def do_block(parser, token):
129 129
         parser.__loaded_blocks.append(block_name)
130 130
     except AttributeError: # parser.__loaded_blocks isn't a list yet
131 131
         parser.__loaded_blocks = [block_name]
132  
-    nodelist = parser.parse(('endblock','endblock %s' % block_name))
  132
+    nodelist = parser.parse(('endblock', 'endblock %s' % block_name))
133 133
     parser.delete_first_token()
134 134
     return BlockNode(block_name, nodelist)
135 135
 
13  docs/templates.txt
@@ -253,10 +253,15 @@ Here are some tips for working with inheritance:
253 253
       if you want to add to the contents of a parent block instead of
254 254
       completely overriding it.
255 255
 
256  
-    * You can optionally name your ``{{ endblock }}`` tag with the same name
257  
-      you gave the ``{{ block }}`` tag (for example, ``{{ endblock content }}``).
258  
-      In larger templates this helps you see which ``{{ block }}`` tags are
259  
-      being closed.
  256
+    * **New in Django development version:** For extra readability, you can
  257
+      optionally give a *name* to your ``{% endblock %}`` tag. For example::
  258
+
  259
+          {% block content %}
  260
+          ...
  261
+          {% endblock content %}
  262
+
  263
+      In larger templates, this technique helps you see which ``{% block %}``
  264
+      tags are being closed.
260 265
 
261 266
 Finally, note that you can't define multiple ``{% block %}`` tags with the same
262 267
 name in the same template. This limitation exists because a block tag works in

0 notes on commit b967784

Please sign in to comment.
Something went wrong with that request. Please try again.