-
Notifications
You must be signed in to change notification settings - Fork 856
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
Trim the newline right before the end-delimiter in multi-line strings. #318
Comments
To me, yes, what you are suggesting would be counter-intuitive. Trimming the leading newline is also slightly counter-intuitive, but the value of "all column-1 text can start on column 1 of the file" is greater than that counter-intuitiveness. But in your "Just a sentence" example, my brain expects to see two newlines at the end, because there's a blank line there before the closing delimiter. The absence of that second newline would bother me immensely, as would the absence of a final newline in this example:
If I wanted to have no newline at the end of that example, I would have put the closing tag immediately after the period -- and, in fact, I would have simply written |
Think about indentation, or you'll repeat the ugliness of "here documents" taught in too many bash tutorials: function ugly () {
( foo_header
foo_content_escape <<EndOfContent
Hello world, indentation is great!
Unfortunately, most tutorials make it
look like it's not allowed here:
EndOfContent
foo_trailer
) | tr A-Z a-z
} In bash and dash, fortunately, you can cheat by making the exact amount of whitespace part of your marker (which you'll then have to quote). In TOML however, you can't choose the marker. |
I think this issue can be closed:
|
Although you (the owners?) had decided not to trim the last newline in #225 , I'm still not for it. I'd like to make the newline “obvious”. E.g.
is equal to
key = """\nJust a sentence.\n"""
. Is it really counter-intuitive?And a special case:
The text was updated successfully, but these errors were encountered: