Skip to content

Commit

Permalink
Retain newlines in selectors. Closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
brettstimmerman committed Dec 1, 2013
1 parent 5aadd71 commit f1b3a1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ function lex(css) {
case 'comment':
case 'single-string':
case 'double-string':
case 'selector':
buffer += ch;
break;

Expand Down
13 changes: 13 additions & 0 deletions test/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,17 @@ describe('General Syntax', function () {
});
});

describe('newlines within selectors', function () {
it('should be treated as whitespace', function () {
var css = [
'body',
'div {',
'color: red;',
'}'
].join('\n');

ensure(css);
});
});

});

0 comments on commit f1b3a1f

Please sign in to comment.