#17719: Improper parsing of template block and variable tags
---------------------------------+--------------------
     Reporter:  development@…    |      Owner:  nobody
         Type:  Bug              |     Status:  new
    Component:  Template system  |    Version:  1.3
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+--------------------
 Django template parsing (Lexer) looks for the first occurrence of %} after
 a {% when determining what a block tag is.  This prevents the use of "%}"
 as a string literal.  So a template syntax error will be raised for the
 following valid expressions:
 {{{
   {% include "template.html" tvar="Some string literal with %} in it." %}
   {% with tvar="Some string literal with %} in it." %}{% endwith %}
 }}}

 This is also true for variable tag parsing.  Example:
 {{{
   {{ some.variable|default:"}}" }}
 }}}

 If this is expected/intended behavior, it doesn't appear to be documented
 anywhere.

 The actual fix doesn't look trivial, but shouldn't be too bad.  I could
 help with a fix if there's interest in that.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17719>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to