Textarea inserting \n in mongodb


#1

the text which i entered in textarea and press enter it is getting inserted in mongodb \n
so is it ok??
but when i display it in single line inspite of 3 enters, it still displays in a single line

shall i replace with \n with
tag
how to do that

what shall i do about it


#2

Take a look at this


#3

that was useful, thanks


#4

I think what you need in this case is to change the white-space property on the element that is displaying the text. white-space: pre-line is probably best, but you may want another option if your formatting needs are different. Have a look at https://developer.mozilla.org/en-US/docs/Web/CSS/white-space to get an idea of the different options.