I’m using jHtmlArea to get some HTML from user, everything is good but when I try to paste some text from other websites, it doesn’t decode newlines to <br/> altought they are in the box. This only happens with pasted text, manually entered text is fine.
So when I want to display text correctly I use something like:
@Html.Raw(Model.Text.Replace(Environment.NewLine, "<br/>"))
But when I need to redisplay this same text in jHtmlArea for user to edit it, it loses all newlines. Does anyone know how to fix this?
I droped using it in the end, there is so much bugs that I don’t have the time to fix..
Anyway here is what I did to get saved text to display correctly with newlines (please check if the source is good before saving it to db if you plan on using this “hack”)