-
Notifications
You must be signed in to change notification settings - Fork 140
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
Empty string should be quote #41
Comments
Will 2d6a83d be enough? |
I'll make some tests to check if |
I made some tests and quotes are also needed for a string with only spaces. |
I found a reference implementation here: https://github.com/adamkiss/LibYAML/blob/master/yaml/Escaper.php We are also missing the single quoted part. I think adding TAB and SPACE to the require quoted character is OK. |
I don't think adding SPACE to the required character is what we want. |
Yeah, I get your point. But I think quoting something like "my string" is not a bad idea (the php version do this) and more robust. I'm not sure whether just quoting string starts/ends with space will introduce some corner cases? |
I would strongly prefer not to quote strings unless necessary, even if it means we need to iterate on the heuristic a few times to get it right. Quoting for leading/trailing whitespace seems like a good start. |
It looks good e52b058 ? |
e52b058: No need to check for starts_with or ends_with |
A style comment: |
Closed by #46 |
Hello.
I think I found an issue with my pull request #39:
I think that the empty string should be quoted, because otherwise, it will be parsed as a Unit.
Thanks.
The text was updated successfully, but these errors were encountered: