Can you help me with a problem I'm facing? I have a sentence stored in a textarea in my Postgresql DB and I need to display it on another page. However, if the user's input includes line breaks, like this:
Hello
everybody
The string in my database will contain "\n", but when I try to render it, the line breaks are still visible, making the sentences look like this:
Hello \n everybody
I've tried using CSS properties such as white-space: pre-line;
and white-space: pre-wrap;
, but they didn't work. I also attempted to replace "\n" with "
" in my Python backend code using:
message.replace("\n","<br/>")
But that didn't solve the issue either. Do you have any suggestions or ideas on how to fix this problem?
Thank you for your assistance.