|
|
@@ -18,6 +18,9 @@ var Mustache = function() { |
|
|
pragmas: {}, |
|
|
pragmas: {}, |
|
|
buffer: [], |
|
|
buffer: [], |
|
|
pragmas_parsed: false, |
|
|
pragmas_parsed: false, |
|
|
|
|
|
pragmas_implemented: { |
|
|
|
|
|
"IMPLICIT-ITERATOR": true |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
render: function(template, context, partials, in_recursion) { |
|
|
render: function(template, context, partials, in_recursion) { |
|
|
// fail fast |
|
|
// fail fast |
|
|
@@ -68,6 +71,10 @@ var Mustache = function() { |
|
|
var regex = new RegExp(this.otag + "%([\\w_-]+) ?([\\w]+=[\\w]+)?" |
|
|
var regex = new RegExp(this.otag + "%([\\w_-]+) ?([\\w]+=[\\w]+)?" |
|
|
+ this.ctag); |
|
|
+ this.ctag); |
|
|
return template.replace(regex, function(match, pragma, options) { |
|
|
return template.replace(regex, function(match, pragma, options) { |
|
|
|
|
|
if(!that.pragmas_implemented[pragma]) { |
|
|
|
|
|
throw({message: "This implementation of mustache doesn't understand the '" |
|
|
|
|
|
+ pragma + "' pragma"}); |
|
|
|
|
|
} |
|
|
that.pragmas[pragma] = {}; |
|
|
that.pragmas[pragma] = {}; |
|
|
if(options) { |
|
|
if(options) { |
|
|
var opts = options.split("="); |
|
|
var opts = options.split("="); |
|
|
|