@@ -415,28 +415,24 @@ test('with single quotes array within template literal', async () => {
415
415
const extractions = defaultExtractor ( `<div class=\`\${['pr-1.5']}\`></div>` )
416
416
417
417
expect ( extractions ) . toContain ( 'pr-1.5' )
418
- expect ( extractions ) . not . toContain ( 'pr-1' )
419
418
} )
420
419
421
420
test ( 'with double quotes array within template literal' , async ( ) => {
422
421
const extractions = defaultExtractor ( `<div class=\`\${["pr-1.5"]}\`></div>` )
423
422
424
423
expect ( extractions ) . toContain ( 'pr-1.5' )
425
- expect ( extractions ) . not . toContain ( 'pr-1' )
426
424
} )
427
425
428
426
test ( 'with single quotes array within function' , async ( ) => {
429
427
const extractions = defaultExtractor ( `document.body.classList.add(['pl-1.5'].join(" "));` )
430
428
431
429
expect ( extractions ) . toContain ( 'pl-1.5' )
432
- expect ( extractions ) . not . toContain ( 'pl-1' )
433
430
} )
434
431
435
432
test ( 'with double quotes array within function' , async ( ) => {
436
433
const extractions = defaultExtractor ( `document.body.classList.add(["pl-1.5"].join(" "));` )
437
434
438
435
expect ( extractions ) . toContain ( 'pl-1.5' )
439
- expect ( extractions ) . not . toContain ( 'pl-1' )
440
436
} )
441
437
442
438
test ( 'with angle brackets' , async ( ) => {
@@ -449,3 +445,26 @@ test('with angle brackets', async () => {
449
445
expect ( extractions ) . not . toContain ( '>shadow-xl' )
450
446
expect ( extractions ) . not . toContain ( 'shadow-xl<' )
451
447
} )
448
+
449
+ test ( 'markdown code fences' , async ( ) => {
450
+ const extractions = defaultExtractor ( '<!-- this should work: `.font-bold`, `.font-normal` -->' )
451
+
452
+ expect ( extractions ) . toContain ( 'font-bold' )
453
+ expect ( extractions ) . toContain ( 'font-normal' )
454
+ expect ( extractions ) . not . toContain ( '.font-bold' )
455
+ expect ( extractions ) . not . toContain ( '.font-normal' )
456
+ } )
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