From 1bceb8dcf8ad380771b8581abe319715f89acc47 Mon Sep 17 00:00:00 2001 From: Johannes Ernst Date: Mon, 16 Dec 2024 11:57:50 -0800 Subject: [PATCH] Set jinja2 autoescape. Closes #424 --- src/feditest/testruntranscriptserializer/html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/feditest/testruntranscriptserializer/html.py b/src/feditest/testruntranscriptserializer/html.py index 16a2e06..44ff20b 100644 --- a/src/feditest/testruntranscriptserializer/html.py +++ b/src/feditest/testruntranscriptserializer/html.py @@ -61,7 +61,8 @@ def __init__(self, template_path: str): self.template_path = [ os.path.join(os.path.dirname(__file__), "templates/testplantranscript_default") ] self.jinja2_env = jinja2.Environment( - loader=jinja2.FileSystemLoader(self.template_path) + loader=jinja2.FileSystemLoader(self.template_path), + autoescape=jinja2.select_autoescape() ) self.jinja2_env.filters["regex_sub"] = lambda s, pattern, replacement: re.sub( pattern, replacement, s