Skip to content

Commit 90ea50b

Browse files
committed
fix #if indentation
1 parent 7910be8 commit 90ea50b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,10 @@ const svelte_visitors = {
526526
)
527527
) {
528528
context.write('{:else}');
529+
block(context, node.alternate);
530+
} else {
531+
context.visit(node.alternate);
529532
}
530-
531-
// TODO inconsistent indentation behavior here
532-
block(context, node.alternate);
533533
}
534534

535535
if (!node.elseif) {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{#if porridge.temperature > 100}
2-
<p>too hot!</p>
3-
{:else if 80 > porridge.temperature}
4-
<p>too cold!</p>
5-
{:else}
6-
<p>just right!</p>
2+
<p>too hot1!</p>
3+
{:else if 80 > porridge.temperature}
4+
<p>too cold!</p>
5+
{:else}
6+
<p>just right!</p>
77
{/if}

0 commit comments

Comments
 (0)