title: Convert \n in the text of a div into <br /> with JS
body: <p>Lets suppose I have the following HTML file.</p>
  
  <pre><code>...
  &lt;div class="field"&gt;
    Lorem ipsum dolor sit amet,\nconsectetuer adipiscing elit. ...
  &lt;/div&gt;
  ...
  &lt;div class="field"&gt;
    Phasellus faucibus molestie nisl.\nMorbi leo mi,\nnonummy 
    eget tristique non,\nrhoncus non leo. ...
  &lt;/div&gt;
  ... 
  </code></pre>
  
  <p>The following code is supposed to replace the \n characters with HTML-like new-lines (i.e. &lt;br /> tags). However, the result is that &lt;br /> sequences appear in the text verbatim, i.e. as if they were escaped before being pasted into the page.</p>
  
  <pre><code>$(".field").each(function() 
  {
      var oldText = $(this).text();
      var newText = oldText.replace(/\n/g, "&lt;br /&gt;");
      $(this).text(newText);
  });
  </code></pre>
  
  <p>How do I fix it so that it breaks the latin text with real new-lines?</p>