Add preventIndent option for partials

This disables the standalone partial indent behavior required by the Mustache spec and allows for users to utilize partials in the same manner as under 1.x.

Fixes #858
This commit is contained in:
kpdecker
2014-11-02 12:19:56 -06:00
parent 7c220b9af5
commit 632fadcea3
3 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ global.compileWithPartials = function(string, hashOrArray, partials) {
ary = [];
ary.push(hashOrArray[0]);
ary.push({ helpers: hashOrArray[1], partials: hashOrArray[2] });
options = {compat: hashOrArray[3]};
options = typeof hashOrArray[3] === 'object' ? hashOrArray[3] : {compat: hashOrArray[3]};
if (hashOrArray[4] != null) {
options.data = !!hashOrArray[4];
ary[1].data = hashOrArray[4];