Skip to content

Commit

Permalink
engine.py: Add two default extensions
Browse files Browse the repository at this point in the history
The extensions are expression-statement and loop-controls

Related to moremoban#90
  • Loading branch information
ayan-b committed Jan 15, 2019
1 parent bb8c747 commit cb1556d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions moban/jinja2/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
"moban.jinja2.filters.text",
"moban.jinja2.tests.files",
]
JINJA2_THIRD_PARTY_EXTENSIONS = [
'jinja2.ext.do',
'jinja2.ext.loopcontrols',
]


class PluginMixin:
Expand Down Expand Up @@ -66,6 +70,7 @@ def __init__(self, template_dirs):
keep_trailing_newline=True,
trim_blocks=True,
lstrip_blocks=True,
extensions=JINJA2_THIRD_PARTY_EXTENSIONS,
)
for filter_name, filter_function in FILTERS.get_all():
self.jj2_environment.filters[filter_name] = filter_function
Expand Down

0 comments on commit cb1556d

Please sign in to comment.