diff --git a/django/template/base.py b/django/template/base.py
index 9b2404c..87ad6f6 100644
a
|
b
|
class Lexer(object):
|
210 | 210 | # hard-coded the 2s here for performance. And it's not like |
211 | 211 | # the TAG_START values are going to change anytime, anyway. |
212 | 212 | block_content = token_string[2:-2].strip() |
213 | | if self.verbatim and block_content == self.verbatim: |
| 213 | if self.verbatim and block_content == 'endverbatim': |
214 | 214 | self.verbatim = False |
215 | 215 | if in_tag and not self.verbatim: |
216 | 216 | if token_string.startswith(VARIABLE_TAG_START): |
217 | 217 | token = Token(TOKEN_VAR, token_string[2:-2].strip()) |
218 | 218 | elif token_string.startswith(BLOCK_TAG_START): |
219 | | if block_content.startswith('verbatim'): |
220 | | bits = block_content.split(' ', 1) |
221 | | if bits[0] == 'verbatim': |
222 | | if len(bits) > 1: |
223 | | self.verbatim = bits[1] |
224 | | else: |
225 | | self.verbatim = 'endverbatim' |
| 219 | if block_content == 'verbatim': |
| 220 | self.verbatim = True |
226 | 221 | token = Token(TOKEN_BLOCK, block_content) |
227 | 222 | elif token_string.startswith(COMMENT_TAG_START): |
228 | 223 | content = '' |
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 3073b41..9fc2522 100644
a
|
b
|
def verbatim(parser, token):
|
1289 | 1289 | {% verbatim %} |
1290 | 1290 | {% don't process this %} |
1291 | 1291 | {% endverbatim %} |
1292 | | |
1293 | | You can also specify an alternate closing tag:: |
1294 | | |
1295 | | {% verbatim -- %} |
1296 | | ... |
1297 | | {% -- %} |
1298 | 1292 | """ |
1299 | | bits = token.contents.split(' ', 1) |
1300 | | if len(bits) > 1: |
1301 | | closing_tag = bits[1] |
1302 | | else: |
1303 | | closing_tag = 'endverbatim' |
1304 | | nodelist = parser.parse((closing_tag,)) |
| 1293 | nodelist = parser.parse(('endverbatim',)) |
1305 | 1294 | parser.delete_first_token() |
1306 | 1295 | return VerbatimNode(nodelist.render(Context())) |
1307 | 1296 | |
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index af9004b..95889f4 100644
a
|
b
|
Django's syntax. For example::
|
1056 | 1056 | {{if dying}}Still alive.{{/if}} |
1057 | 1057 | {% endverbatim %} |
1058 | 1058 | |
1059 | | You can also specify an alternate closing tag:: |
1060 | | |
1061 | | {% verbatim finished %} |
1062 | | The verbatim tag looks like this: |
1063 | | {% verbatim %}{% endverbatim %} |
1064 | | {% finished %} |
1065 | | |
1066 | 1059 | .. templatetag:: widthratio |
1067 | 1060 | |
1068 | 1061 | widthratio |
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 957ad2b..ce39d85 100644
a
|
b
|
class Templates(unittest.TestCase):
|
1623 | 1623 | 'verbatim-tag03': ("{% verbatim %}It's the {% verbatim %} tag{% endverbatim %}", {}, "It's the {% verbatim %} tag"), |
1624 | 1624 | 'verbatim-tag04': ('{% verbatim %}{% verbatim %}{% endverbatim %}{% endverbatim %}', {}, template.TemplateSyntaxError), |
1625 | 1625 | 'verbatim-tag05': ('{% verbatim %}{% endverbatim %}{% verbatim %}{% endverbatim %}', {}, ''), |
1626 | | 'verbatim-tag06': ("{% verbatim -- %}Don't {% endverbatim %} just yet{% -- %}", {}, "Don't {% endverbatim %} just yet"), |
1627 | 1626 | } |
1628 | 1627 | return tests |
1629 | 1628 | |