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

json-viewer fails to parse JSON #301

Open
jribbens opened this issue Jun 20, 2021 · 1 comment
Open

json-viewer fails to parse JSON #301

jribbens opened this issue Jun 20, 2021 · 1 comment

Comments

@jribbens
Copy link

The following JSON file confuses json-viewer, which fails to parse it correctly:

{"foo":"a[\\\"=\"\"]"}

It displays:

{
  "foo": "a[\\\"=\"\"
]"}

and anything else from that point in the file onwards fails to display correctly.

@jacoblimzm
Copy link

jacoblimzm commented Jan 17, 2022

it seems that a long string of special characters that may or may not be escaped with multiple backslashes confuses this plug-in and causes it to fail. I have encountered this problem with a particularly long regex pattern.

"validate": 
{
 "required": true,
"pattern": "^(([A-Za-z0-9\\-\\_\\.\\;\\ \\\"\\'\\(\\)\\\\!\\?\\*\\,\\.\\^\\*\\+\\=\\{\\}\\/\\[\\]\\\\\\|\\:\\;\\>\\`\\~]|\\r\\n|\\r|\\n)*)$",
"customMessage": "Please check the characters keyed into the description field, ensure symbols are keyed in directly from keyboard.",
"maxLength": 16000
},

what happens is that the arrow to collapse arrays and objects will all be placed in the wrong positions, even where the JSON is rendered correctly.

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