Replace tags in CMS formated content
<p>I'm dealing with a CMS that formats a block of text like so.</p>

<blockquote>
  <p><code>&lt;p&gt;</code>Lorem ipsum dolor sit amet, consectetur adipiscing
  elit.<code>&lt;br&gt;</code>Vivamus lacus ipsum, semper non consequat eu, facilisis at
  lectus. Vestibulum et magna ac<code>&lt;br&gt;</code>odio semper porttitor lacinia
  congue orci. Vivamus suscipit eleifend dolor, in hendrerit<code>&lt;br&gt;</code>turpis
  bibendum ut.<code>&lt;br&gt;&lt;br&gt;</code>Morbi interdum augue et nisl ullamcorper sit
  amet ornare<code>&lt;br&gt;</code> lorem tempus. Duis nec nisi quis ipsum pulvinar
  volutpat. Suspendisse venenatis malesuada metus,<br>nec pretium dui
  cursus eget. Donec vitae lorem vitae risus dapibus malesuada congue
  vel nunc.<code>&lt;/p&gt;</code></p>
</blockquote>

<p>Double line returns <code>&lt;br&gt;&lt;br&gt;</code> are used to start new paragraphs. I can't change the CMS output.</p>

<p>Since the block of text already has an opening <code>&lt;p&gt;</code> and closing <code>&lt;p&gt;</code> around it, I need to first switch double line return tags for an end <code>&lt;/p&gt;</code> tag and an opening <code>&lt;p&gt;</code> tag. Like so: "<code>&lt;br&gt;&lt;br&gt;</code>" = "<code>&lt;/p&gt;&lt;p&gt;</code>"</p>

<p>and then i need to strip the rest of the remaining <br> tags out and replace with just a space: <code>&lt;br&gt;</code> = <code>" "</code> </p>

<p>I tried this, </p>

<pre><code>$('#nomorefonts').submit(function () {
    $('br').replaceWith(function () {
        return $('&lt;/p&gt;&lt;p&gt;').append($(this).contents());
    });
    return false;
});
</code></pre>

<p>But it replaces each <code>&lt;br&gt;</code> tags with several opening and closing <code>&lt;/p&gt;&lt;p&gt;</code> tags.</p>

<p><strong>EDIT:</strong> The desired result is this:</p>

<blockquote>
  <p><code>&lt;p&gt;</code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus
  lacus ipsum, semper non consequat eu, facilisis at lectus. Vestibulum
  et magna ac odio semper porttitor lacinia congue orci. Vivamus
  suscipit eleifend dolor, in hendrerit turpis bibendum ut.<code>&lt;/p&gt;&lt;p&gt;</code>Morbi
  interdum augue et nisl ullamcorper sit amet ornare  lorem tempus. Duis
  nec nisi quis ipsum pulvinar volutpat. Suspendisse venenatis malesuada
  metus, nec pretium dui cursus eget. Donec vitae lorem vitae risus
  dapibus malesuada congue vel nunc.<code>&lt;/p&gt;</code></p>
</blockquote>
