From 81dfbba0ec6154ab25a6c3a9fcf70886d6ba8ea8 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 9 Apr 2014 14:08:38 -0400 Subject: [PATCH] imported latest templates.js --- public/src/templates.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/src/templates.js b/public/src/templates.js index e34ac77588..368c80a277 100644 --- a/public/src/templates.js +++ b/public/src/templates.js @@ -76,7 +76,7 @@ } function makeRegex(block) { - return new RegExp("[\\s\\S]*", 'g'); + return new RegExp("[\\s\\S]*?", 'g'); } function makeConditionalRegex(block) { @@ -104,7 +104,7 @@ for (var i = 0, ii = matches.length; i < ii; i++) { var statement = makeStatementRegex(key), nestedConditionals = matches[i].match(/[\s|\S][\s|\S]/), - match = matches[i].replace(statement, '').replace(/[\s|\S][\s|\S]/, ''), + match = matches[i].replace(statement, '').replace(/[\s|\S][\s|\S]/gi, ''), conditionalBlock = match.split(/\s*\s*/); if (conditionalBlock[1]) { @@ -124,7 +124,9 @@ } if (nestedConditionals) { - template = template.replace('', nestedConditionals[0]); + for (var x = 0, xx = nestedConditionals.length; x < xx; x++) { + template = template.replace('', nestedConditionals[x]); + } } } }