Javascript: replacing newlines with <br/> working in FF and SAFARI and not working in IE
<p>Code in the post has been modified.</p>

<p>I was thinking that replacing \n with <br/> with javascript was quite a simple task, but it seems not to be so. Posts in <a href="http://www.bennadel.com/blog/161-Ask-Ben-Javascript-Replace-And-Multiple-Lines-Line-Breaks.htm" rel="nofollow">Ask Ben</a> or <a href="http://stackoverflow.com/questions/784539/replace-all-line-break-in-a-string-with-br-tag-in-javascript">StackOverflow</a> suggest that something as simple as:</p>

<pre><code>var myRe = new RegExp(/\r?\n/g); // to avoid the re literal caching problem
lDes = $("div.descr").html(); 
lDes = lDes.replace (myRe, "&lt;br/&gt;"); 
lDes = lDes.replace (/(http:\/\/\S+)/g, "&lt;a target=\"blank\" href=\"$1\"&gt;$1&lt;/a&gt;"); 
$("div.descr").html(lDes);
</code></pre>

<p>will get the job done. Indeed, this work in FF and Safari but not in IE.</p>

<p>Or, using  <a href="http://pastie.org/948352" rel="nofollow">postie </a> (great hint!)</p>

<p>Text has been created in a textarea and then stored in a database, then retrieved without further processing. It works using FF on windows and Safari on Mac. IE on windows, nada. Is it a major bug in my head? Is it a JQuery issue?</p>

<p>Have some idea about how to solve this? And possible reason for?</p>

<p>Many thanks</p>
