defunkt/pystache — Issue #91: Changing delimiters should only affect the upcoming text.
Author: lucasb-eyer
Created: 2012-02-29 08:45:28+00:00
State: open

I am not sure if/how this issue relates to issue #84

using the dataset `{"a":"a", "b":"b", "c":"c", "d":"d", "e":"e", "f":"f"}`

The following:

<%a%>
{{b}}
{{=<% %>=}}
<%c%>
{{d}}
<%={{ }}=%>
{{e}}
<%f%>

Should result in:

<%a%>
b
c
{{d}}
e
<%f%>

But it actually results in:

a
b
c
d
e
<%f%>

This is very bad if you want to use both server-side and clien-side templates within one file. I checked the code and couldn't think of a quick-fix because this bug is inherent in the way the parser works: just search the whole template for the first match to a regex, replace this match then restart, from the beginning. It would rather need to restart from the previous match position.