Skip to content
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

Unsupported escaped characters \a and \/ #561

Closed
apstndb opened this issue Dec 1, 2024 · 1 comment · Fixed by #562
Closed

Unsupported escaped characters \a and \/ #561

apstndb opened this issue Dec 1, 2024 · 1 comment · Fixed by #562
Labels
bug Something isn't working

Comments

@apstndb
Copy link

apstndb commented Dec 1, 2024

Describe the bug

Escaped characters \a and \/ are not supported.
They are documented here.
https://yaml.org/spec/1.2.2/#57-escaped-characters

Escaped ASCII bell (x07) character.

[43] ns-esc-bell ::= 'a'

scaped ASCII slash (x2F), for JSON compatibility.

[53] ns-esc-slash ::= '/'

To Reproduce
https://go.dev/play/p/LyP5F1vUARi

Expected behavior
All escaped characters are supported.

Version Variables

  • Go version: Go 1.23.2
  • go-yaml's Version: v1.15.4

Additional context

I've found this incompatibility in testcases of bufbuild/protoyaml-go.
This appears to be explicitly tested, since string of Protocol Buffers also supports \a.

https://protobuf.dev/reference/protobuf/edition-2023-spec/#string_literals

charEscape = '\' ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | '\' | "'" | '"' )
@apstndb apstndb added the bug Something isn't working label Dec 1, 2024
@apstndb apstndb changed the title Unsupported escape sequences Unsupported escape sequence \a and \/ Dec 1, 2024
@apstndb apstndb changed the title Unsupported escape sequence \a and \/ Unsupported escaped characters \a and \/ Dec 1, 2024
@goccy
Copy link
Owner

goccy commented Dec 1, 2024

Thank you for your report ! I've fixed this problem with #562

@goccy goccy closed this as completed in #562 Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants