You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug removeLeftSideNewLineCharacter() does not remove the left side End Of Line (newline) character, \r\n, when they appear after a space. This issue does not occur in files where the EOL character is \n.
Expected behavior
I would expect the newline characters to be removed, so that no unexpected key name error is thrown.
Describe the bug
A second alternative is that it could instead be an issue with the tokenizer.
key1:
key2: abc
There is a space character after key1:. I don't know how to get a carriage return and newline character into the yaml document, so we'll imagine they are there. From viewing this document in the debugger, it appears that this space character is getting grouped with the key2 token, its Token.Origin has the value " \r\n key2". When that trailing space character after key1: is removed all of these issues are resolved. This issue does not occur in files where the EOL character is \n.
Version Variables
Go version: [e.g. 1.21 ]
go-yaml's Version: [e.g. v1.11.3 ]
The text was updated successfully, but these errors were encountered:
mfleader
changed the title
Does not remove left side linefeed characters when they appear after a whitespace character
Does not remove left side linefeed characters when they appear after a space character
Jul 10, 2024
mfleader
changed the title
Does not remove left side linefeed characters when they appear after a space character
Does not remove left side newline characters when they appear after a space character
Jul 11, 2024
mfleader
changed the title
Does not remove left side newline characters when they appear after a space character
Does not remove left side CRLF when it appears after a space character
Jul 11, 2024
Describe the bug
removeLeftSideNewLineCharacter()
does not remove the left side End Of Line (newline) character,\r\n
, when they appear after a space. This issue does not occur in files where the EOL character is\n
.To Reproduce
This causes an
unexpected key name
error.Expected behavior
I would expect the newline characters to be removed, so that no
unexpected key name
error is thrown.Describe the bug
A second alternative is that it could instead be an issue with the tokenizer.
There is a space character after
key1:
. I don't know how to get a carriage return and newline character into the yaml document, so we'll imagine they are there. From viewing this document in the debugger, it appears that this space character is getting grouped with thekey2
token, itsToken.Origin
has the value" \r\n key2"
. When that trailing space character afterkey1:
is removed all of these issues are resolved. This issue does not occur in files where the EOL character is\n
.Version Variables
The text was updated successfully, but these errors were encountered: