Problem : newline characters not kept by HTML form after pasting.
I’m developping an app that does JSON format validation check. I want to paste the JSON string in the form, then thave the app check its validity using the json module from Python.
Should there be any error, the function :
json.loads(jsonstring)
returns the line, and the column where the error is occuring. I need to retrieve the line and the number. However, pasting in my form doesn’t keep the newlines, hence everything is on line 1 …
What shall I do so that pasting in the form keeps the newlines ?
The answer to that question is to specify the option “wrap=soft” in the textarea tag. Which gives the following :