#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.
We have two possible behaviours when merging blocks (yours is just a special case of them):
<h1>foo</h1><h2>^bar</h2> => <h1>foo^bar</h1>
<h1>foo</h1><h2>^bar</h2> => <h2>foo^bar</h2>
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.