Opened 9 years ago

Last modified 9 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:

Description

Steps to reproduce

  1. In an editor, have two paragraphs

<p>ab</p><p>bc</p>

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

<p>a[b</p><p>b]c</p>

  1. Paste the content over top of itself.

Expected result

Content should appear unchanged

<p>ab</p><p>b^c</p>

Actual result

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

<p>a</p><p>b</p><p>c^</p><p>d</p>

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 9 years ago by Piotrek Koszuliński

Status: newconfirmed
Version: 4.5.34.0

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