Skip to content

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

Closed
wants to merge 1 commit into from

6 participants

@SmileyChris
Django member

Fixes #14502.

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

Docstring is a bit confusing.

@SmileyChris
Django member
SmileyChris added a note May 9, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@alex
Django member
alex commented May 9, 2012

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

@ogier
ogier commented May 9, 2012

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

@SmileyChris
Django member

Yup, that's why.

@apollo13
Django member
apollo13 commented Jun 9, 2012

Fixed in 4464bbb

@claudep
Django member
claudep commented Jun 9, 2012

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
Something went wrong with that request. Please try again.