diff --git a/examples/array_of_partials_implicit_partial.html b/examples/array_of_partials_implicit_partial.html index 11537e9..1af6d68 100644 --- a/examples/array_of_partials_implicit_partial.html +++ b/examples/array_of_partials_implicit_partial.html @@ -1,5 +1,4 @@ Here is some stuff! -{{%IMPLICIT-ITERATOR}} {{#numbers}} {{>partial}} {{/numbers}} diff --git a/examples/array_of_strings.html b/examples/array_of_strings.html index ab058c4..38fa5ab 100644 --- a/examples/array_of_strings.html +++ b/examples/array_of_strings.html @@ -1,2 +1 @@ -{{%IMPLICIT-ITERATOR}} {{#array_of_strings}} {{.}} {{/array_of_strings}} \ No newline at end of file diff --git a/examples/array_partial.2.html b/examples/array_partial.2.html index 80d1d09..c2ea36c 100644 --- a/examples/array_partial.2.html +++ b/examples/array_partial.2.html @@ -1,6 +1,4 @@ Here's a non-sense array of values - -{{%IMPLICIT-ITERATOR}} {{#array}} {{.}} {{/array}} \ No newline at end of file diff --git a/examples/array_partial.txt b/examples/array_partial.txt index a604ac2..fa87c28 100644 --- a/examples/array_partial.txt +++ b/examples/array_partial.txt @@ -1,6 +1,4 @@ Here's a non-sense array of values - - 1 2 3 diff --git a/mustache.js b/mustache.js index be1d7e6..4b0a43e 100644 --- a/mustache.js +++ b/mustache.js @@ -260,8 +260,11 @@ var Mustache = function() { create_context: function(_context) { if(this.is_object(_context)) { return _context; - } else if(this.pragmas["IMPLICIT-ITERATOR"]) { - var iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator || "."; + } else { + var iterator = "."; + if(this.pragmas["IMPLICIT-ITERATOR"]) { + iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator; + } var ctx = {}; ctx[iterator] = _context; return ctx;