Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide option for showing the spaces after keys #29

Open
tdauth opened this issue Feb 1, 2023 · 2 comments
Open

Provide option for showing the spaces after keys #29

tdauth opened this issue Feb 1, 2023 · 2 comments

Comments

@tdauth
Copy link

tdauth commented Feb 1, 2023

Hi,
when I have the following JSON content:

"x" : 10

this viewer shows it as:

"x": 10

and removes the space character after the key.
Can you provide an option to keep the space?
It would be helpful when copying the JSON to keep it more similar to the original.

@abodelot
Copy link
Owner

abodelot commented Feb 5, 2023

Hi @tdauth
This plugin does not cover parsing text to a JSON object, the jsonViewer function expects a valid JSON object, not text. Which means the HTML renderer has no info about the original formatting, if any!

An option to enforce a space before colon character in the renderer would possible though, but I'm unsure this is what you're looking for.

@tdauth
Copy link
Author

tdauth commented Mar 21, 2023

Yes this option would be sufficient. You could also make it more generic like:

beforeColon: ' ',
afterColon: ' ',

so the user can specify the characters before and after manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants