question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

display new line character

See original GitHub issue

If I have an object like {key: "line1\nline2"} when viewing the json, the new line characters dissapear

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

2reactions
klappycommented, Oct 7, 2021

I have been testing this and so far this has worked swimmingly for all the use cases I’ve tested it on:

    <ReactJson
      style={{ whiteSpace: 'pre' }}
      src={json}
      theme="monokai"
    />
Screen Shot 2021-10-07 at 6 33 27 PM

The only downside I see is that the long lines overflow and need scrolling as they no longer wrap.

There doesn’t need to be any modifications to the codebase or a custom theme supplied as it is just as quick and simple as adding an option if there was one added. We may ask the dev team to edit the themes to do this by default but not sure how big the need is outside of the 3 of us on this issue.

1reaction
klappycommented, Oct 6, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Text Editor which shows \r\n? [closed] - Stack Overflow
To use Notepad++ for this, open the View menu, open the Show Symbols slide out, and select either "Show all characters" or "Show...
Read more >
How to display \r\n as new line in Notepad++ - Super User
Replace regexp \\r\\n with \n .
Read more >
EOL or End of Line or newline ascii character
Open any text file and click on the pilcrow (¶) button. Notepad++ will show all of the characters with newline characters in either...
Read more >
Python New Line and How to Python Print Without a Newline
The new line character in Python is \n . It is used to indicate the end of a line of text. You can...
Read more >
Create newline character - MATLAB newline - MathWorks
Create a newline character with newline and concatenate it onto a character vector. ... Although chr displays on two lines, chr is a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found