Skip to content

Commit c646f97

Browse files
committed
fix
1 parent 4c404ac commit c646f97

File tree

1 file changed

+7
-1
lines changed
  • packages/svelte/src/compiler/print

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,13 @@ const visitors = {
300300

301301
context.visit(node.consequent);
302302
if (node.alternate !== null) {
303-
if (!(node.alternate.type === 'IfBlock' && node.alternate.elseif)) {
303+
if (
304+
!(
305+
node.alternate.nodes.length === 1 &&
306+
node.alternate.nodes[0].type === 'IfBlock' &&
307+
node.alternate.nodes[0].elseif
308+
)
309+
) {
304310
context.write('{:else}');
305311
}
306312
context.visit(node.alternate);

0 commit comments

Comments
 (0)