def verbatim_tags(parser, token, endtagname):
text_and_nodes = []<EOL>while <NUM_LIT:1>:<EOL><INDENT>token = parser.tokens.pop(<NUM_LIT:0>)<EOL>if token.contents == endtagname:<EOL><INDENT>break<EOL><DEDENT>if token.token_type == template.base.TOKEN_VAR:<EOL><INDENT>text_and_nodes.append('<STR_LIT>')<EOL>text_and_nodes.append(token.contents)<EOL><DEDENT>elif token.token_type == template.base.TOKEN_TEXT:<EOL><INDENT>text_and_nodes.append(token.contents)<EOL><DEDENT>elif token.token_type == template.base.TOKEN_BLOCK:<EOL><INDENT>try:<EOL><INDENT>command = token.contents.split()[<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>parser.empty_block_tag(token)<EOL><DEDENT>try:<EOL><INDENT>compile_func = parser.tags[command]<EOL><DEDENT>except KeyError:<EOL><INDENT>parser.invalid_block_tag(token, command, None)<EOL><DEDENT>try:<EOL><INDENT>node = compile_func(parser, token)<EOL><DEDENT>except template.TemplateSyntaxError as e:<EOL><INDENT>if not parser.compile_function_error(token, e):<EOL><INDENT>raise<EOL><DEDENT><DEDENT>text_and_nodes.append(node)<EOL><DEDENT>if token.token_type == template.base.TOKEN_VAR:<EOL><INDENT>text_and_nodes.append('<STR_LIT>')<EOL><DEDENT><DEDENT>return text_and_nodes<EOL>
Javascript templates (jquery, handlebars.js, mustache.js) use constructs like:

::

    {{if condition}} print something{{/if}}

This, of course, completely screws up Django templates,
because Django thinks {{ and }} means something.

The following code preserves {{ }} tokens.

This version of verbatim template tag allows you to use tags
like url {% url name %}. {% trans "foo" %} or {% csrf_token %} within.