title: Parse HTML string into array
body: <p>I'm developing a wiki-like difference functionality for bodies of HTML produced by TinyMCE. <code>diff-lcs</code> is a difference gem that accepts arrays or objects. Most difference tasks are on code and just compare lines. A difference on bodies of HTML ridden text is more complex. If I just plug in the bodies of text, I get a character by character comparison. Although the output would be correct, it would look like garbage.</p>
  
  <pre><code>seq1 = "&lt;p&gt;Here is a paragraph. A sentence with &lt;strong&gt;bold text&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;The second paragraph.&lt;/p&gt;"
  
  seq2 = seq1.gsub(/[.!?]/, '\0|').split('|')
  =&gt; ["&lt;p&gt;Here is a paragraph.", " A sentence with &lt;strong&gt;bold text&lt;/strong&gt;.", "&lt;/p&gt;&lt;p&gt;The second paragraph.", "&lt;/p&gt;"]
  </code></pre>
  
  <p>If someone changes the second paragraph, the difference output involves the previous paragraphs end tag. I can't just use <code>strip_tags</code> because I'd like to keep formatting on the compare view. The ideal comparison is one based on complete sentences, with HTML separated out.</p>
  
  <pre><code>seq2.NokogiriMagic
  =&gt; ["&lt;p&gt;", "Here is a paragraph.", " A sentence with ", "&lt;strong&gt;", "bold text", "&lt;/strong&gt;", ".", "&lt;/p&gt;", "&lt;p&gt;", "The second paragraph.", "&lt;/p&gt;"]
  </code></pre>
  
  <p>I found plenty of neat Nokogiri methods but nothing I've found does the above.</p>