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
- In an editor, have two paragraphs
<p>ab</p><p>bc</p>
- Select last letter of first paragraph and first letter of second paragraph and copy it
<p>a[b</p><p>b]c</p>
- 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.
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 alsoeditor.getSelectedHtml()
. For instance, if it could be useful to know that a copied block was partially selected, we may mark it with adata-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).