File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
-
2
1
module . exports = function ( css , options ) {
3
2
options = options || { } ;
4
3
@@ -170,7 +169,9 @@ module.exports = function(css, options){
170
169
function selector ( ) {
171
170
var m = match ( / ^ ( [ ^ { ] + ) / ) ;
172
171
if ( ! m ) return ;
173
- return trim ( m [ 0 ] ) . split ( / \s * , \s * / ) ;
172
+ /* @fix Remove all comments from selectors
173
+ * http://ostermiller.org/findcomment.html */
174
+ return trim ( m [ 0 ] ) . replace ( / \/ \* ( [ ^ * ] | [ \r \n ] | ( \* + ( [ ^ * / ] | [ \r \n ] ) ) ) * \* \/ + / g, '' ) . split ( / \s * , \s * / ) ;
174
175
}
175
176
176
177
/**
Original file line number Diff line number Diff line change 1
1
/* 1 */
2
2
3
- body { /* 2 */
3
+ head , /* footer, */ body /*, nav */ { /* 2 */
4
4
/* 3 */
5
5
/**/ foo : 'bar' ;
6
6
/* 4 */
Original file line number Diff line number Diff line change 20
20
{
21
21
"type" : " rule" ,
22
22
"selectors" : [
23
+ " head" ,
23
24
" body"
24
25
],
25
26
"declarations" : [
29
30
"position" : {
30
31
"start" : {
31
32
"line" : 3 ,
32
- "column" : 8
33
+ "column" : 37
33
34
},
34
35
"end" : {
35
36
"line" : 3 ,
36
- "column" : 15
37
+ "column" : 44
37
38
},
38
39
"source" : " comment.css"
39
40
}
You can’t perform that action at this time.
0 commit comments