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

styler result different for strings depending on type of enclosing quote #458

Closed
wdearden opened this issue Jan 17, 2019 · 1 comment
Closed

Comments

@wdearden
Copy link

The result of

styler::style_text(
"
\"SELECT *
FROM table
\"
"
)

is

"SELECT *
FROM table
"

but the result of

styler::style_text(
"
'SELECT *
FROM table
'
"
)

is

"SELECT *\nFROM table\n"

I think the preferred behavior should be the first result.

@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Jan 18, 2019

Thanks. A related issue is that \n is always resolved into an actual line break:

styler::style_text("\"SELECT *\nFROM table\n\"\n")
#> "SELECT *
#> FROM table
#> "

Created on 2019-01-18 by the reprex package (v0.2.1)

We can solve the problem outlined by @wdearden with a solution that does not affect the problem presented just above so I think we should do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants