-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New line being inserted after a component (when pre-compiled?) #3715
Comments
The rails app template ends with a new line. That is where it is coming from. I do not think this is a bug... |
It's unclear where this is coming from, but it does seem like a bug. |
I tried reproducing this with ember app kit, but it doesn't seem to be affected. So that probably narrows it down to rails (sprocket..?) or ember-rails |
Found it! It's added by sprockets. The code has been around since forever and no one seems to know why. There's a related issue @ leshill/handlebars_assets#81. I'm unsure what to do at this point, @rjackson what do you think? Ideally we should fix sprockets itself but it doesn't look like it's going to happen anytime soon... |
By the way, in case you are wondering, yes - this is a real issue affecting our code, we are using components inside a whitespace sensitive context, and right now the workaround is to override render and trim the newline from the buffer =/ So I really hope this will get fixed one way or the other (work around sprockets in ember-rails, really push for a fix in sprockets, or whatever). I'm totally willing to help, but I want to get people's opinion on the best/preferred course of action here |
@chancancode Sorry about this. We don't control sprockets so there's not much we can do. It's possible |
The only solution that I can think of for now is to manually include the template into actual HTML output. This kinda SUCKS, but it should work... |
I'm pretty sure this is not the right project to report this bug, but since it cuts across ember, ember rails and handlebars, I need some help triaging this.
In this you can see that everything is working fine:
However, in this equivalent ember-rails app (source) a newline is beings inserted after each component call:
Inspecting the source it seems to be coming from here:
I'm unsure if this is a handlebars compiler bug, an ember bug or an ember-rails bug. Some help in getting this to the right hands would be appreciated. (The bug prevents components from being used inside any whitespace sensitive context.)
The text was updated successfully, but these errors were encountered: