Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12116 closed Bug (invalid)

HTML tags change when moving text up a line

Reported by: Karen Ananiev Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

  • Open demo and clear all content.
  • Change the paragraph format to Heading 1, don't add any text, hit enter
  • Change the paragraph format to Heading 2 and add some text
  • Click to the left of that text and hit backspace to move the text up a line. Or click to the first heading and hit delete.

Expected: Empty Heading 1 removed, Heading 2 go up without format changes.

Outcome: Heading 2 transforming to Heading 1.

Change History (2)

comment:1 Changed 5 years ago by Piotrek Koszuliński

Resolution: invalid
Status: newclosed

We have two possible behaviours when merging blocks (yours is just a special case of them):

  1. <h1>foo</h1><h2>^bar</h2> => <h1>foo^bar</h1>
  2. <h1>foo</h1><h2>^bar</h2> => <h2>foo^bar</h2>
  3. Well, there's also possible to work link Blink/Webkit (see #9998), but it's definitely incorrect.

Now, CKEditor and browsers (because CKEditor handles backspace only on Blink/Webkit due to #9998) implements 1st option. Why? Because some of us found this option more natural. Second option is kind of strange (at least for me and people I asked and most likely Firefox/IE developers who had to make similar decisions).

When previous block is empty, the situation is less clear. Indeed one may expect that current block will be preserved in such case. However, there's nothing clearly incorrect about applying the 1st option in this case as well. Therefore, for KISS, only one algorithm is implemented and we don't think it should be made more complex when it's not clear which solution is better.

comment:2 Changed 5 years ago by Karen Ananiev

@Reinmar thank you for so detailed explanation!

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy