File tree 2 files changed +5
-2
lines changed
packages/purgecss-from-pug
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 6
6
div(class="test-container") Well
7
7
div(class="test-footer" id="an-id") I see a div
8
8
a(class="a-link" id="a-link" href="#") and a link
9
+ div(class="first-class second-class") This div has two classes
9
10
input#blo.enabled(type="text" disabled)
10
11
` ;
11
12
@@ -23,6 +24,8 @@ export const TEST_1_CLASS = [
23
24
"test-container" ,
24
25
"test-footer" ,
25
26
"a-link" ,
27
+ "first-class" ,
28
+ "second-class" ,
26
29
"enabled" ,
27
30
] ;
28
31
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ const purgeFromPug = (content: string): string[] => {
8
8
case "tag" :
9
9
case "id" :
10
10
case "class" :
11
- selectors . push ( token . val ) ;
11
+ selectors . push ( ... token . val . split ( " " ) ) ;
12
12
break ;
13
13
case "attribute" :
14
14
if ( token . name === "class" || token . name === "id" ) {
15
15
selectors . push (
16
- token . mustEscape ? token . val . replace ( / " / g, "" ) : token . val
16
+ ... ( token . mustEscape ? token . val . replace ( / " / g, "" ) : token . val ) . split ( " " )
17
17
) ;
18
18
}
19
19
break ;
You can’t perform that action at this time.
0 commit comments