fix(knext): add autoescape parameter in render_template (#193)

This commit is contained in:
Qu 2024-04-03 15:46:07 +08:00 committed by GitHub
parent 9191613d2a
commit 170e4c2ab0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,7 @@ from stat import S_IWUSR as OWNER_WRITE_PERMISSION
def render_template(
root: Union[str, os.PathLike], file: Union[str, os.PathLike], **kwargs: Any
) -> None:
env = Environment(loader=FileSystemLoader(root), autoescape=False)
env = Environment(loader=FileSystemLoader(root), autoescape=True)
template = env.get_template(str(file))
content = template.render(kwargs)