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

Closed
wants to merge 1 commit into
from

Projects

None yet

6 participants

@SmileyChris
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
ramiro May 9, 2012 Django member

Docstring is a bit confusing.

@SmileyChris
SmileyChris May 9, 2012 Django member

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

@alex
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
Member

Yup, that's why.

@apollo13
Member
apollo13 commented Jun 9, 2012

Fixed in 4464bbb

@claudep
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