Skip to content

Escaping of the closing sigil when multiline syntax is used #11390

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
fuelen opened this issue Nov 15, 2021 · 0 comments
Closed

Escaping of the closing sigil when multiline syntax is used #11390

fuelen opened this issue Nov 15, 2021 · 0 comments

Comments

@fuelen
Copy link
Contributor

fuelen commented Nov 15, 2021

Environment

  • Elixir & Erlang/OTP versions (elixir --version): 1.12.3 & 24

Current behavior

It is not clear how to escape closing symbols when multiline syntax is used with ~S sigil.
\""" works fine without ~S sigil:

iex(1)> """
...(1)> \"""
...(1)> """ |> IO.inspect() |> IO.puts()
"\"\"\"\n"
"""

but not with ~S sigil:

iex(2)> ~S"""
...(2)> \"""
...(2)> """ |> IO.inspect() |> IO.puts()
"\\\"\"\"\n"
\"""

Expected behavior

escaping """ using single \ shouldn't add \ to the output

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

No branches or pull requests

1 participant