@@ -772,6 +772,10 @@ describe( 'DataController utils', () => {
772772 schema . extend ( '$block' , { allowIn : 'blockLimit' } ) ;
773773
774774 schema . register ( 'paragraph' , { inheritAllFrom : '$block' } ) ;
775+ schema . register ( 'blockQuote' , {
776+ allowWhere : '$block' ,
777+ allowContentOf : '$root'
778+ } ) ;
775779 } ) ;
776780
777781 test (
@@ -804,6 +808,60 @@ describe( 'DataController utils', () => {
804808 '<blockLimit><paragraph>foo [bar</paragraph></blockLimit><blockLimit><paragraph>baz] qux</paragraph></blockLimit>' ,
805809 '<blockLimit><paragraph>foo []</paragraph></blockLimit><blockLimit><paragraph> qux</paragraph></blockLimit>'
806810 ) ;
811+
812+ // See: https://github.com/ckeditor/ckeditor5/issues/1265.
813+ it ( 'should proper merge two elements which are inside limit element' , ( ) => {
814+ setData ( model ,
815+ '<blockLimit>' +
816+ '<blockQuote>' +
817+ '<paragraph>Foo</paragraph>' +
818+ '</blockQuote>' +
819+ '<paragraph>[]Bar</paragraph>' +
820+ '</blockLimit>'
821+ ) ;
822+
823+ model . modifySelection ( doc . selection , { direction : 'backward' } ) ;
824+ deleteContent ( model , doc . selection ) ;
825+
826+ expect ( getData ( model ) ) . to . equal (
827+ '<blockLimit>' +
828+ '<blockQuote>' +
829+ '<paragraph>Foo[]Bar</paragraph>' +
830+ '</blockQuote>' +
831+ '</blockLimit>' ) ;
832+ } ) ;
833+
834+ it ( 'should proper merge elements which are inside limit element (nested elements)' , ( ) => {
835+ setData ( model ,
836+ '<blockQuote>' +
837+ '<blockLimit>' +
838+ '<blockQuote>' +
839+ '<paragraph>Foo.</paragraph>' +
840+ '<blockQuote>' +
841+ '<paragraph>Foo</paragraph>' +
842+ '</blockQuote>' +
843+ '</blockQuote>' +
844+ '<paragraph>[]Bar</paragraph>' +
845+ '</blockLimit>' +
846+ '</blockQuote>'
847+ ) ;
848+
849+ model . modifySelection ( doc . selection , { direction : 'backward' } ) ;
850+ deleteContent ( model , doc . selection ) ;
851+
852+ expect ( getData ( model ) ) . to . equal (
853+ '<blockQuote>' +
854+ '<blockLimit>' +
855+ '<blockQuote>' +
856+ '<paragraph>Foo.</paragraph>' +
857+ '<blockQuote>' +
858+ '<paragraph>Foo[]Bar</paragraph>' +
859+ '</blockQuote>' +
860+ '</blockQuote>' +
861+ '</blockLimit>' +
862+ '</blockQuote>'
863+ ) ;
864+ } ) ;
807865 } ) ;
808866
809867 describe ( 'should leave a paragraph if the entire content was selected' , ( ) => {
0 commit comments