Escape special characters in strings to render as expected for json #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes escape sequence characters not rendering correctly in strings/keys.
If a json string contains "\n" then it would be expected that the display of the json string would show "\n" rather than an actual new line (within a <pre> tag) or a space (within most other html tags). This updates how these values are displayed (but not the underlying value).
As an aside, it is possible to edit a string and add such characters into the string however this can't be done by directly typing them (AutosizeTextarea automatically escapes these characters meaning typing "\n" is stored in the json as "\n" which is not what we want). But pressing enter creates a "\n" and other special escape sequences can be copied in.
I ran the linter to ensure code formatting was valid. There are still some formatting changes in the PR that aren't covered by standard --fix.
Also, the pre-commit check (standard --fix) was failing for issues completely unrelated to my changes so I committed with --no-verify.