@@ -67,10 +67,10 @@ describe('rehype-attr function test case', () => {
67
67
expect ( utils . propertiesHandle ( null , { } , 'string' ) ) . toEqual ( {
68
68
'data-config' : '{\"rehyp\":true}'
69
69
} ) ;
70
- expect ( utils . propertiesHandle ( null , null , 'string' ) ) . toEqual ( {
70
+ expect ( utils . propertiesHandle ( null , ( null as unknown as undefined ) , 'string' ) ) . toEqual ( {
71
71
'data-config' : '{\"rehyp\":true}'
72
72
} ) ;
73
- expect ( utils . propertiesHandle ( null , null , 'attr' ) ) . toEqual ( { } ) ;
73
+ expect ( utils . propertiesHandle ( null , ( null as unknown as undefined ) , 'attr' ) ) . toEqual ( { } ) ;
74
74
expect ( utils . propertiesHandle ( null , { a : 1 } , 'attr' ) ) . toEqual ( { a : 1 } ) ;
75
75
} ) ;
76
76
} )
@@ -123,7 +123,7 @@ describe('rehype-attr test case', () => {
123
123
} , {
124
124
title : 'options="attr" - Table 2 `\\n\\n` ???' ,
125
125
markdown : '| Property | Description |\n |---- |---- |\n | 1 | 2 |\n<!--rehype:border=1-->' ,
126
- expected : '<table><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr><tr><td> <!--rehype:border=1--></td><td></td></tr></tbody></table >' ,
126
+ expected : '<table border="1" ><thead><tr><th>Property</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table>\n <!--rehype:border=1-->' ,
127
127
}
128
128
] . forEach ( ( data , idx ) => {
129
129
it ( data . title , async ( ) => {
@@ -292,6 +292,11 @@ describe('rehype-attr test case', () => {
292
292
markdown : '#### This is a title\n<!--wwww:data-bool=true' ,
293
293
expected : '<h4>This is a title</h4>\n' ,
294
294
} ,
295
+ {
296
+ title : 'options="attr" - test identifier' ,
297
+ markdown : '#### This is a title\n<!--rehype:style=background-color: rgb(235 217 78/var(--bg-opacity));-->' ,
298
+ expected : '<h4 style="background-color: rgb(235 217 78/var(--bg-opacity));">This is a title</h4>\n<!--rehype:style=background-color: rgb(235 217 78/var(--bg-opacity));-->' ,
299
+ } ,
295
300
] . forEach ( ( data , idx ) => {
296
301
it ( data . title , async ( ) => {
297
302
const htmlStr = unified ( )
0 commit comments