| @@ -273,7 +273,7 @@ var Mustache = (function(undefined) { | |||||
| return state.template; | return state.template; | ||||
| } | } | ||||
| state.template = state.template.replace(/{{%([\w-]+)(\s*)(.*?(?=}}))}}/, function(match, pragma, space, suffix) { | |||||
| state.template = state.template.replace(/{{%([\w-]+)(\s*)(.*?(?=}}))}}/g, function(match, pragma, space, suffix) { | |||||
| var options = undefined, | var options = undefined, | ||||
| optionPairs, scratch, | optionPairs, scratch, | ||||
| i, n; | i, n; | ||||
| @@ -511,6 +511,21 @@ test("'%' (Pragmas)", function() { | |||||
| ), | ), | ||||
| "Object 1:Object 2:Object 3:", | "Object 1:Object 2:Object 3:", | ||||
| 'Change Delimiter and Pragma mixes' | 'Change Delimiter and Pragma mixes' | ||||
| ); | |||||
| raises( | |||||
| function() { | |||||
| Mustache.to_html( | |||||
| '{{%IMPLICIT-ITERATOR iterator=rob}}{{%I-HAVE-THE-GREATEST-MUSTACHE}}', | |||||
| {}, | |||||
| {} | |||||
| ); | |||||
| }, | |||||
| function(e) { | |||||
| return e.message === 'This implementation of mustache does not implement the "I-HAVE-THE-GREATEST-MUSTACHE" pragma.'; | |||||
| }, | |||||
| 'Multiple Pragmas' | |||||
| ); | ); | ||||
| }); | }); | ||||