Reputation: 31847
I'm writing a Web application and I'm experiencing some troubles with the newLine chars.
My application allows create posts (like a forum) with the Markdown language. So it's plain text, not HTML.
Suppose that I create a post in Linux and then, I try to edit it in a Windows machine.
The new line chars are not respected. Do you know why? I thought that this was a problem already solved by the browsers...
How is the best way to suppport editing in a textarea in a multiplatform way?
EDIT: I cannot reproduce the problem in Chrome and Firefox, only in Internet Explorer.
Upvotes: 1
Views: 150
Reputation: 3684
The question is, how are you storing input from that textarea.
There could be many solutions, but to make it work multiplatform, I would suggest replacing newline chars with something more static (like 0x0A,
or other html entity), before storing in database. Afterwards, when it is retrived, you can replace back, to whatever you need.
Upvotes: 1