title: Merge equal element DOM
body: <p>Hello I am a JavaScript developer, I'm trying to create a text editor working on the DOM. 
  I was able to implement, given the complexity, a good algorithm to wrap and unwrap the elements but now I find myself in some cases to have a dom like this:</p>
  
  <pre><code>&lt;p&gt;
     a
     &lt;strong&gt;b&lt;/strong&gt;
     &lt;strong&gt;c&lt;/strong&gt;
     &lt;strong&gt;d&lt;/strong&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;strong&gt;
      &lt;strong&gt;hello world&lt;/strong&gt;
  &lt;/strong&gt;
  </code></pre>
  
  <p>I would get a structure like this:</p>
  
  <pre><code>&lt;p&gt;
    a
    &lt;strong&gt;
      bcd
    &lt;/strong&gt; 
  &lt;/p&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;strong&gt;hello world&lt;/strong&gt;
  </code></pre>
  
  <p>So the question is: How can I get a dom "normalized", a combining tags adjacent? I would need a generalized technique that can be applied to my dom after changes have been made with the editor.
  Thank you and sorry for my english.</p>