-
Notifications
You must be signed in to change notification settings - Fork 48
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
Multiline syntax with pipe (|
) not retained
#185
Comments
Hi @tamird thanks for opening an issue. Not sure whether this will work, but does adding |
No, the behavior is unchanged. |
This comment was marked as resolved.
This comment was marked as resolved.
seeing this as well |
the "fix" that worked for me was ensuring that there were no trailing spaces anywhere in the multiline block (including after the |
Right I remember this now. I was trying to solve this in the yaml library and got stuck. An interim fix could be to add a feature that trims the whitespace at the end of every string; that's doable without parsing. It would probably be a relatively useful feature anyway. My time to work on this project over the next couple weeks is unfortunately quite limited so I can't give an estimate for when that will get done, but next time I have time I will get this done. |
Just noting that something similar happens with To add another future test case idea: Observed:
Desired / expected: Newlines should have been preserved. |
I did add |
This does not work for with # cat .yamlfmt.yaml
trim_trailing_whitespace: true # cat hello.yaml
multiline_without_trailing_whitspaces: >-
hello
world
|
Hi @nikaro, Two things:
Applying both of those suggestions, I expect it will start to work. If it doesn't, please open a new issue with similar reproduction steps. EDIT: I corrected my suggestion in 2 |
Hi @braydonk
It works with your suggestion. Thanks. |
I'm not sure is it the same issue or not, please let me know if it's better to open a new issue for this. The problem is I'm unable to control "block chomping". No matter what I've inside a block and which config options I use it always replaces |
Oops, sorry, actually modification of "block chomping" symbol happens because of both some config options and block content. |
I see this diff:
This was previously discussed in #62 (comment).
The text was updated successfully, but these errors were encountered: