File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 33## 3.2.0 (Unreleased)
44
55- (feat) format JSON script tags
6+ - (fix) don't duplicate comments of nested script/style tags
67
78## 3.1.2
89
Original file line number Diff line number Diff line change @@ -366,7 +366,8 @@ async function embedTag(
366366 // the new position.
367367 return [ ...comments , result , hardline ] ;
368368 } else {
369- return comments . length ? [ ...comments , result ] : result ;
369+ // Only comments at the top level get the special "move comment" treatment.
370+ return isTopLevel && comments . length ? [ ...comments , result ] : result ;
370371 }
371372}
372373
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ import {
4646import {
4747 ASTNode ,
4848 AttributeNode ,
49- CommentInfo ,
5049 CommentNode ,
5150 IfBlockNode ,
5251 Node ,
Original file line number Diff line number Diff line change 1+ < div >
2+ <!-- hello -->
3+ < style > </ style >
4+ </ div >
5+ < svelte:head >
6+ <!-- world -->
7+ < script >
8+ let x ;
9+ </ script >
10+ </ svelte:head >
You can’t perform that action at this time.
0 commit comments