Steps to reproduce: In VE standalone, edit <h1><i>abc</i>X<i>def</i><h1> , delete the 'X', then switch back to source mode .
Expected value: <h1><i>abcdef</i></h1>
Observed value: <h1><i>abc</i><i>def</i></h1>
This happens because an annotation data element generated by ve.dm.Converter contains an originalDomElementsIndex property, which is the index for the hashStore item that holds the DOM element from which it was generated. Currently, that index is generated using store.index( domElements, domElements.map( ve.getNodeHtml ).join( '' ) , which means the innerHTML content of the DOM element gets included in the hash string -- so <b>foo</b> indexes differently to <b>bar</b>.
Including the innerHTML content doesn't give any reliable guarantees of DOM element uniqueness (because a document can contain <b>foo</b>...<b>foo</b>). So unless I'm missing something, ve.dm.Converter should omit the innerHTML of a ve.dm.Annotation's DOM element from the hash string.