zhgzhg / Geany-JSON-Prettifier

A JSON formatter prettifier, minifier and validator plugin for Geany editor
GNU General Public License v2.0
26 stars 2 forks source link

Plugin does not work #7

Closed jl2035 closed 4 years ago

jl2035 commented 4 years ago

Hi. I installed the plugin using make, make install as the instructions say.

When I try to beautify valid JSON text I get the following error:

lexical error: invalid char in json text.
              {'server.port': 10443, 'serv
(right here  -----^

It seems like r is the invalid character, but if I move the json values around, the error is still the same. Seems like the 3rd character in the first json key is allways invalid.

I've been looking for such plugin for many years and it would be awesome to get it working.

zhgzhg commented 4 years ago

Hello, @jl2035 , I think the reason for the above error are the single ' quotes. The JSON standard requires using double quotes ".

For e.g. this would prettify without errors: {"server.port":10443}

while the one below will fail: {'server.port':10443}

zhgzhg commented 4 years ago

I am assuming that the problem is gone. Feel free to reopen the ticket if the issue persists.