-
Notifications
You must be signed in to change notification settings - Fork 65
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
In YAML, treat a:b (without space) as text, not key-value pair #15
Conversation
It's likely this will break (rarely used) JSON-like quoted keys: 'key':value
"key":value |
Now that I've looked it up on the spec, I don't think your example is valid YAML.
That kind of syntax is is only allowed within flow syntax (e.g. |
Shouldn't the test for constexpr bool isspacechar(int ch) noexcept {
return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d));
} |
https://yaml.org/spec/1.2/spec.html#Characters |
22868b2
to
899bab7
Compare
Yeah, it should just be space, tab, newlines, or nothing (end of file). I've modified the patch to check for IsWhiteSpaceOrEOL(lineBuffer[i + 1]) || i == lengthLine - 1 where |
Committed the changes. There were some problems with committing the first patch so the change to .gitattributes was extracted as a separate commit. |
Fix included in 5.1.0 release. |
Currently
a:b
in YAML is parsed as if it's a key:value pair in a mapping, but instead it should be a text scalar.Example:
Current styling:
Expected styling:
There are two commits in this merge request. The first commit adds a YAML test directory containing some simple test cases for the sake of having that structure there. The second commit is the actual bugfix, including the test case mentioned above. I haven't added an entry in LexillaHistory because I'm not sure if you prefer to write it yourself, but let me know if I should supply it as well.