I want to create a string in a server action which will create a newline character when displayed on the front end using <p dmx-text="my_action.data.notes"></p>
, and will also look consistent when edited in a textarea.
In the server action I’ve done this:
sometext = 'bla bla'
newline = '\n'
notes = $_GET.notes + newline + sometext
In the paragraph on the front-end I want to see:
existing notes
bla bla
But with the code I have shown here, I see:
existing notes\nbla bla
What value do I need to give to newline
?
(Note that <br>
works for displaying in the <p>
tag, but shows the actual text <br>
when the value of notes
is displayed in a textarea)