#36758: Template parser
-------------------------------------+-------------------------------------
     Reporter:  Stephen Skett        |                     Type:
                                     |  Uncategorized
       Status:  new                  |                Component:  Template
                                     |  system
      Version:  4.2                  |                 Severity:  Normal
     Keywords:  template, filter,    |             Triage Stage:
  divisibleby, pipe, whitespace      |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Based on discussion from previous support ticket #4746, I believe it
 should now be possible to add whitespace around the pipe-character when
 using a filter in a Django-template, if that is stylistically preferred.

 However, I experience 'TemplateSyntaxError' when I use whitespace around
 the '|', specifically the built-in `divisibleby` filter - as in the
 following example:
 {{{
 {% for obj in some_collection %}
   {% if forloop.counter0 | divisibleby:num_items_per_row %}
     {% comment %}Some HTML here...{% endcomment %}
   {% endif %}
 {% endfor %}
 }}}

 I don't seem to encounter this error for any of the other built-in
 template-filters which I commonly use (e.g. `date`, `floatformat`, etc.),
 or with custom filters in my tag-libraries. Is this a bug with
 `divisibleby`, or am I missing something?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36758>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019acbd442f0-7a0b3eb5-a561-475e-8ea2-68d91fbec65f-000000%40eu-central-1.amazonses.com.

Reply via email to