Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/converters.py

Issue 4949324312084480: Issue 2323 - Resolve links automatically in templates as well (Closed)
Patch Set: Created April 20, 2015, 11:41 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/converters.py
===================================================================
--- a/cms/converters.py
+++ b/cms/converters.py
@@ -325,17 +325,20 @@ class TemplateConverter(Converter):
self._env.globals.update(globals)
def get_html(self, source):
template = self._env.from_string(source)
module = template.make_module(self._params)
for key, value in module.__dict__.iteritems():
if not key.startswith("_"):
self._params[key] = value
- return unicode(module)
+
+ result = unicode(module)
Sebastian Noack 2015/04/20 11:47:38 Nit: I'd rather chain the function calls instead i
Wladimir Palant 2015/04/20 11:50:37 I'd rather keep it this way - the other generators
+ result = self.process_links(result)
+ return result
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):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld