alek-sys / sublimetext_indentxml

Plugin for Sublime Text editor for reindenting XML and JSON files
MIT License
534 stars 135 forks source link

JSON without string quotes #55

Open prateekdonni opened 10 years ago

prateekdonni commented 10 years ago

@alek-sys I have been trying to use indent JSON function for getting the JSON formatted, however looks like it only understands : {"key": value} format. I would want to extend this to be able to handle: {key: value }. Most of the cases, people might be using the JSON as follows rather than the the quoted string format. Does this seem to be in scope for this ?

I would like to contribute.

TheChrisPratt commented 10 years ago

Technically, that's not JSON. JSON requires all keys to be quoted. I guess the plugin could be extended to handle JavaScript Literal Objects, which is what you're talking about, but that would definitely be more work, since they can have embedded functions. (Chris)

On Mon, Apr 7, 2014 at 10:01 AM, prateekdonni notifications@github.comwrote:

@alek-sys https://github.com/alek-sys I have been trying to use indent JSON function for getting the JSON formatted, however looks like it only understands : {"key": value} format. I would want to extend this to be able to handle: {key: value }. Most of the cases, people might be using the JSON as follows rather than the the quoted string format. Does this seem to be in scope for this ?

I would like to contribute.

Reply to this email directly or view it on GitHubhttps://github.com/alek-sys/sublimetext_indentxml/issues/55 .

prateekdonni commented 10 years ago

@TheChrisPratt . :+1: yeah, We have JS literal objects which are used quite a bit in places. I am going to fork and hack around and give it a shot.