Snippets are unofficial and unmaintained.
This is an archived view of user-submitted snippets. Despite being hosted on the Flask site, they are not official. No Flask maintainer has curated or checked the snippets for security, correctness, or design.
from flask import Flask class JHtmlEscapingFlask(Flask): def select_jinja_autoescape(self, filename): if filename.endswith('.jhtml'): return True return Flask.select_jinja_autoescape(self, filename) app = JHtmlEscapingFlask(__name__)
This snippet by Dag Odenhall can be used freely for anything you like. Consider it public domain.