File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module.exports = {
1111 if ( value === true ) this . _value = ' ' ;
1212 if ( typeof value === 'number' && value === Math . abs ( Math . round ( value ) ) )
1313 this . _value = new Array ( value + 1 ) . join ( ' ' ) ;
14- if ( typeof value === 'string' && value . match ( / ^ [ \t \n ] + $ / ) ) this . _value = value ;
14+ if ( typeof value === 'string' && value . match ( / ^ [ \t \n ] * $ / ) ) this . _value = value ;
1515 if ( typeof this . _value === 'string' ) return this ;
1616 } ,
1717
Original file line number Diff line number Diff line change @@ -44,6 +44,23 @@ describe('options/stick-brace', function() {
4444 '@media all\n{ .input__control\n{ color: #000;\n \n }\t}'
4545 ) ;
4646 } ) ;
47+ it ( 'Empty String value should set no space before brace' , function ( ) {
48+ comb . configure ( { 'stick-brace' : '' } ) ;
49+ assert . equal (
50+ comb . processString (
51+ 'a{ color: red }' +
52+ 'a, b /* i */ { color: red; }' +
53+ 'a \t\t \n{color:red\n \n}' +
54+ 'a /* foo */ {color:red ;\n}' +
55+ '@media all { .input__control { color: #000;\n \n }\t}'
56+ ) ,
57+ 'a{ color: red }' +
58+ 'a, b /* i */{ color: red; }' +
59+ 'a{color:red\n \n}' +
60+ 'a /* foo */{color:red ;\n}' +
61+ '@media all{ .input__control{ color: #000;\n \n }\t}'
62+ ) ;
63+ } ) ;
4764
4865 // Helper to check the detection
4966 function should_detect ( options , a , b ) {
You can’t perform that action at this time.
0 commit comments