@@ -257,6 +257,7 @@ function convertHTMLElement(
257
257
parent,
258
258
...locs ,
259
259
} ;
260
+ ctx . elements . set ( element , node ) ;
260
261
element . startTag . parent = element ;
261
262
const elementName = node . name ;
262
263
@@ -265,19 +266,19 @@ function convertHTMLElement(
265
266
if ( letDirectives . length ) {
266
267
ctx . letDirCollections . beginExtract ( ) ;
267
268
element . startTag . attributes . push (
268
- ...convertAttributes ( letDirectives , element . startTag , elementName , ctx ) ,
269
+ ...convertAttributes ( letDirectives , element . startTag , ctx ) ,
269
270
) ;
270
271
letParams . push ( ...ctx . letDirCollections . extract ( ) . getLetParams ( ) ) ;
271
272
}
272
273
if ( ! letParams . length && ! needScopeByChildren ( node ) ) {
273
274
element . startTag . attributes . push (
274
- ...convertAttributes ( attributes , element . startTag , elementName , ctx ) ,
275
+ ...convertAttributes ( attributes , element . startTag , ctx ) ,
275
276
) ;
276
277
element . children . push ( ...convertChildren ( node , element , ctx ) ) ;
277
278
} else {
278
279
ctx . scriptLet . nestBlock ( element , letParams ) ;
279
280
element . startTag . attributes . push (
280
- ...convertAttributes ( attributes , element . startTag , elementName , ctx ) ,
281
+ ...convertAttributes ( attributes , element . startTag , ctx ) ,
281
282
) ;
282
283
sortNodes ( element . startTag . attributes ) ;
283
284
element . children . push ( ...convertChildren ( node , element , ctx ) ) ;
@@ -366,6 +367,7 @@ function convertSpecialElement(
366
367
parent,
367
368
...locs ,
368
369
} ;
370
+ ctx . elements . set ( element , node ) ;
369
371
element . startTag . parent = element ;
370
372
const elementName = node . name ;
371
373
@@ -374,19 +376,19 @@ function convertSpecialElement(
374
376
if ( letDirectives . length ) {
375
377
ctx . letDirCollections . beginExtract ( ) ;
376
378
element . startTag . attributes . push (
377
- ...convertAttributes ( letDirectives , element . startTag , elementName , ctx ) ,
379
+ ...convertAttributes ( letDirectives , element . startTag , ctx ) ,
378
380
) ;
379
381
letParams . push ( ...ctx . letDirCollections . extract ( ) . getLetParams ( ) ) ;
380
382
}
381
383
if ( ! letParams . length && ! needScopeByChildren ( node ) ) {
382
384
element . startTag . attributes . push (
383
- ...convertAttributes ( attributes , element . startTag , elementName , ctx ) ,
385
+ ...convertAttributes ( attributes , element . startTag , ctx ) ,
384
386
) ;
385
387
element . children . push ( ...convertChildren ( node , element , ctx ) ) ;
386
388
} else {
387
389
ctx . scriptLet . nestBlock ( element , letParams ) ;
388
390
element . startTag . attributes . push (
389
- ...convertAttributes ( attributes , element . startTag , elementName , ctx ) ,
391
+ ...convertAttributes ( attributes , element . startTag , ctx ) ,
390
392
) ;
391
393
sortNodes ( element . startTag . attributes ) ;
392
394
element . children . push ( ...convertChildren ( node , element , ctx ) ) ;
@@ -606,6 +608,7 @@ function convertComponentElement(
606
608
parent,
607
609
...locs ,
608
610
} ;
611
+ ctx . elements . set ( element , node ) ;
609
612
element . startTag . parent = element ;
610
613
const elementName = node . name ;
611
614
@@ -614,19 +617,19 @@ function convertComponentElement(
614
617
if ( letDirectives . length ) {
615
618
ctx . letDirCollections . beginExtract ( ) ;
616
619
element . startTag . attributes . push (
617
- ...convertAttributes ( letDirectives , element . startTag , elementName , ctx ) ,
620
+ ...convertAttributes ( letDirectives , element . startTag , ctx ) ,
618
621
) ;
619
622
letParams . push ( ...ctx . letDirCollections . extract ( ) . getLetParams ( ) ) ;
620
623
}
621
624
if ( ! letParams . length && ! needScopeByChildren ( node ) ) {
622
625
element . startTag . attributes . push (
623
- ...convertAttributes ( attributes , element . startTag , elementName , ctx ) ,
626
+ ...convertAttributes ( attributes , element . startTag , ctx ) ,
624
627
) ;
625
628
element . children . push ( ...convertChildren ( node , element , ctx ) ) ;
626
629
} else {
627
630
ctx . scriptLet . nestBlock ( element , letParams ) ;
628
631
element . startTag . attributes . push (
629
- ...convertAttributes ( attributes , element . startTag , elementName , ctx ) ,
632
+ ...convertAttributes ( attributes , element . startTag , ctx ) ,
630
633
) ;
631
634
sortNodes ( element . startTag . attributes ) ;
632
635
element . children . push ( ...convertChildren ( node , element , ctx ) ) ;
0 commit comments