I want to be able to take a multi-line input (or rich text editor etc) have the visitor write a number of lines of text on separate lines (line breaks) and then use this output in an HTML element and keep the formating - each line on a separate line
What is currently happening is I get one long line as the output with no line breaks… So I will assume that all the html is stipped along the way.
Is there a way to get around this?
One way I could do this (thinking as I type) would be to create a repeating group and construct the line breaks with html and output that… but that seem link overkill.
and do a find/replace for those characters and replace with: <br>
Unfortunately I’m not sure if the bubble’s multi-line input will recognize a new line normally. I could be wrong, but to be honest I haven’t spent too much time playing with multi-line input.
Thanks for that it will be a good workaround in the interim… I did try output as json and that almost worked as it ads a /n to the output but I couldn’t find and replace it for some reason.
Actually, I have managed to do it… in case anyone else comes across this.
there are probably a few ways to do this but this is the one I’ve currently chosen.
Create a custom state to hold the data from the multi-line input upon clicking a save button
In the HTML Ensure the value is formatted as Safe JSON. see image:
Now in the HTML element you would like this rendered:
Add the custom state from above and then run two find and replace one after the other:
first to remove double quotes:
Second to remove \n and replace with
Works at my current stage of testing (documented for my own reuse if necessary).