title: Sanitizing HTML using Nokogiri
body: <p>I'm trying to clean up some CMS entered HTML that has extraneous paragraph tags and br tags everywhere. The Sanitize gem has proved very useful to do this but I am stuck with a particular issue.</p>
  
  <p>The problem is when there is a br tag directly after/before a paragraph tag eg</p>
  
  <pre><code>&lt;p&gt;
    &lt;br /&gt;
    Some text here
    &lt;br /&gt;
    Some more text
    &lt;br /&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>I would like to strip out the extraneous first and last br tags, but not the middle one.</p>
  
  <p>I'm very much hoping I can use a sanitize transformer to do this but can't seem to find the right matcher to achieve this.</p>
  
  <p>Any help would be much appreciated.</p>