We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7910be8 commit 90ea50bCopy full SHA for 90ea50b
packages/svelte/src/compiler/print/index.js
@@ -526,10 +526,10 @@ const svelte_visitors = {
526
)
527
) {
528
context.write('{:else}');
529
+ block(context, node.alternate);
530
+ } else {
531
+ context.visit(node.alternate);
532
}
-
- // TODO inconsistent indentation behavior here
- block(context, node.alternate);
533
534
535
if (!node.elseif) {
packages/svelte/tests/print/samples/if-block/output.svelte
@@ -1,7 +1,7 @@
1
{#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>
+ <p>too hot1!</p>
+{:else if 80 > porridge.temperature}
+ <p>too cold!</p>
+{:else}
+ <p>just right!</p>
7
{/if}
0 commit comments