You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I now have a text containing special characters like this < >. When I open this text in jsonEditor and edit it, it becomes <> after editing. How can I resolve this?
#1531
Open
xujinshuo-li opened this issue
Jul 18, 2023
· 1 comment
The text was updated successfully, but these errors were encountered:
xujinshuo-li
changed the title
I now have a text containing special characters like this < >. When I open this text in jsEditor and edit it, it becomes <> after editing. How can I resolve this?
I now have a text containing special characters like this < >. When I open this text in jsonEditor and edit it, it becomes <> after editing. How can I resolve this?
Jul 18, 2023
The editor escapes script tags <> into < and > to prevent against XSS attacks (i.e prevent loading a JSON file containing <script>...</script> to execute this script.
We could change this but we need to be careful to stay safe against XSS attacks, it will require effort and care (replacing usages of .innerHTML with .innerText, which works quite differently).
The successor of this library, svelte-jsoneditor, has solved this issue.
befor edit:
after edit:
The text was updated successfully, but these errors were encountered: