Confirm the installed Jinja2 version.

Find every import of escape or Markup from jinja2.

Change application imports to markupsafe.

If an old Flask or extension still imports from jinja2, align versions instead.

Restart the app and run the tests.