Add a {% verbatim %} template tag. #51

wants to merge 1 commit into


None yet

6 participants

Django member

Fixes #14502.

@ramiro ramiro and 1 other commented on an outdated diff May 9, 2012
@@ -1273,6 +1280,21 @@ def url(parser, token):
return URLNode(viewname, args, kwargs, asvar)
+def verbatim(parser, token):
+ """
+ Output the content of this tag (usually template source) content of this
ramiro May 9, 2012

Docstring is a bit confusing.

SmileyChris May 9, 2012

Thanks, I always end up half-writing my docstrings :P (fixed now)

Django member

Is there a reason that this was done by modifying the core parser, rather than as a tag which reinterprets the tokens?


@alex Template tag tokens strip whitespace, so you need support all the way up to the tokenizer to do verbatim properly.

Django member

Yup, that's why.

Django member

Fixed in 4464bbb

Django member

Committed in 4464bbb

@claudep claudep closed this Jun 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment