Skip to content

Commit

Permalink
🐛 third party extensions as default even when no user extensions are …
Browse files Browse the repository at this point in the history
…nominated: #90
  • Loading branch information
chfw committed Jan 17, 2019
1 parent 970f651 commit 96928de
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions moban/jinja2/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ def __init__(self, template_dirs, extensions=None):
keep_trailing_newline=True,
trim_blocks=True,
lstrip_blocks=True,
extensions=[
extension for extension in JINJA2_THIRD_PARTY_EXTENSIONS
], # get a copy of this global variable
)
if is_extensions_valid(extensions):
env_params["extensions"] = (
extensions + JINJA2_THIRD_PARTY_EXTENSIONS
)
# because it is modified here
env_params["extensions"] += extensions
self.jj2_environment = Environment(**env_params)
for filter_name, filter_function in FILTERS.get_all():
self.jj2_environment.filters[filter_name] = filter_function
Expand Down

0 comments on commit 96928de

Please sign in to comment.