Commit 5d466bc 1 parent a0dbb3d commit 5d466bc Copy full SHA for 5d466bc
File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export function defaultExtractor(context) {
32
32
// If the next segment is a number, discard both, for example seeing
33
33
// `px-1` and `5` means the real candidate was `px-1.5` which is already
34
34
// captured.
35
- let next = parseInt ( segments [ idx + 1 ] )
35
+ let next = Number ( segments [ idx + 1 ] )
36
36
if ( isNaN ( next ) ) {
37
37
results . push ( segment )
38
38
} else {
Original file line number Diff line number Diff line change @@ -476,6 +476,16 @@ test('classes in slim templates', async () => {
476
476
expect ( extractions ) . toContain ( 'text-gray-500' )
477
477
} )
478
478
479
+ test ( 'classes in slim templates starting with number' , async ( ) => {
480
+ const extractions = defaultExtractor ( `
481
+ .bg-green-300.2xl:bg-red-300
482
+ '(Look mom, no closing tag!)
483
+ ` )
484
+
485
+ expect ( extractions ) . toContain ( 'bg-green-300' )
486
+ expect ( extractions ) . toContain ( '2xl:bg-red-300' )
487
+ } )
488
+
479
489
test ( "classes with fractional numeric values don't also generate the whole number utility" , async ( ) => {
480
490
const extractions = defaultExtractor ( `
481
491
<div class="px-1.5 py-2.75">Hello world!</div>
You can’t perform that action at this time.
0 commit comments