File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ class cssdoc {
1111 'whitespace ' => '\s++ ' ,
1212 'comment ' => '\\/ \\*[\d\D]*? \\* \\/ ' ,
1313 'quotes ' => '(?<! \\\\)("(?:[^" \\\\]++| \\\\.)*+"| \'(?:[^ \'\\\\]++| \\\\.)*+ \') ' ,
14- 'join ' => '[>+~] ' ,
1514 'comparison ' => '[\^*$<>]?= ' , // comparison operators for media queries or attribute selectors
15+ 'join ' => '[>+~* \\/-] ' ,
1616 'curlyopen ' => '{ ' ,
1717 'curlyclose ' => '} ' ,
1818 'squareopen ' => '\[ ' ,
@@ -23,7 +23,7 @@ class cssdoc {
2323 'colon ' => ': ' ,
2424 'semicolon ' => '; ' ,
2525 'directive ' => '@[a-z-]++ ' ,
26- 'string ' => '!?[^\[\]{}\(\):;,>+~\^$!" \n\r\t]++ '
26+ 'string ' => '!?[^\[\]{}\(\):;,>+~\^$!" \n\r\t\/ ]++ '
2727 ];
2828
2929 /**
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ public function parse(array &$tokens) : bool {
4040 $ join = ' ' ;
4141 }
4242 break ;
43+ case 'join ' :
44+ if ($ token ['value ' ] != '* ' ) {
45+ $ join = $ token ['value ' ];
46+ break ;
47+ }
4348 case 'string ' :
4449 $ this ->selectors [] = [
4550 'selector ' => $ token ['value ' ],
@@ -102,9 +107,6 @@ public function parse(array &$tokens) : bool {
102107 case 'comma ' :
103108 prev ($ tokens );
104109 break 2 ;
105- case 'join ' :
106- $ join = $ token ['value ' ];
107- break ;
108110 }
109111 } while (($ token = next ($ tokens )) !== false );
110112 return !empty ($ this ->selectors );
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public function parse(array &$tokens) : bool {
3636 do {
3737 switch ($ token ['type ' ]) {
3838 case 'string ' :
39+ case 'join ' :
3940 if ($ token ['value ' ] == '!important ' ) {
4041 prev ($ tokens );
4142 break 2 ;
@@ -130,7 +131,7 @@ public function compile(array $options) : string {
130131 }
131132 $ css .= '( ' .$ item ->compile ($ options ).') ' ;
132133 $ join = ' ' ;
133- } elseif ($ item == ': ' ) {
134+ } elseif (in_array ( $ item, [ ': ' , ' - ' , ' + ' ]) ) {
134135 $ css .= $ item ;
135136 $ join = '' ;
136137 } else {
You can’t perform that action at this time.
0 commit comments