'Returns ``True`` if autoescaping should be active for the given
template name. If no template name is given, returns `True`.
.. versionadded:: 0.5'

def select_jinja_autoescape(self, filename):

    if (filename is None):
        return True
    return filename.endswith(('.html', '.htm', '.xml', '.xhtml'))
