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

Single-quoted symbols that contain double quotes don't escape their contents #347

Closed
reese opened this issue Nov 5, 2022 · 0 comments · Fixed by #370
Closed

Single-quoted symbols that contain double quotes don't escape their contents #347

reese opened this issue Nov 5, 2022 · 0 comments · Fixed by #370

Comments

@reese
Copy link
Collaborator

reese commented Nov 5, 2022

  • Ruby version: 2.7.2
  • Rubyfmt git sha: 1a40d19

Input file

:'"foo"'

Rubyfmt's output

:""foo""

This breaks because

The output is invalid syntax -- for strings, the inner quotes would get escaped, but this isn't done for symbols.

A behaviorally-equivalent output would be :"\"foo\""

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

Successfully merging a pull request may close this issue.

1 participant