@@ -163,7 +163,7 @@ const parseAttributeJSXAttribute = (t, path, attributes, tagName, elementType) =
163
163
}
164
164
165
165
; [ name , ...modifiers ] = name . split ( '_' )
166
- ; [ name , argument ] = name . split ( ':' )
166
+ ; [ name , argument ] = name . split ( ':' )
167
167
168
168
prefix = prefixes . find ( el => name . startsWith ( el ) ) || 'attrs'
169
169
name = name . replace ( new RegExp ( `^${ prefix } \-?` ) , '' )
@@ -196,6 +196,8 @@ const parseAttributeJSXAttribute = (t, path, attributes, tagName, elementType) =
196
196
if ( isDirective ( name ) ) {
197
197
name = kebabcase ( name . substr ( 1 ) )
198
198
prefix = 'directives'
199
+ } else {
200
+ name = [ name , ...modifiers ] . join ( '_' )
199
201
}
200
202
if ( name . match ( xlinkRE ) ) {
201
203
name = name . replace ( xlinkRE , ( _ , firstCharacter ) => {
@@ -299,15 +301,15 @@ const transformDirectives = (t, directives) =>
299
301
: [ ] ) ,
300
302
...( directive . value . _modifiers && directive . value . _modifiers . length > 0
301
303
? [
302
- t . objectProperty (
303
- t . identifier ( 'modifiers' ) ,
304
- t . objectExpression (
305
- directive . value . _modifiers . map ( modifier =>
306
- t . objectProperty ( t . stringLiteral ( modifier ) , t . booleanLiteral ( true ) ) ,
307
- ) ,
304
+ t . objectProperty (
305
+ t . identifier ( 'modifiers' ) ,
306
+ t . objectExpression (
307
+ directive . value . _modifiers . map ( modifier =>
308
+ t . objectProperty ( t . stringLiteral ( modifier ) , t . booleanLiteral ( true ) ) ,
308
309
) ,
309
310
) ,
310
- ]
311
+ ) ,
312
+ ]
311
313
: [ ] ) ,
312
314
] ) ,
313
315
) ,
0 commit comments