ember.js
ember.js copied to clipboard
[Bug] Whitespace issue in HBS 2
🐞 Describe the Bug
Check the reproduction.
🔬 Minimal Reproduction
Component foo:
{{#each (array 1 2) as |item index|~}}
{{~#if index}},{{/if}}{{yield item}}
{{~/each}}
Use it:
(<span>
{{#foo as |item|}}
{{~item~}}
{{/foo}}
</span>)
This renders:
( 1,2)
😕 Actual Behavior
Note the missing space before the closing parenthesis. There is a new line before the closing span tag so there should be a space.
Changing the usage to be something like:
(<span>
{{#foo as |item|}}
{{item}}
{{/foo}}
</span>)
Fixes the issue. The space appears correctly.
🤔 Expected Behavior
A space to be there.
🌍 Environment
- Ember: 3.27.5
- Node.js/npm: 16.3
- OS: Linux
- Browser: Chrome
may be related to https://github.com/glimmerjs/glimmer-vm/pull/1168
@didoo noticed this issue in one of our templates today. Wondering what the plan is to resolve?
I have created a small repro code here: https://ember-twiddle.com/3575bcb7229f8c689339408eb0dcbed2 in which, if you follow the content, I tried to explain what the issue is.
A similar issue:
(
{{~#foo as |item|}}
{{! @glint-expect-error }}
{{~item}}
{{~/foo~}}
)
Renders (1,2). It should, however, be ( 1, 2) because there is no whitespace-removal before the comment.