Skip to content

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

Open

Description

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

was rewritten to

<FooBar @placeholder="Choose a "thing"" />

Activity

  1. tylerturdenpants commented on Dec 30, 2019

    @tylerturdenpants
    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.

  2. added
    bug
    on Dec 30, 2019
  3. rajasegar commented on Jan 12, 2020

    @rajasegar
    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"}}
        `;
  4. rajasegar commented on Jan 12, 2020

    @rajasegar
    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.

  5. kategengler commented on Jan 12, 2020

    @kategengler
    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.

  6. rajasegar commented on Jan 12, 2020

    @rajasegar
    Member

    @kategengler Makes sense, understood.

  7. tylerturdenpants commented on Jan 12, 2020

    @tylerturdenpants
    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.

  8. rajasegar commented on Jan 12, 2020

    @rajasegar
    Member

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

  9. tylerturdenpants commented on Jan 12, 2020

    @tylerturdenpants
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions