From 357880318e501d40e672576190ae4fb59a5964ae 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 7cc0956b2..d60bc2710 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