Skip to content
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 lines in *.hbs node innerHTML #41

Open
kcarmonamurphy opened this issue Nov 2, 2021 · 1 comment
Open

New lines in *.hbs node innerHTML #41

kcarmonamurphy opened this issue Nov 2, 2021 · 1 comment

Comments

@kcarmonamurphy
Copy link

kcarmonamurphy commented Nov 2, 2021

Thank you

Firstly, I'd like to say a huge thank you to the developers of emblem-migrator. I work for a medium sized fintech firm and we had over 260 *.emblem files in our repository that we were seeking to migrate. This tool made it quite easy to convert those in batches without disruption to other developers.

Problem description

Over the course of our conversions, we noticed several small visual regressions that would crop up after conversion. Notably, some of our layouts were sensitive to whitespace and changes to content in innerHTML. We noticed that the converted hbs files would sometimes have \n characters in the innerHTML of nodes. Here's an example:

Given this content:
Screen Shot 2021-11-02 at 9 37 37 AM

Before conversion
Screen Shot 2021-11-02 at 9 37 30 AM

After conversion
Screen Shot 2021-11-02 at 9 37 42 AM

Not sure if this is an issue with emblem-migrator or the way Handlebars handles whitespaces but I thought it'd raise this here. The workaround for us was to use the whitespace control feature (using ~) in handlebars (https://handlebarsjs.com/guide/expressions.html#whitespace-control) to remove whitespace before and after tags, although this didn't always solve our issues.

@Turbo87
Copy link
Collaborator

Turbo87 commented Nov 2, 2021

yeah, that's a known issue caused by the migrator running prettier on the templates after the conversion. If we skipped that step the templates would not be readable at all since the emblem compiler was not written for pretty-printing the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants