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.

I want to keep the input in the wrong format

See original GitHub issue

i want

{
  name: 'a',
  g
}

not

{
  name: 'a',g}

Is there any way?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
bbemis017commented, Feb 26, 2021

I’m not really familiar with this codebase but I did look into this about a month ago. Sorry if my notes are aren’t 100% right I probably should have posted this a while ago.

I focused debugging a specific example of broken json, a trailing } like I showed in the screen capture above. I found that in this section: https://github.com/AndrewRedican/react-json-editor-ajrm/blob/7e9b63353e9148dd425bef9952e66698f20b863a/src/index.js#L1493-L1498

a line break and indent is being dropped, messing up everything after the syntax error. An incredibly dirty fix for this specific case on line 1498 could be: buffer.markup += (_adjustment + newSpan(i,token,_depth) + newLineBreakAndIndent());

But of course there are multiple permutations on how something like this could occur so I didn’t see an easy fix.

Full Disclosure: After reading the code I decided to switch to a different library instead https://www.npmjs.com/package/jsoneditor https://www.npmjs.com/package/jsoneditor-react

0reactions
vejandlacommented, Feb 25, 2021

I looked at the code a bit. But, unfortunately, couldn’t figure out. If you have any pointers please let me know. Happy to work on it. @bbemis017

Read more comments on GitHub >

github_iconTop Results From Across the Web

I keep getting input string is in wrong format - CodeProject
Replace the fixed string with a TextBox and it still works for me: int HighScore = int.
Read more >
Forgive user input in the wrong format - Peter Hilton
Nearly every web site that sells something has credit card number input user interface. Many get it wrong. Credit card numbers have eight...
Read more >
How to inform error when user leaving wrong format input?
The try/except statement should fit nicely: try: number = int(input("Input the number: ")) print ("Input "+ str(number) + " elements in the ...
Read more >
Fix text-formatted numbers by applying a number format
Technique 1: Convert text-formatted numbers by using Error Checking ; A large range of cells. Click the first cell in the range, and...
Read more >
<input type="url"> - HTML: HyperText Markup Language | MDN
The input value is automatically validated to ensure that it's either empty or a properly-formatted URL before the form can be submitted.
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