Home / Function/ select_jinja_autoescape() — flask Function Reference

select_jinja_autoescape() — flask Function Reference

Architecture documentation for the select_jinja_autoescape() function in app.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  ba380111_3aea_0e4a_3cdc_c6b5aff05cf8["select_jinja_autoescape()"]
  38f6d4a2_834e_2acd_e1b6_f45c58079ccd["App"]
  ba380111_3aea_0e4a_3cdc_c6b5aff05cf8 -->|defined in| 38f6d4a2_834e_2acd_e1b6_f45c58079ccd
  style ba380111_3aea_0e4a_3cdc_c6b5aff05cf8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/sansio/app.py lines 533–544

    def select_jinja_autoescape(self, filename: str | None) -> bool:
        """Returns ``True`` if autoescaping should be active for the given
        template name. If no template name is given, returns `True`.

        .. versionchanged:: 2.2
            Autoescaping is now enabled by default for ``.svg`` files.

        .. versionadded:: 0.5
        """
        if filename is None:
            return True
        return filename.endswith((".html", ".htm", ".xml", ".xhtml", ".svg"))

Subdomains

Frequently Asked Questions

What does select_jinja_autoescape() do?
select_jinja_autoescape() is a function in the flask codebase, defined in src/flask/sansio/app.py.
Where is select_jinja_autoescape() defined?
select_jinja_autoescape() is defined in src/flask/sansio/app.py at line 533.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free