X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/643d726b32f530502411247a087274284e3f9c3a..da4ff24177c122a81ecae0e7693ffe2a3276ba1a:/src/smartxml/smartxml.test.js?ds=sidebyside diff --git a/src/smartxml/smartxml.test.js b/src/smartxml/smartxml.test.js index b50da7f..ce0d98a 100644 --- a/src/smartxml/smartxml.test.js +++ b/src/smartxml/smartxml.test.js @@ -942,6 +942,28 @@ describe('smartxml', function() { expect(contents[1].contents().length).to.equal(1); expect(contents[1].contents()[0].getText()).to.equal('b'); }); + it('removes across elements - 6', function() { + var doc = getDocumentFromXML('
aaabbbccc
ddd
'); + doc.deleteText({ + from: { + node: getTextNode('aaa', doc), + offset: 1 + }, + to: { + node: getTextNode('ddd', doc), + offset: 1 + } + }, { + error: function(e) {throw e;} + }); + + var contents = doc.root.contents(); + expect(contents.length).to.equal(2); + expect(contents[0].contents().length).to.equal(1); + expect(contents[0].contents()[0].getText()).to.equal('a'); + expect(contents[1].contents().length).to.equal(1); + expect(contents[1].contents()[0].getText()).to.equal('dd'); + }); }); describe('Splitting text', function() {