litejs / json-lite

Fast non-blocking JSON viewer for Chrome and Firefox
196 stars 17 forks source link

Copy formatted content to clipboard needed #15

Closed halmai closed 3 years ago

halmai commented 6 years ago

A JSON response coming from a server is hard to read. Therefore, I would like to copy the formatted JSON into my text editor to find things in it or edit some parts.

Unfortunately, Ctrl+C copies the unformatted content to the clipboard.

I would be happy with a nicely indented plain text on the clipboard but I can imagine somebody would like to paste the result in a text document so they would need the font colors as well. Could you add this feature, please?

I think the best would be to have these option in a Ctrl+Right click local menu:

lauriro commented 6 years ago

Ctrl+S saves original as it came from the server. Ctrl+C copies formatted content from selection without indentation (that is achieved with css).

Replacing css based indentation with text based indentation is actually already in my todo list.

halmai commented 6 years ago

Hi, thanks for the response.

If you have to do it several times a day then saving newer and newer files can be quite cumbersome, if you need it only on the clipboard, that's the reason why I asked this feature.

The text based indentation would be fantastic.

The indentation would be nice to be configurable (tabs/4 spaces/2 spaces/and maybe more options). Otherwise tab-based is the most flexible because it is the easiest to convert to the appropriate number of spaces. Any opposite way is more complicated because string values can also contain any number of spaces (and they often do) while tabs are (mostly) sent as backslash-plus-t.

xcv58 commented 5 years ago

This is a very useful feature. Any update?