-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
triple quotes lose escaped whitespace #21542
Comments
If the escaped newline is replaced by a literal newline, this is behaving as documented. The line of text is dedented and the newline immediately following the opening triple quote is stripped. What is the desired behavior here? Do we want escaped newlines to behave differently than literal newlines? Do we skip dedenting after an escaped newline? I like the current behavior of triple quotes including this example. |
I would expect the behavior in this case to retain the whitespace. Here's the different way this string is treated under different ways of declaring it: julia> s = """\n \t where is my newline?"""
"where is my newline?"
julia> print(s)
where is my newline?
julia> q = raw"\n \t where is my newline?"
"\\n \\t where is my newline?"
julia> q = "\n \t where is my newline?"
"\n \t where is my newline?"
julia> print(q)
where is my newline? If anything I think I would expect the single quotes to trim the whitespace, but the triple quote to retain it. Triple quote feels more literal to me. Especially sine the triple quote retains the non-literal spaces in the documentation: julia> """ This
is
a test"""
" This\nis\n a test" |
I think it would make sense to retain the escaped |
Fixed by #35001 |
The text was updated successfully, but these errors were encountered: