@@ -415,28 +415,24 @@ test('with single quotes array within template literal', async () => {
415415 const extractions = defaultExtractor ( `<div class=\`\${['pr-1.5']}\`></div>` )
416416
417417 expect ( extractions ) . toContain ( 'pr-1.5' )
418- expect ( extractions ) . not . toContain ( 'pr-1' )
419418} )
420419
421420test ( 'with double quotes array within template literal' , async ( ) => {
422421 const extractions = defaultExtractor ( `<div class=\`\${["pr-1.5"]}\`></div>` )
423422
424423 expect ( extractions ) . toContain ( 'pr-1.5' )
425- expect ( extractions ) . not . toContain ( 'pr-1' )
426424} )
427425
428426test ( 'with single quotes array within function' , async ( ) => {
429427 const extractions = defaultExtractor ( `document.body.classList.add(['pl-1.5'].join(" "));` )
430428
431429 expect ( extractions ) . toContain ( 'pl-1.5' )
432- expect ( extractions ) . not . toContain ( 'pl-1' )
433430} )
434431
435432test ( 'with double quotes array within function' , async ( ) => {
436433 const extractions = defaultExtractor ( `document.body.classList.add(["pl-1.5"].join(" "));` )
437434
438435 expect ( extractions ) . toContain ( 'pl-1.5' )
439- expect ( extractions ) . not . toContain ( 'pl-1' )
440436} )
441437
442438test ( 'with angle brackets' , async ( ) => {
@@ -458,3 +454,17 @@ test('markdown code fences', async () => {
458454 expect ( extractions ) . not . toContain ( '.font-bold' )
459455 expect ( extractions ) . not . toContain ( '.font-normal' )
460456} )
457+
458+ test ( 'classes in slim templates' , async ( ) => {
459+ const extractions = defaultExtractor ( `
460+ p.bg-red-500.text-sm
461+ 'This is a paragraph
462+ small.italic.text-gray-500
463+ '(Look mom, no closing tag!)
464+ ` )
465+
466+ expect ( extractions ) . toContain ( 'bg-red-500' )
467+ expect ( extractions ) . toContain ( 'text-sm' )
468+ expect ( extractions ) . toContain ( 'italic' )
469+ expect ( extractions ) . toContain ( 'text-gray-500' )
470+ } )
0 commit comments