Index: cms/converters.py |
=================================================================== |
--- a/cms/converters.py |
+++ b/cms/converters.py |
@@ -285,17 +285,21 @@ class TemplateConverter(Converter): |
filters[func].module_ref = module # Prevent garbage collection |
self._env = jinja2.Environment(loader=self._SourceLoader(self._params["source"]), autoescape=True) |
self._env.filters.update(filters) |
self._env.globals.update(globals) |
def get_html(self, source): |
template = self._env.from_string(source) |
- return template.render(self._params) |
+ module = template.make_module(self._params) |
+ for key, value in module.__dict__.iteritems(): |
+ if not key.startswith("_"): |
+ self._params[key] = value |
+ return unicode(module) |
def translate(self, default, name, comment=None): |
# Note: We currently ignore the comment, it is only relevant when |
# generating the master translation. |
localedata = self._params["localedata"] |
return jinja2.Markup(self.localize_string(name, default, localedata, html_escapes)) |
def get_string(self, name, page): |