From 3efca794fd9accb67b1abafd5744e2afcbf03096 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 5 Mar 2014 15:58:43 -0500 Subject: [PATCH] regex cleanup; fixed indenting on partials --- src/middleware/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/middleware/index.js b/src/middleware/index.js index c3ab7ceb42..d5fb9b6a82 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -103,14 +103,15 @@ function compileTemplates() { async.each(Object.keys(paths), function(relative_path, next) { var file = fs.readFileSync(paths[relative_path]).toString(), - matches = null; + matches = null, + regex = /[ \t]*[ \t]*/; - while (matches = file.match(//)) { + while (matches = file.match(regex)) { if (paths["/" + matches[1]]) { - file = file.replace(//, fs.readFileSync(paths["/" + matches[1]]).toString()); + file = file.replace(regex, fs.readFileSync(paths["/" + matches[1]]).toString()); } else { winston.warn('[themes] Partial not found: ' + matches[1]); - file = file.replace(//, ""); + file = file.replace(regex, ""); } }