Skip to content

Inline styles with Ruby code change double quotes to single #1262

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

Closed
Petercopter opened this issue Jul 27, 2022 · 4 comments
Closed

Inline styles with Ruby code change double quotes to single #1262

Petercopter opened this issue Jul 27, 2022 · 4 comments

Comments

@Petercopter
Copy link

Petercopter commented Jul 27, 2022

Metadata

  • Operating system: Ubuntu
  • Ruby version: latest
  • Node version: latest
  • @prettier/plugin-ruby or prettier gem version: latest
  • syntax_tree version: latest

I think this changed recently because of changes to syntax_tree: #1233

If the string contains Ruby code, it shouldn't change to single quotes.

Input

%div{style: "background: center/cover url(#{url_for(page.resource.file)})"}

Current output

%div{style: 'background: center/cover url(#{url_for(page.resource.file)})'}

Expected output

%div{style: "background: center/cover url(#{url_for(page.resource.file)})"}
@Petercopter
Copy link
Author

Petercopter commented Jul 28, 2022

Sorry, nevermind. I read about replacing prettier-ruby with syntax_tree, and did that instead. Problem solved!

#1232 (comment)

👍 🎉 😄

@kddnewton
Copy link
Member

I think this might still be an issue based on the most recent version of syntax_tree-haml, so I'll check this out.

@Petercopter
Copy link
Author

I think you might be right. Does the HAML plugin work with VSCode at this point? I thought it was working because it wasn't replacing the quotes, but with further use I realized it's not doing anything, lol.

@kddnewton
Copy link
Member

v1.3.1 of the HAML plugin is out now and should be fixed.

The HAML plugin works with VSCode, you need to specify it in the list of plugins in the configuration section of VSCode though, and make sure it's available in your Ruby path.

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