File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
packages/svelte/src/compiler/print Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ const svelte_visitors = {
348348 } else {
349349 sequence . push ( child_node ) ;
350350
351- if ( next && child_node . type === 'RegularElement' ) flush ( ) ;
351+ if ( child_node . type === 'RegularElement' ) flush ( ) ;
352352 }
353353 }
354354
@@ -357,18 +357,20 @@ const svelte_visitors = {
357357 let multiline = false ;
358358 let width = 0 ;
359359
360- const child_contexts = items . map ( ( sequence ) => {
361- const child_context = context . new ( ) ;
360+ const child_contexts = items
361+ . filter ( ( x ) => x . length > 0 )
362+ . map ( ( sequence ) => {
363+ const child_context = context . new ( ) ;
362364
363- for ( const node of sequence ) {
364- child_context . visit ( node ) ;
365- multiline ||= child_context . multiline ;
366- }
365+ for ( const node of sequence ) {
366+ child_context . visit ( node ) ;
367+ multiline ||= child_context . multiline ;
368+ }
367369
368- width += child_context . measure ( ) ;
370+ width += child_context . measure ( ) ;
369371
370- return child_context ;
371- } ) ;
372+ return child_context ;
373+ } ) ;
372374
373375 multiline ||= width > LINE_BREAK_THRESHOLD ;
374376
You can’t perform that action at this time.
0 commit comments