Opened 14 years ago

Last modified 14 years ago

#5986 confirmed New Feature

Join links when joining block elements with DEL or BACKSPACE

Reported by: Jude Allred Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description (last modified by Frederico Caldeira Knabben)

  1. go to ckeditor.com/demo
  2. set the 'source' to
    <p>
    	<a href="foo">I am a link</a></p>
    
  3. return to wysiwyg mode
  4. place the cursor immediately before the 'l' in 'link'
  5. press enter
  6. press backspace
  7. view source

[expected]: The source is relatively unaltered: there's only one link.

[actual] there are two links:

<p>
	<a href="foo">I am a </a><a href="foo">link</a></p>

Some more info: Pressing 'enter' the first time breaks the links apart. I would consider this a bug, but the behavior is somewhat reasonable. Pressing 'backspace' removes the break and the links are now adjacent. The expected behavior here is that the links have rejoined, since the "backspace" logically has undone the action of pressing "enter".

Change History (2)

comment:1 Changed 14 years ago by Frederico Caldeira Knabben

Description: modified (diff)

comment:2 in reply to:  description Changed 14 years ago by Frederico Caldeira Knabben

Status: newconfirmed
Summary: paragraph break inside link creates 2 links; deleting paragraph break does not join them.Join links when joining block elements with DEL or BACKSPACE
Type: BugNew Feature
Version: 3.0

Replying to Jude Allred:

Pressing 'enter' the first time breaks the links apart. I would consider this a bug

There is no way to represent a single link among two different paragraphs in HTML. No bug here.

Pressing 'backspace' removes the break and the links are now adjacent. The expected behavior here is that the links have rejoined, since the "backspace" logically has undone the action of pressing "enter".

No, the backspace didn't undo anything. It simply deletes what we have before the caret (the line break in this case). As we have two separate links, it's normal to have them adjacent to each other. So, the reported result is definitely expected.

We could instead consider having a new feature here, which would join links if their attributes match, when joining block elements.

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