Skip to content

Commit f2efe63

Browse files
committed
more fixes
1 parent 980c2bb commit f2efe63

File tree

1 file changed

+12
-10
lines changed
  • packages/svelte/src/compiler/print

1 file changed

+12
-10
lines changed

packages/svelte/src/compiler/print/index.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)