Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63a5ca7
commit 3c9f279
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#### [handlebars] correctly format custom "else if" blocks (#13507 by @jamescdavis) | ||
|
||
A template transform can be used to create custom block keywords that behave | ||
similar to `if`. This updates glimmer-printer to correctly recognize and format | ||
the "else if" case when "if" is a custom keyword. | ||
|
||
<!-- prettier-ignore --> | ||
```hbs | ||
{{! Input }} | ||
{{#when isAtWork}} | ||
Ship that code! | ||
{{else when isReading}} | ||
You can finish War and Peace eventually... | ||
{{else}} | ||
Go to bed! | ||
{{/when}} | ||
{{! Prettier stable }} | ||
{{#when isAtWork}} | ||
Ship that code! | ||
{{else}}{{#when isReading}} | ||
You can finish War and Peace eventually... | ||
{{else}} | ||
Go to bed! | ||
{{/when}}{{/when}} | ||
{{! Prettier main }} | ||
{{#when isAtWork}} | ||
Ship that code! | ||
{{else when isReading}} | ||
You can finish War and Peace eventually... | ||
{{else}} | ||
Go to bed! | ||
{{/when}} | ||
``` |