AndrewRedican / react-json-editor-ajrm

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

String Literals do not parse correctly #87

Closed sunpar closed 1 year ago

sunpar commented 6 years ago
  1. What version of RJEA are you using (react-json-editor-ajrm version)? 2.5.8
  2. What operating system and processor architecture are you using? MAC OSX
  3. What did you do? Developer
  4. What did you expect to see? String literal to parse correctly in the editor
  5. What did you see instead? doesn't parse correctly, getting an error when rendering

Reproduce steps:

  1. Using the create-react-app example
  2. Modify one of the sample data properties to the following (I did it for the userID of the first person): 'Sum({< DateNum = {">=$(vGlobalStartDate)<=$(vGlobalEndDate)"},FrequencyNumber = {1}>} [Firm TNA])'
  3. Note that it renders as not a string at first
  4. Touch (dirty) the editor, and observe that it now errors out.
SachsKaylee commented 6 years ago

Hello @sunpar

thank you very much for reporting this. I can reproduce this issue on my end.

A workaround for now would be to also escape double quotes inside of strings: Sum({< DateNum = {\">=$(vGlobalStartDate)<=$(vGlobalEndDate)\"},FrequencyNumber = {1}>} [Firm TNA])

I'll label this as a bug and will close this issue once its fixed.