Skip to content
Permalink
Browse files

Merge branch 't/11982b'

  • Loading branch information...
pjasiun committed Feb 24, 2015
2 parents 85c20b8 + 82c8871 commit 0db52ceca772eb344ca78815494f67de0c336587
@@ -8,6 +8,7 @@ Fixed Issues:
* [#12899](http://dev.ckeditor.com/ticket/12899): Fixed: Corrected wrong tag ending for horizontal box definition in [dialogui](http://ckeditor.com/addon/dialogui) plugin. Thanks to [mizafish](https://github.com/mizafish)!
* [#12796](http://dev.ckeditor.com/ticket/12796): Fixed: [Indent List](http://ckeditor.com/addon/indentlist) plugin unwraps parent li elements.
* [#12885](http://dev.ckeditor.com/ticket/12885): Added missing getData parameter documentation.
* [#11982](http://dev.ckeditor.com/ticket/11982): Bullet added in wrong position after *enter* key pressed in nested list.

Other Changes:

@@ -112,29 +112,36 @@
// </li> => </li>
// </ul> => </ul>

if ( firstChild || lastChild )
block[ firstChild ? 'insertBefore' : 'insertAfter' ]( blockGrandParent );
if ( firstChild || lastChild ) {

// If the empty block is neither first nor last child
// then split the list and the block as an element
// of outer list.
//
// => <ul>
// => <li>
// <ul> => <ul>
// <li> => <li>x</li>
// <ul> => </ul>
// <li>x</li> => </li>
// <li>^</li> => <li>^</li>
// <li>y</li> => <li>
// </ul> => <ul>
// </li> => <li>y</li>
// </ul> => </ul>
// => </li>
// => </ul>

else
// If it's only child, we don't want to keep perent ul anymore.
if ( firstChild && lastChild ) {
blockParent.remove();
}

block[lastChild ? 'insertAfter' : 'insertBefore']( blockGrandParent );

// If the empty block is neither first nor last child
// then split the list and the block as an element
// of outer list.
//
// => <ul>
// => <li>
// <ul> => <ul>
// <li> => <li>x</li>
// <ul> => </ul>
// <li>x</li> => </li>
// <li>^</li> => <li>^</li>
// <li>y</li> => <li>
// </ul> => <ul>
// </li> => <li>y</li>
// </ul> => </ul>
// => </li>
// => </ul>

} else {
block.breakParent( blockGrandParent );
}
}

else if ( !needsBlock ) {
@@ -256,6 +256,7 @@
'test shift+enter key - end of block': se( 'editor', '<p>foobar{}</p>', '<p>foobar<br />^@</p>' ),
'test shift+enter key - before br': se( 'editor', '<p>foo{}<br />bar</p>', '<p>foo<br />^<br />bar@</p>' ),
'test shift+enter key - after br': se( 'editor', '<p>foo<br />{}bar</p>', '<p>foo<br /><br />^bar@</p>' ),

// #11947
'test shift+enter key - end of block, inside inline element followed by bogus br':
se( 'editor', '<p><em>foo{}</em><br /></p>', '<p><em>foo<br />^</em><br /></p>' ),
@@ -599,6 +599,51 @@
'</div>',

true, 'Dir change forces block.', true );
},
// #11982
'test enterkey: nested empty list': function() {
assertEnter( 'enterP',
'<ul>' +
'<li>' +
'foo' +
'<ul>' +
'<li>^</li>' +
'</ul>' +
'</li>' +
'</ul>',

'<ul>' +
'<li>foo</li>' +
'<li>^&nbsp;</li>' +
'</ul>',

true, 'New item should be added to the list.', true );
},

// #11982
'test enterkey: nested list with empty item': function() {
assertEnter( 'enterP',
'<ul>' +
'<li>' +
'foo' +
'<ul>' +
'<li>bar</li>' +
'<li>^</li>' +
'</ul>' +
'</li>' +
'</ul>',

'<ul>' +
'<li>' +
'foo' +
'<ul>' +
'<li>bar</li>' +
'</ul>' +
'</li>' +
'<li>^&nbsp;</li>' +
'</ul>',

true, 'New item should be added to the list.', true );
}
};
} )();
@@ -0,0 +1,28 @@
<div id="editor">
<ul>
<li>If something frightens you irrationally, do it often.</li>
<li>The only way you are going to have success is to have lots of failures first.</li>
<li>Fail often but do not forget the Lesson.</li>
<ul>
<li></li>
</ul>
</ul>

<ul>
<li>one</li>
<ul>
<li>two</li>
<ul>
<li>three</li>
<ul>
<li></li>
</ul>
</ul>
</ul>
</ul>

</div>

<script>
CKEDITOR.replace( 'editor', { height: 400 } );
</script>
@@ -0,0 +1,17 @@
@bender-tags: 4.5.0, tc
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea, toolbar, enterkey, htmlwriter, list, sourcearea

----

1. Put caret at the last nested item (empty one) in the first list.
4. Press `enter` key.

**Expected:** Last bullet should outdent.

----

1. Put caret at the most nested element in the second list.
2. Press enter few times.

**Expected:** Each `enter` key press should lead to outdent list one level.

0 comments on commit 0db52ce

Please sign in to comment.
You can’t perform that action at this time.