From 299bb7be8ee16faced01fcdb8cdf3b14b835e9e2 Mon Sep 17 00:00:00 2001 From: "James C. Davis" Date: Thu, 1 Dec 2022 11:36:25 -0500 Subject: [PATCH] add changelog entry --- changelog_unreleased/handlebars/13930.md | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 changelog_unreleased/handlebars/13930.md diff --git a/changelog_unreleased/handlebars/13930.md b/changelog_unreleased/handlebars/13930.md new file mode 100644 index 000000000000..6e824a32e02c --- /dev/null +++ b/changelog_unreleased/handlebars/13930.md @@ -0,0 +1,42 @@ +#### Allow custom "else if"-like blocks with block params (#13930 by @jamescdavis) + +#13507 added support for custom block keywords used with `else`, but failed to allow block params. This updates printer-glimmer to allow block params with custom "else if"-like blocks. + + +```hbs +{{! Input }} +{#when isAtWork as |work|}} + Ship that + {{work}}! +{{else when isReading as |book|}} + You can finish + {{book}} + eventually... +{{else}} + Go to bed! +{{/when}} + +{{! Prettier stable }} +{{#when isAtWork as |work|}} + Ship that + {{work}}! +{{else when isReading}} + You can finish + {{book}} + eventually... +{{else}} + Go to bed! +{{/when}} + +{{! Prettier main }} +{#when isAtWork as |work|}} + Ship that + {{work}}! +{{else when isReading as |book|}} + You can finish + {{book}} + eventually... +{{else}} + Go to bed! +{{/when}} +```