I think a better way to achieve this is to add
white-space: pre
or
white-space: pre-wrap
style to your div.
See: HTML – Newline char in DIV content editable?
I think a better way to achieve this is to add
white-space: pre
or
white-space: pre-wrap
style to your div.
See: HTML – Newline char in DIV content editable?