Opened 8 years ago

Last modified 8 years ago

#13788 confirmed Bug

Pasting multi-block content on top of itself adds extra blocks

Reported by: Dusty Jewett Owned by:
Priority: Normal Milestone:
Component: Core : Editable Version: 4.0
Keywords: Cc:


Steps to reproduce

  1. In an editor, have two paragraphs


  1. Select last letter of first paragraph and first letter of second paragraph and copy it


  1. Paste the content over top of itself.

Expected result

Content should appear unchanged


Actual result

Pasted content is put into it's own block tags.


Other details (browser, OS, CKEditor version, installed plugins)

Expected result is the default behavior by contenteditable in latest Chrome, Firefox, IE.

Change History (1)

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

Status: newconfirmed

Symmetry between copy and paste would be very nice. It's hard to achieve it, because it's just an edge case of hundreds of other cases which also must somehow work, but it would indicate that we're doing things correctly.

Before 4.5.0 we had only editor.insertHtml() that we could tune up to handle this case. Currently, we have also editor.getSelectedHtml(). For instance, if it could be useful to know that a copied block was partially selected, we may mark it with a data-cke-sth attribute. This may allow avoiding situation that to fix this case we need to break other cases (and probability of that is pretty high).

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