Permalink
Browse files

Fix last rule being ignored if empty indents at the end of the file

  • Loading branch information...
1 parent 0ca26c5 commit 6916f8cc0b647a35b0b1b9029c958ad893a2e11f @tonistiigi committed May 30, 2012
Showing with 10 additions and 0 deletions.
  1. +1 −0 lib/lexer.js
  2. +4 −0 test/cases/whitespace.oes.css
  3. +5 −0 test/cases/whitespace.oes.styl
View
@@ -67,6 +67,7 @@ function Lexer(str, options) {
};
this.str = str
+ .replace(/\s+$/, '\n')
.replace(/\r\n?/g, '\n')
.replace(/\\ *\n/g, ' ')
.replace(/([,:(]) *\n\s*/g, comment)
@@ -0,0 +1,4 @@
+.myclass {
+ display: block;
+ color: #000;
+}
@@ -0,0 +1,5 @@
+// Last line in this file has 4 spaces.
+.myclass
+ display block
+ color black
+

0 comments on commit 6916f8c

Please sign in to comment.