title: How to auto-update matching html/xml tag in Code Mirror
body: <p>I really like how Visual Studio html editor updates the matching tag. Example:</p>
  
  <p><code>&lt;h2&gt;Header&lt;/h2&gt;</code></p>
  
  <p>If we replace <code>&lt;h2&gt;</code> opening tag with <code>&lt;h3&gt;</code>, then the closing tag should change automatically to <code>&lt;/h3&gt;</code>. This should happen as we type.</p>
  
  <p>I'm trying to implement this on my own, but no luck so far. I thought that matchtags addon would be a good starting point, but it stops working if tag names do not match.
  Also, I noticed that xml mode marks closing tag as error on tag name mismatch, but I'm not sure how to use this to update the closing tags.</p>
  
  <p>I would appreciate any help from more experienced CodeMirror users.</p>
  
  <p>Thanks</p>