-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix autoescape fo Jinja template (#5419)
- Loading branch information
1 parent
c229848
commit 6a596f1
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import os | ||
|
||
import jinja2 | ||
import yaml | ||
import os | ||
|
||
env = jinja2.Environment( | ||
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)) | ||
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), | ||
autoescape=jinja2.select_autoescape( | ||
enabled_extensions=("html", "xml"), default_for_string=True | ||
), | ||
) | ||
|
||
with open('../metadata/sdks.yaml', 'r') as file: | ||
with open("../metadata/sdks.yaml", "r") as file: | ||
metadata = yaml.safe_load(file) | ||
for language in metadata.keys(): | ||
metadata[language] | ||
shortname = metadata[language]['property'] | ||
shortname = metadata[language]["property"] | ||
template = env.get_template("template.txt") | ||
print(template.render(language=language, shortname=shortname)) | ||
|
||
|
||
|