Allow jinja environment to be passed to undeclared_template_variables
This commit is contained in:
parent
671c7c78a7
commit
b01f033d14
@ -558,11 +558,13 @@ class DocxTemplate(object):
|
||||
self.docx.save(filename,*args,**kwargs)
|
||||
self.post_processing(filename)
|
||||
|
||||
@property
|
||||
def undeclared_template_variables(self):
|
||||
def undeclared_template_variables(self, jinja_env=None):
|
||||
xml = self.get_xml()
|
||||
xml = self.patch_xml(xml)
|
||||
env = Environment()
|
||||
if jinja_env:
|
||||
env = jinja_env
|
||||
else:
|
||||
env = Environment()
|
||||
parse_content = env.parse(xml)
|
||||
return meta.find_undeclared_variables(parse_content)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user