python - Keep newline characters from copy-pasting for JSON Validation -
problem : newline characters not kept html form after pasting.
i'm developping app json format validation check. want paste json string in form, thave app check validity using json module python.
should there error, function :
json.loads(jsonstring)
returns line, , column error occuring. need retrieve line , number. however, pasting in form doesn't keep newlines, hence on line 1 ...
what shall pasting in form keeps newlines ?
the answer question specify option "wrap=soft" in textarea tag. gives following :
<textarea "wrap=soft"> text pasted after copied output of json validation function. \n newlines characters gonna seen after pasted in text field. </textarea>
Comments
Post a Comment