Skip to content

Commit

Permalink
Retain whitespace 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 6d4bade commit 351d8bd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## HEAD

- Retain whitespace in selectors. Closes #8
- Add support for `@-ms-keyframes`.

## 0.3.0 - 23 Nov 2013
Expand Down
1 change: 1 addition & 0 deletions lib/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ function lex(css) {
case 'comment':
case 'single-string':
case 'double-string':
case 'selector':
buffer += ch;
break;

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

describe('whitespace within selectors', function () {
it('should be retained', function () {
var css = [
'body \t ',
'div \r ',
'span \f ',
'a {',
'color: red;',
'}'
].join('\n');

ensure(css);
});
});

});

0 comments on commit 351d8bd

Please sign in to comment.