emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.45k stars 4.21k forks source link

[Bug] Whitespace issue in HBS #19602

Open boris-petrov opened 3 years ago

boris-petrov commented 3 years ago

🐞 Describe the Bug

Check out the reproduction.

🔬 Minimal Reproduction

Component foo (without a new line at the end of the file):

asd

Use it:

<span> (asd) </span>
<span> ({{foo}}) </span>
<span> ({{#foo}}{{/foo}}) </span>

This renders:

(asd) (asd ) (asd )

😕 Actual Behavior

Note the space after the second and third asd. It should not be there.

Changing the foo component to have something other than plain text like:

{{#each (array) as |item|}}
{{/each}}

Fixes the issue.

🤔 Expected Behavior

No space.

🌍 Environment

pzuraq commented 3 years ago

Is this a new issue, or has it been present?

boris-petrov commented 3 years ago

I'm sorry, I don't know. I found this one trying to reproduce the other one. The other one is something new though. That is, I do remember it not doing that a while ago. Can't say how long ago though.