Ticket #2961: templatetag-comment.patch
File templatetag-comment.patch, 2.3 KB (added by , 18 years ago) |
---|
-
django/template/defaulttags.py
1 1 "Default tags used by the template system, available to all templates." 2 2 3 3 from django.template import Node, NodeList, Template, Context, resolve_variable 4 from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END 4 from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE_BRACE_END, COMMENT_TAG_START, COMMENT_TAG_END 5 5 from django.template import get_library, Library, InvalidTemplateLibrary 6 6 from django.conf import settings 7 7 import sys … … 295 295 'closevariable': VARIABLE_TAG_END, 296 296 'openbrace': SINGLE_BRACE_START, 297 297 'closebrace': SINGLE_BRACE_END, 298 'opencomment': COMMENT_TAG_START, 299 'closecomment': COMMENT_TAG_END, 298 300 } 299 301 300 302 def __init__(self, tagtype): … … 831 833 ``closevariable`` ``}}`` 832 834 ``openbrace`` ``{`` 833 835 ``closebrace`` ``}`` 836 ``opencomment`` ``{#`` 837 ``closecomment`` ``#}`` 834 838 ================== ======= 835 839 """ 836 840 bits = token.contents.split() -
tests/regressiontests/templates/tests.py
552 552 'templatetag08': ('{% templatetag closebrace %}', {}, '}'), 553 553 'templatetag09': ('{% templatetag openbrace %}{% templatetag openbrace %}', {}, '{{'), 554 554 'templatetag10': ('{% templatetag closebrace %}{% templatetag closebrace %}', {}, '}}'), 555 'templatetag11': ('{% templatetag opencomment %}', {}, '{#'), 556 'templatetag12': ('{% templatetag closecomment %}', {}, '#}'), 555 557 556 558 ### WIDTHRATIO TAG ######################################################## 557 559 'widthratio01': ('{% widthratio a b 0 %}', {'a':50,'b':100}, '0'),