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

Rewrites escaped quotes to quotes (causing Template Compiler Error) #219

Open
kategengler opened this issue Dec 30, 2019 · 8 comments · May be fixed by #222
Open

Rewrites escaped quotes to quotes (causing Template Compiler Error) #219

kategengler opened this issue Dec 30, 2019 · 8 comments · May be fixed by #222
Labels
bug Something isn't working

Comments

@kategengler
Copy link

{{foo-bar "placeholder="Choose a \"thing\"..."}}

was rewritten to

<FooBar @placeholder="Choose a "thing"" />
@tylerturdenpants
Copy link
Collaborator

@kategengler nice one! I’ll try to look at it in 2019 😆. Seriously I’ll try to at least get my head wrapped around this in the next day or so.

@Turbo87 Turbo87 added the bug Something isn't working label Dec 30, 2019
@tylerturdenpants tylerturdenpants linked a pull request Dec 31, 2019 that will close this issue
rajasegar added a commit to rajasegar/ember-angle-brackets-codemod that referenced this issue Jan 12, 2020
@rajasegar
Copy link
Member

with input fixture like this the test fails

  let input = `
    {{foo-bar placeholder="Choose a \"thing\" here"}}
    `;

But if the input fixture has double slashes like this, the test passes.

  let input = `
    {{foo-bar placeholder="Choose a \\"thing\\" here"}}
    `;

@rajasegar
Copy link
Member

@kategengler Out of curiosity, it is recommended not to use bare strings in templates right? Aren't you folks using any template-lint rules with bare-strings rule enabled.

@kategengler
Copy link
Author

@rajasegar no-bare-strings is not enabled by default in ember-template-lint, neither in recommended nor octane rulesets. It's an optional rule that can be enabled in apps that enforce internationalization. This doesn't apply to all apps -- I often build internal apps that are used by just a few people and so bare strings in the default language are fine.

@rajasegar
Copy link
Member

@kategengler Makes sense, understood.

@tylerturdenpants
Copy link
Collaborator

@kategengler @rajasegar there is a fix pending. It might be in the new ember-template-recast, as the root problem existed in the glimmer printer. This should be close to being finished.

@rajasegar
Copy link
Member

@tylerturdenpants So the fix would be to just bump ember-template-recast to a new version , I assume

@tylerturdenpants
Copy link
Collaborator

@rajasegar yes. I reopen a dependabot closed PR that would have down that but it looks like maybe another issue made its way through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants