Opened 7 years ago

Last modified 7 years ago

#16948 new Bug

Adding a list removes preceding empty line with enterMode = CKEDITOR.ENTER_BR

Reported by: Claas Augner Owned by:
Priority: Normal Milestone:
Component: Core : Lists Version: 4.7.0
Keywords: Cc:

Description

Problem

When using the CKEDITOR.ENTER_BR enterMode, adding a (numbered or bulleted) list after an empty line removes this preceding line.

Steps to reproduce

Step 1: Go to http://sdk.ckeditor.com/samples/enterkey.html

Step 2: Choose When Enter is pressed: Break the line with a <br> (Screenshot 1)

Step 3: Add the following text:

Line before empty line

First item

(Screenshot 2)

Step 4: Move the cursor to the line containing First item and press:

(Screenshot 3)

(Screenshot 4)

Expected behavior: A list is created with First item as its first item, leaving the preceding line intact. Actual behavior: The list is created, but the preceding line is removed (*).

(*) Note that in the example there is a margin between the first line and the list, so that the removal of the line is not necessarily noticable (especially in the example):

(Screenshot 5)

Solutions

The behavior of adding a list (same holds for indentation using the indentblock plug-in) should be changed so that it does not remove a preceding empty line.

It might be desirable to make this behavioral change configurable in order to maintain backward-compatibility.

Attachments (5)

4437082a-1496-11e7-93c5-e2222beb6a41.png (1.6 KB) - added by Claas Augner 7 years ago.
Screenshot 1
de646786-1495-11e7-818c-05072990026d.png (2.8 KB) - added by Claas Augner 7 years ago.
Screenshot 2
a91cb682-1495-11e7-9d58-3e07f8917ddb.png (197 bytes) - added by Claas Augner 7 years ago.
Screenshot 3
eb82fd2e-1495-11e7-91f2-e7f990bcfdb6.png (3.0 KB) - added by Claas Augner 7 years ago.
Screenshot 4
aac53670-1496-11e7-805f-0955b2eb8475.png (3.1 KB) - added by Claas Augner 7 years ago.
Screenshot 5

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Claas Augner

Screenshot 1

Changed 7 years ago by Claas Augner

Screenshot 2

Changed 7 years ago by Claas Augner

Screenshot 3

Changed 7 years ago by Claas Augner

Screenshot 4

Changed 7 years ago by Claas Augner

Screenshot 5

comment:1 Changed 7 years ago by Claas Augner

Marek wrote on GitHub:

As for this issue I don't see a strong reason why you'd need a <br> before list, since lists are by definition a block elements, and as such require line break. But that's something that should be discussed on Trac.

Note that converting First item to a list has the same result for the following inputs:

Line before empty line

First item

Both basically result in this (leaving aside CSS styling):

Line before empty line
- First item

However, I would argue that in the first example the user's intension was to separate the Line before empty line from the list explicitly by one empty line.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy