-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
At work, we are using Jinja to render templates as YAML. We'd like to customize all {{ variable }} expansions to do something sensible to Python values like None (which is null in YAML) and empty string (which is encoded as '' in YAML). It seems like the Jinja autoescaping mechanism would be perfect for this. Unfortunately, I don't see any way to configure the autoescaping functionality to not autoescape to HTML. Instead, I've had to monkeypatch Markup and escape in jinja2.runtime. It would be nice if there were an officially-sanctioned method to do this, for example by overriding something in the environment.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels