diff --git a/examples/delimiters.html b/examples/delimiters.html index 92bea6d..f3d934b 100644 --- a/examples/delimiters.html +++ b/examples/delimiters.html @@ -1,6 +1,6 @@ -{{=<% %>=}} -* <% first %> +{{=<% %>=}}* <% first %> +* <% second %> <%=| |=%> -* | second | +* | third | |={{ }}=| -* {{ third }} +* {{ fourth }} \ No newline at end of file diff --git a/examples/delimiters.js b/examples/delimiters.js index 8d56dcd..220d0d2 100644 --- a/examples/delimiters.js +++ b/examples/delimiters.js @@ -1,5 +1,6 @@ var delimiters = { first: "It worked the first time.", second: "And it worked the second time.", - third: "Then, surprisingly, it worked the third time." + third: "Then, surprisingly, it worked the third time.", + fourth: "Fourth time also fine!." } diff --git a/examples/delimiters.txt b/examples/delimiters.txt index e95cd11..9313445 100644 --- a/examples/delimiters.txt +++ b/examples/delimiters.txt @@ -1,7 +1,6 @@ - * It worked the first time. - * And it worked the second time. * Then, surprisingly, it worked the third time. +* Fourth time also fine!. diff --git a/mustache.js b/mustache.js index 6618961..6f2bb52 100644 --- a/mustache.js +++ b/mustache.js @@ -1,6 +1,7 @@ /* Shamless port of http://github.com/defunkt/mustache - by Jan Lehnardt , Alexander Lang + by Jan Lehnardt , Alexander Lang , + Sebastian Cohnen Thanks @defunkt for the awesome code. @@ -106,6 +107,8 @@ var Mustache = function() { case "=": // set new delimiters, rebuild the replace regexp that.set_delimiters(name); regex = new_regex(); + // redo the line in order to get tags with the new delimiters on the same line + i--; return ""; case "<": // render partial return that.render_partial(name, context);