title: AngularJS: newline characters to paragraph elements
body: <p>Within Angular, I need to  generate a series of paragraph elements from a block of text containing newline characters?</p>
  
  <p>I can think of a couple of ways to do this. However I am wondering whether there is an "official" Angular way or just what the most elegant approach would be within the AngularJS context.</p>
  
  <h2>An Example</h2>
  
  <p>From:</p>
  
  <blockquote>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \n<br>
    Sed diam nonummy nibh euismod tincidunt ut laoreet dolore. \n<br>
    Magna aliquam erat volutpat. Ut wisi enim ad minim veniam.</p>
  </blockquote>
  
  <p>to:</p>
  
  <pre><code>&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&lt;/p&gt;
  &lt;p&gt;Sed diam nonummy nibh euismod tincidunt ut laoreet dolore.&lt;/p&gt;
  &lt;p&gt;Magna aliquam erat volutpat. Ut wisi enim ad minim veniam.&lt;/p&gt;
  </code></pre>
  
  <p>I can think of a number of ways to do this:</p>
  
  <ol>
  <li>Modify the text in the controller (though I prefer to avoid modifying my models)</li>
  <li>Using a directive, and generating paragraphs in a link function (seems overly cumbersome).</li>
  <li>Using a filter (my current favourite) to create an array to pipe into ng-repeat</li>
  </ol>