Opened 14 years ago

Closed 10 years ago

#5756 closed Bug (fixed)

Pasting block element in inline element breaks html and causes cursor panic

Reported by: Arne Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version: 3.0
Keywords: IE Cc: satya_minnekanti@…

Description

First bug:

  1. copy some html content which contains a paragraph(or any block

element)

  1. Clear content in editor
  2. Add a single word
  3. make word italic/bold
  4. place cursor inside the word.
  5. paste
  6. place cursor at the last character of the content
  7. press enter

Observation:
The cursor jumps to the top of the editor and content is shifted down.

Second bug:

Repeat steps 1-6 above.

  1. place cursor at the beginning of the last paragraph
  2. press enter

Observation:
The cursor remains on same paragraph but content is shifted up.

Tested and confirmed in

  • FCKeditor 2.6.1
  • FCKeditor 2.6.6
  • CKEDITOR 3.2.1

HTML content before pasting :

<p><em>italic</em></p>

HTML after pasting :

<p><em>ita</p>
<p>paragrapn</p>
<p>lic</em></p>


I assume this behaviour is caused by the broken HTML

Change History (9)

comment:1 Changed 14 years ago by Arne

Applies to IE browsers

comment:2 Changed 14 years ago by Frederico Caldeira Knabben

Keywords: WorksForMe added

I'm not able to reproduce it with CKEditor 3.3. Can you confirm it?

comment:3 Changed 14 years ago by Arne

Yes, I reproduced it on the demo page.

I am pretty sure that the bug is related to the broken HTML caused by the IE browsers' native paste functionality. I tried the second patch in ticket #5309 and it doesn't break the HTML in the same way, and I can't reproduce the bug with that patch in IE8. (Implementing a context sensitive 'insertHtml' seems like the right way to go, but the patch still causes some IE7 errors)

Anyways, here are the exact steps I used for reproducing the bug last time I tried :

  1. Go to demo page.
  2. Clear all content
  3. Write a word and select it and copy it. Now try to paste it twice to make sure that you have copied the whole paragraph.
  4. Clear all content again.
  5. Write the word "italic" and make it italic.
  6. Place cursor in the middle of the word.
  7. Paste.
  8. Now position cursor after "lic" and hit enter. Observe the cursor jump to the top.
  9. Now position cursor before "lic" and hit enter. Observe that the cursor remains in the same position.

IE8 : A side effect I just noticed of reproducing this, is that Ctrl+A for selecting all text doesn't work after I have pasted.

Browsers :
IE7 - Version : 7.0.5730.13 - Windows Server 2008
IE8 - Version : 8.0.7600.16385 - Windows Server 2003 SP2

comment:4 Changed 13 years ago by Garry Yao

Component: GeneralCore : Pasting
Keywords: IE added
Status: pendingconfirmed
Version: 3.0

#6945 has been marked as a DUP.

comment:5 Changed 13 years ago by Garry Yao

Being a IE bug for years (any pasted block will not split up because of inline elements), we'll need simply a post-fixing solution if not having #5309.

comment:6 Changed 13 years ago by Garry Yao

#8012 is marked as DUP.

comment:7 Changed 13 years ago by Garry Yao

#7231 has been marked as DUP.

comment:8 Changed 13 years ago by Satya Minnekanti

Cc: satya_minnekanti@… added

comment:9 Changed 10 years ago by Piotrek Koszuliński

Resolution: fixed
Status: confirmedclosed

I couldn't reproduce it at all, because of changes we made in CKEditor 4.0. Since then entire insertion process is handled by CKEditor, so such problems don't occur.

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