diff options
author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-01-13 21:39:56 -0800 |
---|---|---|
committer | Chris Jerdonek <chris.jerdonek@gmail.com> | 2012-01-18 13:26:20 -0800 |
commit | b808970c5521f2fbfface011c8af5395e5249564 (patch) | |
tree | 6b8ae304d47cfa756dab77735c2488721e4ac3f5 /pystache/renderengine.py | |
parent | 7cfa4b13cc1809ac45527bf5cfd9680c109d78e6 (diff) | |
download | pystache-b808970c5521f2fbfface011c8af5395e5249564.tar.gz |
Simplified the template regex: removed the "content" group.
Diffstat (limited to 'pystache/renderengine.py')
-rw-r--r-- | pystache/renderengine.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pystache/renderengine.py b/pystache/renderengine.py index 5869edc..f13fe7f 100644 --- a/pystache/renderengine.py +++ b/pystache/renderengine.py @@ -24,7 +24,6 @@ def _compile_template_re(delimiters): # NOT containing the current closing delimiter. # tag = r""" - (?P<content>[\s\S]*?) (?P<whitespace>[\ \t]*) %(otag)s \s* (?: @@ -326,12 +325,14 @@ class RenderEngine(object): if match is None: break - matches = match.groupdict() - - match_index = match.end('content') + match_index = match.start() end_index = match.end() - parse_tree.append(matches['content']) + before_tag = template[index : match_index] + + parse_tree.append(before_tag) + + matches = match.groupdict() index = self._handle_match(template, parse_tree, matches, start_index, match_index, end_index) |