My attempt to insert a neatly formatted JSON string into my textarea field has been unsuccessful.
I followed this method to format the string: How can I beautify JSON programmatically?
and then simply used
textarea.setValue(formattedJson);
Take a look at the outcome:
Is it feasible to display a correctly formatted string in the textarea?