Commit 3e453f82 by Jake Archibald

Chewing through template rather than recursively replacing

parent 9923bef5
......@@ -103,6 +103,8 @@ class Template(object):
return template
def _render_tags(self, template):
output = ''
while True:
match = self.tag_re.search(template)
if match is None:
......@@ -112,9 +114,11 @@ class Template(object):
tag_name = tag_name.strip()
func = self.modifiers[tag_type]
replacement = func(self, tag_name)
template = template.replace(tag, replacement)
return template
output = output + template[0:match.start()] + replacement
template = template[match.end():]
output = output + template
return output
def _render_dictionary(self, template, context):
self.view.context_list.insert(0, context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment