-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Yaml::dump adds erroneous trailing \n (with Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK) #38310
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
Comments
I just updated the IS, it contained a wrong and heavily confusing "How to reproduce". SORRY. |
Convenience: The related PR. It looks like all the "multiline" tests contain a "\r\n" and iigir, are not dumped as multiline anymore after that PR, leaving us with no multiline test coverage. |
I forgot to comment here. I was already able to extract a good test case. Unfortunately, the fix wasn't that easy back then when I tried it. But it's on my list of things to do. |
@xabbuh Great it's on your list! As noted in the IS, quite some Drupal folks will ❤️ this. IIGIR, the key to solve this is the Block Chomping Indicator "|-"/">+". |
here we go: #39668 |
…locks (xabbuh) This PR was merged into the 4.4 branch. Discussion ---------- [Yaml] do not dump extra trailing newlines for multiline blocks | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #38310 | License | MIT | Doc PR | Commits ------- 5fa9592 do not dump extra trailing newlines for multiline blocks
Symfony version(s) affected: 3.4.41 (and probably master too)
Description
Yaml::parse(Yaml::dump("a\nb")) === "a\nb\n"
In other words, multiline YML does not roundtrip, it seems to always get a trailing newline.
How to reproduce
Possible Solution
Add such test and fix code.
Additional context
The text was updated successfully, but these errors were encountered: