Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Does not respect JSON style YAML. #5

Open
Tracked by #1
envygeeks opened this issue Jun 28, 2014 · 5 comments · May be fixed by #69
Open
Tracked by #1

Does not respect JSON style YAML. #5

envygeeks opened this issue Jun 28, 2014 · 5 comments · May be fixed by #69

Comments

@envygeeks
Copy link

Even though the spec doesn't explicitly display JSON style YAML it allows for it because of the massive spec and the way it allows certain kinds of sub-keys, however Atom's YAML parser does not recognize or respect keys and values in the following format (the way that it does with JSON itself):

{
  "key": "value"
}
@szhu
Copy link

szhu commented Jul 6, 2015

Screenshot for illustration

screen shot 2015-07-06 at 4 08 09 pm

@FranklinYu
Copy link

I think the YAML specification do explicitly display this. It's called Flow Collection Styles. Note that quotation mark is optional when key or value don't have whitespace:

outerkey: {key: value, "key with whitespace": "value with whitespace"}

which is equivalent to

outerkey:
  key: value
  "key with whitespace": value with whitespace

@winstliu
Copy link
Contributor

@FranklinYu Yep, I started working on it but never got the chance to finish it.

@jjlorenzo
Copy link

Hi any news from this?

@Nixinova
Copy link

Nixinova commented Jun 6, 2021

Here's an entire file that is wrongly colored due to this bug: https://github.com/Nixinova/Minecraft-Versions/blob/HEAD/src/versions.yml
It thinks the first colon from a json key makes the entire preceding text the key

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants