title: clean/sanitize HTML, but preserve loses HTML chars with Ruby/Rails + Nokogiri + Sanitize (?)
body: <p>We were using a combination of the Sanitize gem and HTMLEntities to do some clean up of user input HTML. The Sanitize gem used Hpricot, but now uses Nokogiri. I need to get Hpricot out of the app. </p>
  
  <p>Here are two test strings, each followed by the output I'm expecting:</p>
  
  <p>Test string 1:</p>
  
  <pre><code>"SOME TEXT &lt; '&lt;span style='background-image: url(\"http://evil.ru/webbug.png\")'&gt;MORE' &amp; TEXT!!!&lt;/span&gt;"
  
  expected_text = "SOME TEXT &lt; 'MORE' &amp; TEXT!!!"
  </code></pre>
  
  <p>Second test string (a slightly different path):</p>
  
  <pre><code>'Support &lt;i&gt;odd&lt;/i&gt; chars like " &lt; \' ‽'
  
  expected_text = 'Support &lt;i&gt;odd&lt;/i&gt; chars like &amp;quot; &amp;lt; &amp;#39; ‽'
  </code></pre>
  
  <p>Is this something you've solved? What tools did you use?</p>