Changeset 1964
- Timestamp:
- 01/14/06 18:48:23 (3 years ago)
- Files:
-
- django/trunk/django/core/template/defaulttags.py (modified) (1 diff)
- django/trunk/django/core/template/__init__.py (modified) (1 diff)
- django/trunk/tests/othertests/templates.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/template/defaulttags.py
r1582 r1964 287 287 Ignore everything between ``{% comment %}`` and ``{% endcomment %}`` 288 288 """ 289 nodelist = parser.parse(('endcomment',)) 290 parser.delete_first_token() 289 parser.skip_past('endcomment') 291 290 return CommentNode() 292 291 comment = register.tag(comment) django/trunk/django/core/template/__init__.py
r1690 r1964 311 311 self.unclosed_block_tag(parse_until) 312 312 return nodelist 313 314 def skip_past(self, endtag): 315 while self.tokens: 316 token = self.next_token() 317 if token.token_type == TOKEN_BLOCK and token.contents == endtag: 318 return 319 self.unclosed_block_tag([endtag]) 313 320 314 321 def create_variable_node(self, filter_expression): django/trunk/tests/othertests/templates.py
r1690 r1964 144 144 'comment-tag01': ("{% comment %}this is hidden{% endcomment %}hello", {}, "hello"), 145 145 'comment-tag02': ("{% comment %}this is hidden{% endcomment %}hello{% comment %}foo{% endcomment %}", {}, "hello"), 146 147 # Comment tag can contain invalid stuff. 148 'comment-tag03': ("foo{% comment %} {% if %} {% endcomment %}", {}, "foo"), 149 'comment-tag04': ("foo{% comment %} {% endblock %} {% endcomment %}", {}, "foo"), 150 'comment-tag05': ("foo{% comment %} {% somerandomtag %} {% endcomment %}", {}, "foo"), 146 151 147 152 ### FOR TAG ###############################################################
