Skip to content

Commit

Permalink
Vendor prefix align: Handle declarations without preceding spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyganch committed Jun 9, 2014
1 parent 4644605 commit 1e7ceb8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/options/vendor-prefix-align.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ module.exports = (function() {
payload: function(info, i) {
// `node[i - 1]` can be either space or comment:
var whitespaceNode = node[i - 1];
if (!whitespaceNode) return;
// If it's a comment, insert an empty space node:
if (whitespaceNode[0] !== 's') {
whitespaceNode = ['s', ''];
Expand Down
4 changes: 4 additions & 0 deletions test/options/vendor-prefix-align.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ describe('options/vendor-prefix-align', function() {
this.shouldBeEqual('complex.css', 'complex.expected.css');
});

it('Issue 193: should handle declarations without preceding spaces', function() {
this.shouldBeEqual('issue-193.css', 'issue-193.expected.css');
});

it('Shouldn not detect anything if there are no prefixed groups', function() {
this.shouldDetect(
['vendor-prefix-align'],
Expand Down
2 changes: 2 additions & 0 deletions test/options/vendor-prefix-align/issue-193.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
li {color: #7799c8;
font-size: 10px;}
2 changes: 2 additions & 0 deletions test/options/vendor-prefix-align/issue-193.expected.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
li {color: #7799c8;
font-size: 10px;}

0 comments on commit 1e7ceb8

Please sign in to comment.