From 31eecd232d45edd68697aebf05958abc69ef2cd3 Mon Sep 17 00:00:00 2001 From: Cyrille David Date: Thu, 25 Apr 2019 15:13:25 +0200 Subject: [PATCH] Highlight the nested if / else issue ``` {{#if a}} a {{else}} {{#if c}} c {{/if}} e {{/if}} ``` should be left untouched. Instead, it is turned into: ``` {{#if a}} a {{else if c}} c e {{/if}} ``` --- .../glimmer/__snapshots__/jsfmt.spec.js.snap | 32 +++++++++++++++++++ tests/glimmer/else-if.hbs | 11 ++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/tests/glimmer/__snapshots__/jsfmt.spec.js.snap b/tests/glimmer/__snapshots__/jsfmt.spec.js.snap index 4c7bfde8671a..7580902e4984 100644 --- a/tests/glimmer/__snapshots__/jsfmt.spec.js.snap +++ b/tests/glimmer/__snapshots__/jsfmt.spec.js.snap @@ -872,6 +872,16 @@ printWidth: 80 ac {{/if}} {{/if}} + +{{#if a}} + a +{{else}} + {{#if c}} + c + {{/if}} + e +{{/if}} + =====================================output===================================== {{#if a}} b @@ -936,6 +946,12 @@ printWidth: 80 ac {{/if}} {{/if}} +{{#if a}} + a +{{else if c}} + c +e +{{/if}} ================================================================================ `; @@ -1015,6 +1031,16 @@ singleQuote: true ac {{/if}} {{/if}} + +{{#if a}} + a +{{else}} + {{#if c}} + c + {{/if}} + e +{{/if}} + =====================================output===================================== {{#if a}} b @@ -1079,6 +1105,12 @@ singleQuote: true ac {{/if}} {{/if}} +{{#if a}} + a +{{else if c}} + c +e +{{/if}} ================================================================================ `; diff --git a/tests/glimmer/else-if.hbs b/tests/glimmer/else-if.hbs index 102767295e2b..e7db7bac77cc 100644 --- a/tests/glimmer/else-if.hbs +++ b/tests/glimmer/else-if.hbs @@ -66,4 +66,13 @@ {{else if c}} ac {{/if}} -{{/if}} \ No newline at end of file +{{/if}} + +{{#if a}} + a +{{else}} + {{#if c}} + c + {{/if}} + e +{{/if}}