Skip to content

Commit d96412b

Browse files
committed
more
1 parent c646f97 commit d96412b

File tree

1 file changed

+13
-11
lines changed
  • packages/svelte/src/compiler/print

1 file changed

+13
-11
lines changed

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -299,18 +299,20 @@ const visitors = {
299299
context.write('}');
300300

301301
context.visit(node.consequent);
302-
if (node.alternate !== null) {
303-
if (
304-
!(
305-
node.alternate.nodes.length === 1 &&
306-
node.alternate.nodes[0].type === 'IfBlock' &&
307-
node.alternate.nodes[0].elseif
308-
)
309-
) {
310-
context.write('{:else}');
311-
}
312-
context.visit(node.alternate);
302+
}
303+
if (node.alternate !== null) {
304+
if (
305+
!(
306+
node.alternate.nodes.length === 1 &&
307+
node.alternate.nodes[0].type === 'IfBlock' &&
308+
node.alternate.nodes[0].elseif
309+
)
310+
) {
311+
context.write('{:else}');
313312
}
313+
context.visit(node.alternate);
314+
}
315+
if (!node.elseif) {
314316
context.write('{/if}');
315317
}
316318
},

0 commit comments

Comments
 (0)