From 9e5a1e41276c0529ab4f54135959a794aca53762 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Sat, 22 Jul 2023 17:42:12 -0400 Subject: [PATCH] Disable Jinja2 'autoescape' feature since it can produce broken output. Closes #8. --- changelog.d/8.fixing.md | 1 + src/jinjanator/cli.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/8.fixing.md diff --git a/changelog.d/8.fixing.md b/changelog.d/8.fixing.md new file mode 100644 index 0000000..54cb05a --- /dev/null +++ b/changelog.d/8.fixing.md @@ -0,0 +1 @@ +Disabled Jinja2 'autoescape' feature since it can produce incorrect output. \ No newline at end of file diff --git a/src/jinjanator/cli.py b/src/jinjanator/cli.py index f316220..94b0a00 100644 --- a/src/jinjanator/cli.py +++ b/src/jinjanator/cli.py @@ -70,7 +70,7 @@ def __init__( j2_env_params.setdefault("extensions", self.ENABLED_EXTENSIONS) j2_env_params.setdefault("loader", FilePathLoader(cwd)) - self._env = jinja2.Environment(**j2_env_params, autoescape=True) + self._env = jinja2.Environment(**j2_env_params, autoescape=False) # noqa: S701 for plugin_globals in plugin_hook_callers.plugin_globals(): self._env.globals.update(plugin_globals)