Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block new line inside list item no longer breaks list structure #2501

Merged
merged 12 commits into from
Jan 2, 2019

Conversation

jacekbogdanski
Copy link
Member

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

What changes did you make?

The fix could be as easy as skipping whole list moving inside enterkey plugin when block item is a placeholder (new line added for block elements, without it you cannot create new list item by an enter key). Although, it causes an issue where block tag style is copied into following list items, which is unwanted behavior in this special use case.

Be aware that this fix doesn't creating break empty lines inside list item. They still can be added using shift+enter keystroke which creates br tags in the same node and in the result are not touched by the fix.

Closes #2205

@Comandeer Comandeer self-assigned this Nov 22, 2018
@Comandeer Comandeer self-requested a review November 22, 2018 15:18
@Comandeer Comandeer changed the base branch from major to master November 22, 2018 15:18
@Comandeer Comandeer self-assigned this Nov 22, 2018
@Comandeer
Copy link
Member

Rebased onto latest master.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one hypothetical situation, in which this fix won't work. Imagine editor with CKEDITOR.ENTER_P enter mode, but with added div plugin. Content is copied from some trashy source (be it even Word!) and something like that is pasted into the editor:

<ul>
	<li>
		foo
		<div><br></div>
	</li>
</ul>

In such case pressing Enter inside div will delete the whole list item instead of adding new list item.

@@ -0,0 +1,20 @@
@bender-tags: 4.11.0, bug, 2205
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update version tag.

@jacekbogdanski
Copy link
Member Author

If I'm right the issue can be easily resolved by dropping block element type.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I've added changelog entry as it was missing.

@Comandeer Comandeer merged commit b864b71 into master Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants