Skip to content

Commit

Permalink
Fix last rule being ignored if empty indents at the end of the file
Browse files Browse the repository at this point in the history
  • Loading branch information
tonistiigi committed May 30, 2012
1 parent 0ca26c5 commit 6916f8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/lexer.js
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions test/cases/whitespace.oes.css
@@ -0,0 +1,4 @@
.myclass {
display: block;
color: #000;
}
5 changes: 5 additions & 0 deletions test/cases/whitespace.oes.styl
@@ -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.