From bfdc68cd6ad53ceecf132773f9aaba50dd80fe79 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Fri, 16 Jun 2023 01:10:24 +0800 Subject: [PATCH] Add autoescape to rendering --- Whatsapp_Chat_Exporter/extract.py | 2 +- Whatsapp_Chat_Exporter/extract_iphone.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Whatsapp_Chat_Exporter/extract.py b/Whatsapp_Chat_Exporter/extract.py index 02182f9..9415300 100644 --- a/Whatsapp_Chat_Exporter/extract.py +++ b/Whatsapp_Chat_Exporter/extract.py @@ -624,7 +624,7 @@ def create_html( template_dir = os.path.dirname(template) template_file = os.path.basename(template) templateLoader = jinja2.FileSystemLoader(searchpath=template_dir) - template_env = jinja2.Environment(loader=templateLoader) + template_env = jinja2.Environment(loader=templateLoader, autoescape=True) template_env.globals.update( determine_day=determine_day, no_avatar=no_avatar diff --git a/Whatsapp_Chat_Exporter/extract_iphone.py b/Whatsapp_Chat_Exporter/extract_iphone.py index 9d24aff..c56f50f 100644 --- a/Whatsapp_Chat_Exporter/extract_iphone.py +++ b/Whatsapp_Chat_Exporter/extract_iphone.py @@ -279,7 +279,7 @@ def create_html( template_dir = os.path.dirname(template) template_file = os.path.basename(template) templateLoader = jinja2.FileSystemLoader(searchpath=template_dir) - template_env = jinja2.Environment(loader=templateLoader) + template_env = jinja2.Environment(loader=templateLoader, autoescape=True) template_env.globals.update( determine_day=determine_day, no_avatar=no_avatar