File tree 3 files changed +61
-9
lines changed 3 files changed +61
-9
lines changed Original file line number Diff line number Diff line change @@ -80,20 +80,20 @@ module.exports = function(css){
80
80
81
81
function declaration ( ) {
82
82
// prop
83
- var prop = match ( / ^ ( [ - \w ] + ) * / ) ;
83
+ var prop = match ( / ^ ( [ - \w ] + ) \s * / ) ;
84
84
if ( ! prop ) return ;
85
85
prop = prop [ 0 ] ;
86
86
87
87
// :
88
- if ( ! match ( / ^ : / ) ) return ;
88
+ if ( ! match ( / ^ : \s * / ) ) return ;
89
89
90
90
// val
91
- var val = match ( / ^ ( [ ^ } ; ] + ) / ) ;
91
+ var val = match ( / ^ ( [ ^ } ; ] + ) \s * / ) ;
92
92
if ( ! val ) return ;
93
93
val = val [ 0 ] . trim ( ) ;
94
94
95
95
// ;
96
- match ( / ^ ; \s + / ) ;
96
+ match ( / ^ ; \s * / ) ;
97
97
98
98
return { property : prop , value : val } ;
99
99
}
@@ -110,7 +110,7 @@ module.exports = function(css){
110
110
comments ( ) ;
111
111
112
112
// {
113
- if ( ! match ( / ^ { \s + / ) ) return ;
113
+ if ( ! match ( / ^ { \s * / ) ) return ;
114
114
comments ( ) ;
115
115
116
116
// declarations
Original file line number Diff line number Diff line change 1
- body {foo : 'bar' }
2
- this is really
3
- { terrible :
4
- 'css' }
1
+ body { foo
2
+ :
3
+ 'bar' }
4
+
5
+ body {foo : bar;bar : baz}
6
+ body
7
+ {
8
+ foo
9
+ :
10
+ bar
11
+ ;
12
+ bar
13
+ :
14
+ baz
15
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "stylesheet" : {
3
+ "rules" : [
4
+ {
5
+ "selector" : " body" ,
6
+ "declarations" : [
7
+ {
8
+ "property" : " foo\n " ,
9
+ "value" : " 'bar'"
10
+ }
11
+ ]
12
+ },
13
+ {
14
+ "selector" : " body" ,
15
+ "declarations" : [
16
+ {
17
+ "property" : " foo" ,
18
+ "value" : " bar"
19
+ },
20
+ {
21
+ "property" : " bar" ,
22
+ "value" : " baz"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "selector" : " body" ,
28
+ "declarations" : [
29
+ {
30
+ "property" : " foo\n " ,
31
+ "value" : " bar"
32
+ },
33
+ {
34
+ "property" : " bar\n " ,
35
+ "value" : " baz"
36
+ }
37
+ ]
38
+ }
39
+ ]
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments