Skip to content

String values with double quotes cause a non-JSON output #10

@jonmcoe

Description

@jonmcoe

<JSONPrettyView json={{"key": 'My "value" has double quotes in it'}} />

results in

{
  "key": "My "value" has double quotes in it"
}

screen shot 2018-07-04 at 8 33 22 am

which is no longer valid JSON.

It seems to me that the replace logic here is perhaps too aggressive https://github.com/chenckang/react-json-pretty/blob/master/src/JSONPretty.js#L47

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions