AndrewRedican / react-json-editor-ajrm

A modular, easy to use, react component, to view, edit, and debug javascript objects.
MIT License
355 stars 126 forks source link

JSONInput does not handle HTML entities properly #206

Closed jluxenberg closed 1 year ago

jluxenberg commented 2 years ago

What version of RJEA are you using (react-json-editor-ajrm version)? 2.5.13

What operating system and processor architecture are you using? MacOS / ARM

What did you do? Instantiate JSONInput with an object having an HTML entity e.g. & like this:

import JSONInput from "react-json-editor-ajrm";
import locale from "react-json-editor-ajrm/locale/en";

export default function App() {
  const sampleObject = {
    a: "&"
  };
  return (
    <div className="App">
      <JSONInput
        id="a_unique_id"
        placeholder={sampleObject}
        locale={locale}
        height="550px"
      />
    </div>
  );
}

What did you expect to see?

I expect to see a JSON editor with the following object:

{
  a: '&amp;'
}

What did you see instead?

Instead, I see a JSON editor that looks like this

{
  a: '&'
}

Here's a CodeSandbox and a screenshot of the output I'm seeing: https://codesandbox.io/s/withered-water-lww2ik?file=/src/App.js

CleanShot 2022-03-23 at 15 48 21

AndrewRedican commented 1 year ago

I no longer intend to update this project. I am working instead on a complete rewrite.

I'd like to thank you for using and taking interest in this project.

I also would like to apologize for not following up sooner. However, do realize for the most part this has been a one-man show, and the occasional contributions I used to receive. What I am saying is, I am in dire need of volunteers.

If this is something you would be interested in participating in, you can join in the discussion.

I've taken note of this thread, and I'll keep this under consideration for the new project.