@@ -90,7 +90,7 @@ test('name gen', t => {
90
90
</body>
91
91
</html>
92
92
` ;
93
- return posthtml ( ) . use ( plugin ( { filter } ) ) . process ( html )
93
+ return posthtml ( ) . use ( plugin ( { filter} ) ) . process ( html )
94
94
. then ( result => {
95
95
t . is ( result . html , expected ) ;
96
96
} ) ;
@@ -184,7 +184,7 @@ test('emoji name gen', t => {
184
184
</body>
185
185
</html>
186
186
` ;
187
- return posthtml ( ) . use ( plugin ( { filter, genNameClass : 'genNameEmoji' , genNameId : 'genNameEmoji' } ) ) . process ( html )
187
+ return posthtml ( ) . use ( plugin ( { filter, genNameClass : 'genNameEmoji' , genNameId : 'genNameEmoji' } ) ) . process ( html )
188
188
. then ( result => {
189
189
t . is ( result . html , expected ) ;
190
190
} ) ;
@@ -278,7 +278,7 @@ test('emoji string name gen', t => {
278
278
</body>
279
279
</html>
280
280
` ;
281
- return posthtml ( ) . use ( plugin ( { filter, genNameClass : 'genNameEmojiString' , genNameId : 'genNameEmojiString' } ) ) . process ( html )
281
+ return posthtml ( ) . use ( plugin ( { filter, genNameClass : 'genNameEmojiString' , genNameId : 'genNameEmojiString' } ) ) . process ( html )
282
282
. then ( result => {
283
283
t . is ( result . html , expected ) ;
284
284
} ) ;
@@ -372,14 +372,14 @@ test('ignored pattern should not affect use#href', t => {
372
372
</body>
373
373
</html>
374
374
` ;
375
- return posthtml ( ) . use ( plugin ( { filter } ) ) . process ( html )
375
+ return posthtml ( ) . use ( plugin ( { filter} ) ) . process ( html )
376
376
. then ( result => {
377
377
t . is ( result . html , expected ) ;
378
378
} ) ;
379
379
} ) ;
380
380
381
381
test ( 'should work with xlink:href and href' , t => {
382
- const filter = / ^ # i c o n - / ;
382
+ const filter = / ^ # i c o n - / ;
383
383
const html = `
384
384
<style>
385
385
#icon-location {
@@ -418,7 +418,7 @@ const filter = /^#icon-/;
418
418
<use xlink:href="#icon-location"></use>
419
419
</svg>
420
420
` ;
421
- return posthtml ( ) . use ( plugin ( { filter } ) ) . process ( html )
421
+ return posthtml ( ) . use ( plugin ( { filter} ) ) . process ( html )
422
422
. then ( result => {
423
423
t . is ( result . html , expected ) ;
424
424
} ) ;
@@ -502,7 +502,7 @@ test('ignore ids', t => {
502
502
</body>
503
503
</html>
504
504
` ;
505
- return posthtml ( ) . use ( plugin ( { filter, genNameId : false } ) ) . process ( html )
505
+ return posthtml ( ) . use ( plugin ( { filter, genNameId : false } ) ) . process ( html )
506
506
. then ( result => {
507
507
t . is ( result . html , expected ) ;
508
508
} ) ;
@@ -586,7 +586,7 @@ test('ignore classes', t => {
586
586
</body>
587
587
</html>
588
588
` ;
589
- return posthtml ( ) . use ( plugin ( { filter, genNameClass : false } ) ) . process ( html )
589
+ return posthtml ( ) . use ( plugin ( { filter, genNameClass : false } ) ) . process ( html )
590
590
. then ( result => {
591
591
t . is ( result . html , expected ) ;
592
592
} ) ;
@@ -719,7 +719,56 @@ test('strips unnecessary whitespaces when removing classes that do not match any
719
719
` ;
720
720
721
721
return posthtml ( ) . use ( plugin ( ) ) . process ( html )
722
- . then ( result => {
723
- t . is ( result . html , expected ) ;
724
- } ) ;
722
+ . then ( result => {
723
+ t . is ( result . html , expected ) ;
724
+ } ) ;
725
+ } ) ;
726
+
727
+ test ( 'Custom attribute names that will be involved in the process #36' , t => {
728
+ const html = `
729
+ <html>
730
+ <style>
731
+ .baz {
732
+ color: blue;
733
+ }
734
+ .biz {
735
+ color: green;
736
+ }
737
+ .buz {
738
+ color: red;
739
+ }
740
+ </style>
741
+ <body>
742
+ <div
743
+ x-transition:enter="baz"
744
+ x-transition:enter-start="biz"
745
+ x-transition:enter-end="buz"
746
+ >customAttributes</div>
747
+ </body>
748
+ </html>
749
+ ` ;
750
+
751
+ const expected = `
752
+ <html>
753
+ <style>
754
+ .a {
755
+ color: blue;
756
+ }
757
+ .b {
758
+ color: green;
759
+ }
760
+ .c {
761
+ color: red;
762
+ }
763
+ </style>
764
+ <body>
765
+ <div x-transition:enter="a" x-transition:enter-start="b" x-transition:enter-end="buz">customAttributes</div>
766
+ </body>
767
+ </html>
768
+ ` ;
769
+
770
+ return posthtml ( ) . use ( plugin ( { customAttributes : [ 'x-transition:enter' , 'x-transition:enter-start' ] } ) ) . process ( html )
771
+ . then ( result => {
772
+ t . is ( result . html , expected ) ;
773
+ } ) ;
725
774
} ) ;
0 commit comments