#35296: The autoescape parameter to Engine() seems to have no effect
-------------------------------------------+------------------------
               Reporter:  Roman Donchenko  |          Owner:  nobody
                   Type:  Uncategorized    |         Status:  new
              Component:  Template system  |        Version:  5.0
               Severity:  Normal           |       Keywords:
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 The reference documentation for `django.template.Engine` says
 [https://docs.djangoproject.com/en/5.0/ref/templates/api/#configuring-an-
 engine the following]:

 * `autoescape` controls whether HTML autoescaping is enabled.
   It defaults to `True`.

 Based on this, I would expect the following to print `<>`:


 {{{#!python
 import django.template
 django.template.Engine(autoescape=False)
 t = e.from_string('{{x}}')
 print(t.render(django.template.Context({'x': '<>'})))
 }}}

 But it doesn't, it prints `&lt;&gt;`. So it seems that the `autoescape`
 parameter does nothing.

 Either the code should be updated to make the parameter work, or the docs
 should explain what it actually does.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35296>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e341e6368-44d05922-a082-4d76-84fa-266e3ed06782-000000%40eu-central-1.amazonses.com.

Reply via email to