<textarea> to display and update multiline text with linebreaks (HubL and API)

Here is my situation:

1. I have a CMS page that I am using for data display and entry. One of the fields is a textarea.

2. When the page loads, I use the HubL crm_object() function to retrieve a custom object that has a multiline text property and I display it in the textarea.

3. If the user edits the textarea, I make an API call to update the object with the new value from the textarea.

This all basically works fine, except for newlines. If I update the textarea with any newlines, it stores just fine in the HubSpot property. However, when I reload the page and populate the textarea from HubL, the newlines are gone.

Here is the HTML/HubL:

<textarea style="white-space: pre-wrap;" rows="4" cols="40" placeholder="Please enter your feedback here...">{{ studentclassinstance.feedback_summary }}</textarea>

Here is my page with the textarea before the API call:

Here is the HubSpot object after the API call (you can see the newlines were preserved):

And here is my page after refreshing, loading the object via crm_object() and displaying the property in the textarea (you can see the newlines are gone):

I have read a number of articles suggesting using javascript to replace \\n with \n or \n\r or even <br>, but nothing seems to work. I really just need this textarea to properly display and update the HubSpot property with newlines.

Hey, @jeremytliles :waving_hand: Thanks for your question. Can you share a snippet of the JS you tried? Many of our community members are proficient with JS and might have a tweak or suggestion for you.

Best,

Jaycee