File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
packages/svelte/tests/parser-modern Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ function clean(ast: AST.SvelteNode) {
7272
7373 context . next ( ) ;
7474 } ,
75+ StyleSheet ( node , context ) {
76+ return {
77+ type : node . type ,
78+ attributes : node . attributes . map ( ( attribute ) => context . visit ( attribute ) ) ,
79+ children : node . children . map ( ( child ) => context . visit ( child ) ) ,
80+ content : { }
81+ } as AST . SvelteNode ;
82+ } ,
7583 Fragment ( node , context ) {
7684 const nodes : AST . SvelteNode [ ] = [ ] ;
7785
@@ -80,11 +88,19 @@ function clean(ast: AST.SvelteNode) {
8088
8189 if ( child . type === 'Text' ) {
8290 if ( i === 0 ) {
83- child = { ...child , data : child . data . trimStart ( ) } ;
91+ child = {
92+ ...child ,
93+ data : child . data . trimStart ( ) ,
94+ raw : child . raw . trimStart ( )
95+ } ;
8496 }
8597
8698 if ( i === node . nodes . length - 1 ) {
87- child = { ...child , data : child . data . trimEnd ( ) } ;
99+ child = {
100+ ...child ,
101+ data : child . data . trimEnd ( ) ,
102+ raw : child . raw . trimEnd ( )
103+ } ;
88104 }
89105
90106 if ( ! child . data ) continue ;
You can’t perform that action at this time.
0 commit comments