Is there a way to preserve line breaks from user input. At the moment I am just getting the user input sending it to mongoDb and returning that text. However if my input is : "new line", my output would be "new line". Can anyone suggest a fix?
Asked
Active
Viewed 748 times
2 Answers
0
a small addition to @FELIXMOSH's correct answer: also use word-wrap
because white-space
property can cause overflowing sometimes. And apply this css to the element that will host the mongodb data.
anyClass {
white-space: pre-wrap;
word-wrap: break-word;
}

Abdulhakim
- 620
- 8
- 11