From 3ea9c8d662f228bfd048f66daece8da67b25cc68 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Tue, 11 Jun 2024 10:45:00 +0100 Subject: [PATCH] enable jinja2 autoescape Fixes #1599 --- .../report/presentation/flavours/html/templates.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ydata_profiling/report/presentation/flavours/html/templates.py b/src/ydata_profiling/report/presentation/flavours/html/templates.py index 007f9599a..c26a9ddee 100644 --- a/src/ydata_profiling/report/presentation/flavours/html/templates.py +++ b/src/ydata_profiling/report/presentation/flavours/html/templates.py @@ -12,7 +12,10 @@ "ydata_profiling", "report/presentation/flavours/html/templates" ) jinja2_env = jinja2.Environment( - lstrip_blocks=True, trim_blocks=True, loader=package_loader + lstrip_blocks=True, + trim_blocks=True, + loader=package_loader, + autoescape=jinja2.select_autoescape(), ) jinja2_env.filters["is_list"] = lambda x: isinstance(x, list) jinja2_env.filters["fmt_badge"] = fmt_badge