Trying to append/prepend multiple paragraphs?
<p>I'm having a problem with appending or prepending text with automatically placed line returns in it between paragraphs. For example:</p>

<pre><code>&lt;script&gt;
    $(document).ready(function () {
        $('#somelink').click(function () {
            $('#somediv').append("&lt;p&gt;Here's my first paragraph blah blah blah&lt;/p&gt;
    &lt;p&gt;Here's my second paragraph blah blah blah blah&lt;/p&gt;
    &lt;p&gt;Oh here's a third paragraph blah blah&lt;/p&gt;");
        });
    });
&lt;/script&gt;
</code></pre>

<p>doesn't seem to work because of the line return between paragraphs. I found if the <code>&lt;p&gt;</code> tags are right up next to one another it's fine, for example: </p>

<pre><code>&lt;p&gt;first paragraph&lt;/p&gt;&lt;p&gt;second paragraph&lt;/p&gt;
</code></pre>

<p>rather than:</p>

<pre><code>&lt;p&gt;first paragraph&lt;/p&gt;
&lt;p&gt;second paragraph&lt;/p&gt;
</code></pre>

<p>Hopefully that makes sense. The issue is the text being placed by these appends is user generated. If I'm updating the text content it's fine, because I know to eliminate the line returns for the text I enter. However if my client ends up taking over updates and uses the CMS's built-in text editor to say add a new paragraph, it'll automatically create line returns and break the script. Basically the text editor automatically formats the text like the not working example above. </p>

<p>Is there any way I can have the function remove those line breaks and get the <code>&lt;p&gt;</code> tags to run right next to each other? Or is there a way to preserve the text coming in as is, with the tags, that doesn't break the script? </p>
