Permalink
Browse files

Merge pull request #72 from brakhane/master

Bugfix regaring :else
  • Loading branch information...
2 parents b4244f4 + d33db30 commit 41ca0629a68c45a22789ad3773dfd990419fc0f4 @aaronblohowiak aaronblohowiak committed Sep 20, 2012
Showing with 8 additions and 3 deletions.
  1. +3 −3 lib/haml.js
  2. +4 −0 test/else.haml
  3. +1 −0 test/else.html
View
@@ -329,7 +329,7 @@ var Haml;
ifArray = [],
ifStatement;
for (var i=0, l=conditionsArray.length; i<l; i++) {
- ifArray.push('! ' + conditionsArray[i]);
+ ifArray.push('! (' + conditionsArray[i]+')');
}
conditionsArray.push(condition);
ifArray.push(condition);
@@ -350,7 +350,7 @@ var Haml;
ifArray = [],
ifStatement;
for (var i=0, l=conditionsArray.length; i<l; i++) {
- ifArray.push('! ' + conditionsArray[i]);
+ ifArray.push('! (' + conditionsArray[i]+')');
}
ifStatement = 'if (' + ifArray.join(' && ') + ') { ';
return '(function () { ' +
@@ -700,4 +700,4 @@ var Haml;
// Hook into module system
if (typeof module !== 'undefined') {
module.exports = Haml;
-}
+}
View
@@ -0,0 +1,4 @@
+:if 1 + 1 == 3
+ %p 1+1 = 3
+:else
+ %p 1+1 != 3
View
@@ -0,0 +1 @@
+<p>1+1 != 3</p>

0 comments on commit 41ca062

Please sign in to comment.