Skip to content

Commit

Permalink
Highlight the nested if / else issue
Browse files Browse the repository at this point in the history
```
{{#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}}
```
  • Loading branch information
dcyriller committed Apr 25, 2019
1 parent ed15b6d commit 31eecd2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
32 changes: 32 additions & 0 deletions tests/glimmer/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -872,6 +872,16 @@ printWidth: 80
ac
{{/if}}
{{/if}}
{{#if a}}
a
{{else}}
{{#if c}}
c
{{/if}}
e
{{/if}}
=====================================output=====================================
{{#if a}}
b
Expand Down Expand Up @@ -936,6 +946,12 @@ printWidth: 80
ac
{{/if}}
{{/if}}
{{#if a}}
a
{{else if c}}
c
e
{{/if}}
================================================================================
`;

Expand Down Expand Up @@ -1015,6 +1031,16 @@ singleQuote: true
ac
{{/if}}
{{/if}}
{{#if a}}
a
{{else}}
{{#if c}}
c
{{/if}}
e
{{/if}}
=====================================output=====================================
{{#if a}}
b
Expand Down Expand Up @@ -1079,6 +1105,12 @@ singleQuote: true
ac
{{/if}}
{{/if}}
{{#if a}}
a
{{else if c}}
c
e
{{/if}}
================================================================================
`;

Expand Down
11 changes: 10 additions & 1 deletion tests/glimmer/else-if.hbs
Expand Up @@ -66,4 +66,13 @@
{{else if c}}
ac
{{/if}}
{{/if}}
{{/if}}

{{#if a}}
a
{{else}}
{{#if c}}
c
{{/if}}
e
{{/if}}

0 comments on commit 31eecd2

Please sign in to comment.