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

Produces incompatible output when indicator characters appear without quoting #140

Closed
adamwight opened this issue Jul 12, 2023 · 1 comment · Fixed by #141
Closed

Produces incompatible output when indicator characters appear without quoting #140

adamwight opened this issue Jul 12, 2023 · 1 comment · Fixed by #141

Comments

@adamwight
Copy link
Contributor

adamwight commented Jul 12, 2023

Issue description

Here are a few example cases where values should have been quoted for maximum compatibility:

Ymlr.document!(%{a: ":foo"}) 
Ymlr.document!(%{a: "foo{{bar}}"}) 
Ymlr.document!(%{a: ":foo{{bar}}"}) 
Ymlr.document!(%{a: " foo "}) 

It seems that Ymlr is quoting as minimally as possible, but this causes issues with common parsers which are not totally robust to edge cases. yamlerl fails to parse documents where the indicator characters aren't quoted (in my case, specifically a scalar like ":{{foo}}").

Link to documentation

I wasn't able to find a section in the spec which says all indicator characters must be quoted, but this is the common practice that I've encountered.

@adamwight adamwight changed the title Produces invalid output when some special characters appear in values Produces incompatible output when indicator characters appear without quoting Jul 12, 2023
@adamwight
Copy link
Contributor Author

Okay I found that yamlerl has a more specific constraint: it's specifically :{ at the beginning of a value which causes the error. I'm not sure whether this is valid yaml (in which case it must be quoted by ymrl) or if yamlerl is incorrect in parsing this as syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant