Filters

Here you can discuss about your favorite plug-in.
User avatar
HaRT
Moderator
Posts: 8945
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 87 times
Been thanked: 155 times

Filters

Post by HaRT » Mon 07 Oct, 2019 14:57

Latest post of the previous page:

pepak, a bug surfaced: the “JSON format” filter does not show up in *.json files where the top-level element is not an object, mostly affecting JSON files with a top-level array. According to the grammar, object is not the only valid top-level element, and top-level arrays are of particular importance.
How to reproduce: create a file named e.g. json.json with 2 characters: [], invoke Filters.
Фар есть инструмент, а не нянька. © 2009 DrKnS

pepak
Posts: 420
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 6 times
Been thanked: 22 times

Filters

Post by pepak » Mon 07 Oct, 2019 16:21

That is a limitation of the component used, I think. It would be possible to fix by wrapping the array inside an object, but it seems the detection of this case is more complicated than simply creating the wrapper manually. Also, if it really is a major issue for someone, they can easily set up an external JSON formatter instead of the built-in one and that will take care of any similar issues immediately.
Last edited by pepak on Mon 07 Oct, 2019 16:22, edited 1 time in total.

User avatar
HaRT
Moderator
Posts: 8945
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 87 times
Been thanked: 155 times

Filters

Post by HaRT » Mon 07 Oct, 2019 16:28

pepak wrote:
Mon 07 Oct, 2019 16:21
That is a limitation of the component used, I think.
What's the component? Those I used myself just had a separate method to handle top-level arrays.
If it turns out to be a limitation indeed, please document this to save people like me from spending time trying to figure out why the plug-in does not work in their case.
Last edited by HaRT on Mon 07 Oct, 2019 16:31, edited 1 time in total.
Фар есть инструмент, а не нянька. © 2009 DrKnS

pepak
Posts: 420
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 6 times
Been thanked: 22 times

Filters

Post by pepak » Wed 09 Oct, 2019 18:41

HaRT wrote:
Mon 07 Oct, 2019 16:28
pepak wrote:
Mon 07 Oct, 2019 16:21
That is a limitation of the component used, I think.
What's the component? Those I used myself just had a separate method to handle top-level arrays.
Henri Gourvest's SuperObject.
If it turns out to be a limitation indeed, please document this to save people like me from spending time trying to figure out why the plug-in does not work in their case.
Frankly, it never occurred to me that this might be a problem in the component. Maybe it can even cope, somehow.

Post Reply

Return to “General Plug-In Discussions”