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

Bug: single/double quote conversion breaks with strings containing quotes #24

Closed
chasegiunta opened this issue Jan 20, 2020 · 4 comments

Comments

@chasegiunta
Copy link

Here's an example to make sense of:

{% set teamName = teamName|replace("College - Women's", "- Women's") %}

will format to

{% set teamName = teamName | replace('College - Women's', '- Women's') %}

The apostrophe in Women's is breaking our formatting here. Is it possible to detect ' or "characters inside our quotes and ignore the quote conversion, similar to how the detection is done in #21 with #{ and double quotes?

@twbartel
Copy link
Collaborator

Hey Chase, thanks, will take a look.

@twbartel
Copy link
Collaborator

There is a fix in v0.3.1. Can you have a look?

@chasegiunta
Copy link
Author

@twbartel That works, thanks!

Worth noting for future references that for those of us using VS Code, after updating prettier-plugin-twig-melody, VS Code needs a full restart to start using the updated version.

@twbartel
Copy link
Collaborator

Yeah, I noticed that, too. It's a bit annoying.

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