diff --git a/mustache.js b/mustache.js index 01a66d4..0ed2283 100644 --- a/mustache.js +++ b/mustache.js @@ -398,6 +398,7 @@ var Mustache = (function(undefined) { , state.partials ); new_state.metrics.partial = variable; + // TODO: Determine if partials should inherit pragma state from parent program = compile(new_state); state.partials[variable] = function(context, send_func) { @@ -552,6 +553,7 @@ var Mustache = (function(undefined) { new_state.metrics.character = state.metrics.character + token.length; new_state.metrics.partial = state.metrics.partial; new_state.section = state.section; + new_state.pragmas = state.pragmas; if (new_state.section) { new_state.section.template_buffer.push(token); } diff --git a/test/unit.js b/test/unit.js index 2907b62..9704016 100644 --- a/test/unit.js +++ b/test/unit.js @@ -499,8 +499,19 @@ test("'%' (Pragmas)", function() { { dataSet: [ 'Object 1', 'Object 2', 'Object 3' ] }, {} ), - "Object 1:Object 2:Object 3:" + "Object 1:Object 2:Object 3:", + 'Default behaviour for IMPLICIT ITERATOR' ); + + equals( + Mustache.to_html( + '{{%IMPLICIT-ITERATOR iterator=rob}}{{=<% %>=}}<%#dataSet%><%rob%>:<%/dataSet%>', + { dataSet: [ 'Object 1', 'Object 2', 'Object 3' ] }, + {} + ), + "Object 1:Object 2:Object 3:", + 'Change Delimiter and Pragma mixes' + ); }); test("Empty", function() {