premasagar / tim

A tiny, secure JavaScript micro-templating script.
251 stars 26 forks source link

Identical nested close tags not correctly identified #2

Open premasagar opened 13 years ago

premasagar commented 13 years ago

E.g. for the template:

{{_content}}
    {{_content}} foo {{/_content}}
{{_/content}}

Line 224:

closePos = templateEnd.indexOf(closeToken);

This instead needs to walk through multiple open tokens, and only identify a matching closing token.