react-json-editor-ajrm
react-json-editor-ajrm copied to clipboard
JSONInput does not handle HTML entities properly
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: '&'
}
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